help-octave
[Top][All Lists]

Solving a trivial ODE with lsode?

 From: Dirk Koschützki Subject: Solving a trivial ODE with lsode? Date: Thu, 12 Feb 2004 06:09:30 -0600

Hello,

I'm trying to solve a trivial ODE with octave (2.1.35) . This example is
used just to get a feeling for octave.

My problem is: I did not get the correct solution.

This is my program:

----
% I'm interested in the values between 0 and 20.

cord_x = linspace(0, 20, 100);

% The "target" function is power(x,2)
function y = quadrat(x)
y=x.*x;
endfunction

% Derivative function of the target. 2*x
function y = ableitung (x, t)
y = 2.*x;
endfunction

% fix value with x0 = 0 = ableitung(0) = quadrat(0) = cord_x
x0 = ;

% Do the work!
abl_y = lsode ("ableitung", x0, cord_x);

% Print the result
abl_y

% and finally give me a plot!
plot(cord_x, quadrat(cord_x),cord_x, ableitung(cord_x),cord_x, abl_y)

----

As you can see in the plot and in the result of abl_y: all values are 0.

Can anybody tell me whats wrong?

TIA!

Dirk

--
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

reply via email to