help-octave
[Top][All Lists]
Advanced

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

Re:Solving functional nonlinear equation


From: Riccardo Corradini
Subject: Re:Solving functional nonlinear equation
Date: Mon, 28 Dec 2009 14:18:10 +0000 (GMT)

I think you could write a c++ function that could speed up the loop (for end) (maybe seven times faster).
Have a look at this
http://octave.sourceforge.net/coda/index.html
http://www.mathias-michel.de/download/howto-octave-c++.ps
I think you could use feval inside the C++ loop to incorporate  matlab/octave functions inside C++ extensions.. Have look at  http://old.nabble..com/Octave-f1895.html and octave manual for examples on using feval.
Hope these hints may help you.
Bests regards
Riccardo Corradini   
--- Lun 28/12/09, Chengqi Chang <address@hidden> ha scritto:

Da: Chengqi Chang <address@hidden>
Oggetto: Re:Solving functional nonlinear equation
A: address@hidden
Data: Lunedì 28 dicembre 2009, 08:34

On Mon, 28 Dec 2009 02:03:05 +0800, <address@hidden> wrote:

I missed this requirement.
> for different values of "a"

x=linspace(.1,1,20);y=linspace(.1,1,20);[xx,yy]=meshgrid(x,y);
for a=[1.1,1.2,1.5,2]
    Hfxy=@(x,y)( (-1/a^2)*(x.*y).^(1/a-1)+(1/a)*x.^(1/a-1)+(1/a)*y.^(1/a-1));
    Dfxy=Hfxy(xx,yy);
    figure;surf(xx,yy,Dfxy);shading interp;fflush(1);
end


BTW: when I firstly divided both x,y into 100 grid points, GNU plot 
functions very very slow(Octave 3.2.0, GNU plot 4.3.0). I much appreciate 
you help if someone can tell me how to improve its performance.

--
Best Regards!
---------------------------
Sincerely,            Chengqi Zhang
China Center for Economic Research
Mail: address@hidden
Personal Website: http://macro2.cn
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

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