help-octave
[Top][All Lists]
Advanced

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

lsode question


From: dogan_79
Subject: lsode question
Date: Tue, 6 Dec 2011 01:21:17 -0800 (PST)

Hello, I am kind of new to Octave, I wrote the following code to solve the
set of a diff. equations with lsode. 
The thing is it works for a different set of parameters like it gives result
pretty fast for t = linspace(0,3.0,4000) but if I change it to t =
linspace(0,3.2,4000) it takes forever to give anything, kind of freezes. Is
this a bug or am I doing something wrong. The code is as follows: 

function vdot = func (v,t)
g = 9.80;
R = 10;
mu = 0.8;
vdot(1) = v(2);
vdot(2) = (-1*g/R)*sin(v(1))-sign(v(2))*((g*mu/R)*cos(v(1))+mu*v(2)*v(2));
endfunction

v_0 = 0;
R = 10;
theta0 = 90;
v0 = [theta0*3.141592654/180; v_0/R];
t = linspace(0,3.0,4000);
v = lsode ("func", v0, t);
plot (t', v(1:4000,1))

Thank you very much in advance,
Dogan Erbahar
Physics PhD canditate from Turkey

--
View this message in context: 
http://octave.1599824.n4.nabble.com/lsode-question-tp4164020p4164020.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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