|
From: | franco basaglia |
Subject: | Re: octave and delay ode's |
Date: | Thu, 5 Nov 2009 12:31:38 +0100 |
the functions in odepkg use adaptive time-stepping so
On 3 Nov 2009, at 14:58, franco basaglia wrote:
What exactly does "delta t" mean in your file?
what do you mean by "time units"?
>From your pdf file and your script I get the feeling that you are confusing the
time parameter in the continuos problem and the number of time-steps in the discretized
system...
Yes.You're right. I have confused "delta t" (time parameter in the contiunuos problem) and time-steps in the discretizet system, that are my "time units".
These time units are 5 and 10 in my DISCRETE function "delay".
Are you meaning this or that I have to modify my system in a discrete time system?
I'm confuse about this question because, for example, Stella runtime equation is something like this:
....
L(t) = L(t−dt)+(−LtoM−LtoF)×dt
T(t) = T(t−dt)+(DELAY(S×(1−GP),10)×(1−T))×dt
and Euler and 4th-order Runge-Kutta methods are used
with time step dt set to 0.5 year
1) you cannot know in advance what the value of dt will be
and
2) dt it will vary during the simulation
therefore specifying the delay in terms of dt makes no sense,
if your time is measured in years your delay must also be expressed in years.
In particular the following command in your script:
res = ode45d (@fun, t, init, [5,10],ones(7,2));
means that at any given time t, "fun" will be called as
fun (t, x, xd)
where xd(:,1) is the value of the state vetor at the time point t-5 years
and xd(:,2) is the value of the state vetor at the time point t-10 years
is that what you want?These are just warnings, you can safely ignore them at this stage, or specify the missing options if you want to get rid of them...
Anyway, I correct my script following your suggestion, but it doesn't work. And the different values from Stella concern, particularly, the 2 state variables with delay.
I have also this warning but I don't think that the problem is here:
warning: Option "RelTol" not set, new value 0.000001 is used
warning: Option "AbsTol" not set, new value 0.000001 is used
warning: Option "InitialStep" not set, new value 30.000000 is used
warning: Option "MaxStep" not set, new value 30.000000 is used
Your script runs without errors on my system, but I have no idea about what the results should look like so I cannot comment on their correctness.
I attach my new script.
c.
thanks
best regrads
f.b.
patumode45d.m
Description: Text Data
stellagsd0a600.png
Description: PNG image
OctDelaygsd0a600.ps
Description: PostScript document
OctNOdelaygsd0a600.ps
Description: PostScript document
[Prev in Thread] | Current Thread | [Next in Thread] |