[Top][All Lists]

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

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


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)

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

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

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

% Print the result

% 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?



GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ +++

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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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