MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42921] Re: [mg42880] NDSolve
  • From: Peter <peter1963 at totalise.co.uk>
  • Date: Sat, 2 Aug 2003 04:12:50 -0400 (EDT)
  • References: <200308010525.BAA09770@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Steffen wrote:
> Hi all,
> unfortunately Mathematica is not able to solve the following:
> 
> NDSolve[{
> 
> y1'[x] == -k1 y1[x] y2[x] + km1 y3[x],
> 
> y2'[x] == -k1 y1[x] y2[x] + km1 y3[x],
> 
> y3'[x] == k1 y1[x] y2[x] + km2 y4[x] M - (km1 + k2 M) y3[x],
> 
> y4'[x] == -km2 M y4[x] + k2 M y3[x],
> 
> y1[0] = 10^13,
> 
> y2[0] = 10^16,
> 
> y3[0] = 0,
> 
> y4[0] = 0,
> 
> } , {y1 , y2 , y3 , y4} , {x , 0 , 50 10^-6}]
> 
> 
> 
> This is a differential equation system for a kinetical system ( y1 + y2 <=>
> y3 ,  y3 <=> y4). Only y1 and y2 exsists in the beginning. The constants k1,
> km1, k2, km2 and M are numbers and are defined above.
> 
> Mathematica gives an error: " NDSolve::ndnef : The number of differential
> equations (3) is not equal to the number of the initial conditions (1)."
> 
> But I did gave him all the initial conditions, did´nt I? By the way there
> are 4 eq. and 4 conditions.
> 
> I am sorry for this probably easy prob. I looked in Mathematica Help, in
> this forum and at Wolframs MathSource Webpage. I did not find anything for
> helping me to solve this Prob. This means, that I am making a very stupid
> mistake, but I do not know, which one. Can please anybody help me?
> 
> Thanks a lot
> 
> Steffen Nasterlack
> 
> University of Karlsruhe
> 
> Germany
> 
> 
> 
> 
Hi Steffen,
1.) are the constants Symbolic? They must not.
     => assign values to k1,k2,km1,km2 and M!
2.) use "==" instead of "=" for init.cond.!
3.) drop the "," between "y4[0]==0" and "}"!

Now it works (at least with Mathematica 4.0 for Windoze)


Regards,
   Peter




  • References:
    • NDSolve
      • From: "Steffen" <nnnx@gmx.de>
  • Prev by Date: Re: PDE
  • Next by Date: Loop and NMinimize
  • Previous by thread: NDSolve
  • Next by thread: Re: NDSolve