From: Thomas Treichl <address@hidden>
To: timothy kinyanjui <address@hidden>
Cc: octave <address@hidden>
Sent: Friday, June 12, 2009 9:01:10 PM
Subject: Re: Solving ODE system in Octave
timothy kinyanjui schrieb:
>
> ------------------------------------------------------------------------
> *From:* Thomas Treichl <
address@hidden>
> *To:* timothy kinyanjui <
address@hidden>
> *Cc:* octave <
address@hidden>
> *Sent:* Friday, June 12, 2009 11:20:06 AM
> *Subject:* Re: Solving ODE system in Octave
>
> timothy kinyanjui schrieb:
> > Hi all?
> > I have set up a system of differential equations to solve an age structured model for disease transmission. I have it running okay in MATLAB. However, I want to move my models from MATLAB to Octave.
> > On running
the model in Octave, it generates the following errors:
> > > [time,Mv,M,S,I,R,Ir]=solve_rate1([0 30],3,beta,options);
> > Number of arguments supplied correct.
> >
> > ***** Integration in progress. Please wait... *****
> > --------------------------------
> > error: Unknown parameter name "BDF" or no valid parameter value
> > error: evaluating if command near line 278, column 9
> > error: evaluating switch command near line 55, column 5
> > error: evaluating for command near line 53, column 3
> > error: called from `odepkg_structure_check' in file `C:\Program Files\Octave\3.0.5_gcc-4.3.0\share\octave\packages\odepkg-0.6.4\odepkg_structure_check.m'
> > error: evaluating assignment _expression_ near line 82, column 19
> > error: evaluating if command near line 75, column 5
> > error: evaluating if command near
line 53, column 3
> > error: called from `ode45' in file `C:\Program Files\Octave\3.0.5_gcc-4.3.0\share\octave\packages\odepkg-0.6.4\ode45.m'
> > error: evaluating if command near line 66, column 5
> > error: evaluating while command near line 64, column 1
> > error: called from `solve_rate1' in file `d:\model_data\work\two_age_structure_model\solve_rate1.m'
> > octave-3.0.5.exe:15:d:\model_data\work\two_age_structure_model
> >
> > Is there a missing package that I may be required to install. I have used the ODE solver: ode45.
> > Waiting to hear from you.
> > regards,
> > tim
>
> Can you please send and output of your 'options' structure (and if you can send even more information about your code so that we can help)
>
> Thomas
> Here is the options function that I have supplied to the ode45 function.
>
options =
> {
> AbsTol = 1.0000e-020
> BDF = [](0x0)
> Events = [](0x0)
> InitialStep = 0.0010000
> Jacobian = [](0x0)
> JConstant = [](0x0)
> JPattern = [](0x0)
> Mass = [](0x0)
> MassConstant = [](0x0)
> MassSingular = [](0x0)
> MaxOrder = [](0x0)
> MaxStep = [](0x0)
> NormControl = on
> OutputFcn = [](0x0)
> OutputSel = [](0x0)
> Refine = [](0x0)
> RelTol = 3.0000e-014
> Stats = off
> Vectorized = on
> MStateDependence = [](0x0)
> MvPattern = [](0x0)
> InitialSlope = [](0x0)
> Reltol = [](0x0)
> }
>
> regards,
> tim
Ok, can you please set options.BDF="off" and try again?
Best regards,
Thomas
Thanks Thomas.
I have changed BDF to off but it could still not run.
I defined another new options structure in Octave using options=odeset( ); This created another default structure.
On using the new optiins structure, the following error occured.
error: Solving has not been successful. The iterative integration loop exited at time t = 18.000000 before endpoint at tend = 18.000000 was reached. This may happen if the stepsize grows smaller than defined in vminstepsize. Try to reduce the value of "InitialStep" and/or
"MaxStep" with the command "odeset".
octave-3.0.5.exe:141:d:\model_data\work\two_age_structure_model
I therefore reduced the InitialStep and the MaxStep to the values shown in the options structure below but the same error was generated. I really do not know what is missing.