[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Divergence from Solving functional nonlinear equation

From: Jason Martin
Subject: Divergence from Solving functional nonlinear equation
Date: Mon, 28 Dec 2009 18:42:55 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20091204 Thunderbird/3.0


I don't have a slow system, and I don't fully understand Octave yet so please bear with me as I go through this.  I am running on windows 7 professional x64 with 4 Gbs RAM and an AMD Turon II CPU.  If I were to following this post,, and self compile Octave I am suspecting that my delay issues will be taken care of.  Please correct me if I am wrong.

Using your m-file and octave 3.2.3|gnuplot 4.2 I get:

> spdtst
Elapsed time is 7.92482 seconds.

Whereas if I use backend("fltk") instead of gnuplot I get:

> spdtst
Elapsed time is 1.3416 seconds.

Now, I know that I can get better performance by making Octave on my system, I haven't had time for it.  Also, the complaint was that using a matrix of size 100 generated a long wait time.

I modified the m-file to:

function vout = spdtst(valmat)
x=linspace(.1,1,160); y=x; [xx,yy]=meshgrid(x,y);
for a = rand(1,valmat)*2
  figure; surf(xx,yy,zz);shading interp;fflush(1);


and called it by spdtst(5).  This resulted in the following times:


> spdtst(5)
Elapsed time is 12.4465 seconds.


> spdtst(5)
Elapsed time is 1.44106 seconds.

*note that the gnuplot version takes almost twice as long as the hard coded version of the same m-file.

for a 25 element matrix:

> backend("fltk")
> spdtst(25)
Elapsed time is 6.64428 seconds.
> backend("gnuplot")
> spdtst(25)
Elapsed time is 79.4634 seconds.

For a small number of points, I don't think that it matters which version you use. For a large number of values however, it looks like fltk is faster, at least on my system.  I also didn't add in the time it took to actually draw each graph using the different backends.  FLTK was almost instantaneous, whild GNUPLOT was slow going.  It might be due to my graphics card, I am not sure.


On 12/28/2009 5:50 PM, Thomas Shores wrote:
Disregard my last post.  I misread the problem.  However, I'm a bit puzzled by the delay. This file, test.m

x=linspace(.1,1,160); y=x; [xx,yy]=meshgrid(x,y);
for a = [1.1,1.2,1.5,2]
  figure; surf(xx,yy,zz);shading interp;fflush(1);


gave this result on my system (Octave 3.2.3, gnuplot4.2), and of course produced the plots:

octave:1> test
Elapsed time is 1.49368 seconds.

On 12/28/2009 02:55 PM, Thomas Shores wrote:
If your objective is to do some plotting of f(x,y) in the xy-domain, read the comments that followed your post.  If it is to solve the equation, do a bit of formal algebra:  you say that a is a positive parameter.  Make the substitution b=1/a.  If you want to avoid complex variables, restrict the domain to x, y>=0.  If y=0, than any choice of a,x will solve the equation.  If y>0, cancel y from the equation to obtain b*x^(b-1) - 1=0. Thus y is irrelevant.  Now if you want a plot in xb-domain, follow Chang's suggestions along the lines of

x=linspace(.1,1,20); b=x; [xx,bb]=meshgrid(x,b);
surf(xx,bb, bb.*xx.^(bb-1) - 1)

On 12/27/2009 06:35 AM, Dorian wrote:
Hi  all,

How do I solve  the following functional nonlinear equation using octave

f(x,y)= (-1/a^2)*(x*y)^(1/a-1)+(1/a)*x^(1/a-1)+(1/a)*y^(1/a-1) =0

where  "a"  is positive parameter. 

If there is a way to plot  f(x,y) for different values of "a"
it will be very appreciated.

Thanking you in advance


_______________________________________________ Help-octave mailing list address@hidden

_______________________________________________ Help-octave mailing list address@hidden

_______________________________________________ Help-octave mailing list address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]