[Date Index]
[Thread Index]
[Author Index]
Re: differential equations
*To*: mathgroup at smc.vnet.net
*Subject*: [mg4530] Re: differential equations
*From*: saarinen (Sirpa Saarinen)
*Date*: Wed, 7 Aug 1996 04:17:38 -0400
*Organization*: Wolfram Research, Inc.
*Sender*: owner-wri-mathgroup at wolfram.com
N Kinoshita <nk204 at cam.ac.uk> writes:
>Hi, I am a research student of economics. I want to solve
>a system of differential equations with Mathematica.
>I wrote the follwoing command based on the example given
>in p.698 of 'Mathematica: A system for doing mathematics
>by computer'
>
>------------------------------------------------------------
>ks=0.380884;cs=0.0282254;ws=0.846308;
>k0=ks/10;
>cprimess=0.00778013/0.257126;
>wprimess=0.966347/0.257126;
>NDSolve[
>{c'[k]==
> If[k==ks,cprimess,
> (-0.012+0.952757k/w[k]^.7+0.11938/w[k]^.6
> +2.6603c[k]/w[k]^.1-0.635171w[k])
> /(0.875c[k]+0.952757k^2/w[k]^.7+1.04457k/w[k]^.6
> +2.6603c[k]k/w[k]^.1-0.635171k*w[k]^.3-0.447674w[k]^.4)
> ],
> w'[k]==
> If[k==ks,wprimess,
> (1.1938w[k]^.4+6.65074c[k]w[k]^.9-1.58793w[k]^1.3)
> /(0.875c[k]+0.952757k^2/w[k]^.7+1.04457k/w[k]^.6
> +2.6603c[k]k/w[k]^.1-0.635171k*w[k]^.3-0.447674w[k]^.4)
> ],
> c[ks]==cs, w[ks]==ws},
>{c,w},{k,ks,k0}]
>-----------------------------------------------------------
>Then I got the error message saying:
> NDSolve::deql:
> True is not a valid equation or list of valid equations.
>I was able to solve a single differential equation before,
>but do not know how to cope with my problem now.
>I would like to get some comments.
Your error message indicates that one of the entries was "True" instead of
an equation. I think that you by accident had defined for instance c[ks] = cs
and if you type c[ks]==cs in the set of equations, you will get "True".
However, this is not the root of your problem. I tried your equations as
you have given them and got
NDSolve::ndcf: Repeated convergence test failure at k == 0.380884; unable to
continue.
Out[5]= {{c -> InterpolatingFunction[{{0.380884, 0.380884}}, <>],
> w -> InterpolatingFunction[{{0.380884, 0.380884}}, <>]}}
This seems to indicate some type of problem in the beginning of your integration
interval that the multistep method is not able to handle. Maybe this is
worth looking into first.
Sirpa
saarinen at wolfram.com
==== [MESSAGE SEPARATOR] ====
Prev by Date:
**Piecewise Functions**
Next by Date:
**suppressing initialization**
Previous by thread:
**differential equations**
Next by thread:
**Re: Pairings**
| |