Re: Avoiding divide by zero error in NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg62467] Re: [mg62443] Avoiding divide by zero error in NDSolve
- From: <bsyehuda at gmail.com>
- Date: Fri, 25 Nov 2005 02:25:09 -0500 (EST)
- References: <200511241133.GAA29288@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I already posted you an answer on the students forum yehuda On 11/24/05, pradeep suresh <pradeep at purdue.edu> wrote: > > Hi all, > I am having this problem of mathematica not letting me specify the exact > intial values to a differential equation set. a simple example follws > > Simple Mass Balance Equation set in Chemical Systems. > > Nsp = 5; > k1 = 100; > For[i = 1, i < (Nsp + 1), i++, k2[i] = k1/Nsp]; > eqn1 = {D[M[t], t] == k1, M[0] == 0}; > eqn2 = Table[{D[M[t]y[i][t], t] == k2[i],y[i][0] ==k2[i]/k1},{i,Nsp}]; > var1 = Table[y[i][t], {i, Nsp}]; > var2 = Join[{M}, var1]; > sol=NDSolve[{eqn1,eqn2},var2,{t,0,10}] > > Mathematica refuses to solve this system showing error messages of > encountering 1/0. If i change the initial condition of M to some > arbitrary nonzero value, it is able to solve this system although now > the set of equations are practically meaningless for me. Is there any > way i can retain the meaning of my equations and still get them solved > by mathematica? Plz advice! > > Thanks & Happy thanksgiving, > Pradeep > >
- References:
- Avoiding divide by zero error in NDSolve
- From: pradeep suresh <pradeep@purdue.edu>
- Avoiding divide by zero error in NDSolve