       Re: randomly chosen parameters fails NDSolvewith a large ode system

• To: mathgroup at smc.vnet.net
• Subject: [mg43427] Re: randomly chosen parameters fails NDSolvewith a large ode system
• From: Robert Knapp <rknapp at wolfram.com>
• Date: Wed, 17 Sep 2003 07:58:43 -0400 (EDT)
• Organization: Wolfram Research, Inc.
• References: <binckg\$eeb\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```sean kim wrote:
> hello group.
>
> this post is kinda long. and the cell that is causing me whole lotta
> problems is copied and pasted below. Thi scell has everythign that is
> needed to do the analysis that i'm talking about in this post.  also I
> can email the notebook to anyone who's interested in seeing it. Please
> let me know if this post doesn't make much sense.
>
> I have an ode system with 47 parameters and 23 differential equation.
> To study its behaviours, I'm randomy choosing parameters that are
> within the reasonable ranges(4 orders of magnitude for most)
>
> the initial conditions are derived from algebraic system that arise
> from the ode systems with assupmtions that some variables must be 0 in
> the initial system. Combined with the assumption that, at equilibrium,
> fact that you have the time derviatives == 0 allows for the reduction
> of the system and thus allows solving for the initial values of the
> remaining variables.( granted that the system is balanced, which is the
> problem I had with the last solve errors I posted about not so long
> ago.  That problem is troubleshot by adding terms into the systems that
> allows for creation and destruction of the terms.  I can describe in
> more detail if anyone wants to see it.) This initial condition must
> allow the system to reach the equilibrium.
>
> But obviously in my hands, this appears not to be the case. ( well not
> the equilibrium that i was expecting I was expecting smooth rises and
> falls)
>
> It seems to me the system has two odd behaviours after having picked
> thousands of random parameters sets and analyzed the system. First is
> that it gives lotta errors and doesn't give any plots. Second is that
> it seems to show plots of b[t] and few other variables oscillating
> wildly all the while the y axis doesn't change in the values. ( they
> could in theory and in real life oscillate but the oscillations that
> the system was giving was something that was unreasonable)
>
> and above two behavior is quite consistent which makes me think
> something isn't right.
>
> I have copied and pasted the problematic cell at the end of this
> message. Iteration is for 5 loops in this particular cell but i have
> done a lot more and the consistency of the errors and the weird
> oscillation is one thing that remains constant.

One of the problems you have is that it is not a good idea to use a dependent
variable with the same name as the independent variable.  i.e. t[t]
Mathematica 5 disallows this explicitly, in Mathematica 4.x it could possibly
lead to unpredictable behavior depending on exactly how substitution is handled.

>
> The following message from Mathematica 4.0 is an example of the first kind of
> behvaiour. Although I have seen other errors as well regarding
> suspected singularity.
>
> These are the errors I would like to learn to get rid of and the
> question of this post...  I'm sure there are ways to turn the error
> messages off, but the mathemtica will still go through the bad
> parametersets? how do change this so that the mathematica doesn't do
> the bad parameter sets? what am I missing here?

You can use the command Check which would check for messages issued and have

>
> I could implement a simulated annealing or gradient descent for this
> system, but i would like to make sure the system is behaving in
> reasonably relevant manner. and with all these errors and oscillations,
> it's kinda hard to believe the system is doing something correct...

One way to check to see if NDSolve is doing something reasonable is to use
different (ODE integration) methods and error tolerances and see if you get
qualitativly similar results.  With Mathematica 4.0, the number of methods is
quite limited, but with Mathematica 5, there are numerous methods to choose from.

When I ran you example with the t[t] variable corrected, and some different
methods in Mathematica 5, I still got messages about evaluation at points where
the function did not have a numerical value (usually a singularity) and the
integration stopped early, so my best guess would be that the behavior is a
property of the system for that choice of parameters.

Rob Knapp
Wolfram Research

```

• Prev by Date: Re: discrete frequency distribution
• Next by Date: Phasing a spectrum
• Previous by thread: Re: discrete frequency distribution
• Next by thread: Phasing a spectrum