[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I solve equation of motion?
From: |
NIITSU Taichi |
Subject: |
Re: How can I solve equation of motion? |
Date: |
Wed, 04 Dec 2002 03:59:09 +0900 |
Dear John,
> The T argument in lsode can be a vector, so you can avoid the loop.
> If I understand what you want the random F to do, I think you are
> trying to do something like this:
>
> global F
> F = rand(5,1);
>
> function dx = ex(x,t)
> global F T
> ## Find value in F corresponding to current time interval.
> r = F (max (find (t >= T)));
> dx = [r-x(1); x(1)];
> endfunction
>
> x0 = [0; 0];
>
> global T
> T = (0:4)';
>
> ## Since there are discontinuities in the derivative function, you
> ## should tell lsode where they are for both accuracy and speed.
>
> Tcrit = T(2:4);
>
> y = lsode("ex",x0,T,Tcrit)
>
>
> jwe
I apologize for the reply having been overdue.
Thanks to your advice, my reserch will progress.
regards,
T,N
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Taichi Niitsu
address@hidden
090-6163-8588 / address@hidden
-------------------------------------------------------------
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
-------------------------------------------------------------