help-octave
[Top][All Lists]
Advanced

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

Re: Differential Equation


From: Enrique Fernandez
Subject: Re: Differential Equation
Date: Sat, 15 Nov 2008 10:19:25 -0300
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Hello,

Because you have use ode45.

For example:

function osc=f(x,t);
  osc = -1.01*x;
endfunction
x0=1000;
t=linspace(0,100,100);
[Vt, Vx]=ode45(@f,t,x0);
plot(Vt, Vx);

Enrique Fernandez

William Christopher Carleton escribió:
I'm new to Octave and have tried to set up a simple differential equation that 
demonstrates variable behaviour as a result of a constant 'r'.

octave:1>function osc=f(x,t);
osc = -1.01*x;
endfunction

octave:2> x0=1000
octave:3> t=linspace(0,100,100)
octave:4> x=lsode("f",x0,t)
octave:5> plot(t,x)

The above equation should demonstrate an increasing oscillation, but instead 
plots as an exponential decay. What have I done incorrectly? Thanks,

Chris


_______________________________________________
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]