Re: Avoiding divide by zero error in NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg62479] Re: Avoiding divide by zero error in NDSolve
- From: "Chris Chiasson" <chris.chiasson at gmail.com>
- Date: Fri, 25 Nov 2005 02:25:40 -0500 (EST)
- References: <dm49jj$sul$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Pradeep, I think the solution is a constant value. I renamed some of your variables, namely k1 is k[1], k2[1 thru 5] are k[2 thru 6], and M is m, but here is my code showing the solution: k[1]=100 eqns[1]=And[m'[t]\[Equal]k[1],m[0]\[Equal]0] solns[1]=DSolve[eqns[1],m,t] k[i_Integer/;i\[GreaterEqual]2]=20 eqns[2][i_]=And[D[m[t]y[i][t],t]\[Equal]k[i],y[i][0]\[Equal]k[i]/k[1]] solns[2][i_]=DSolve[eqns[2][i],y[i],t] y[2][whatevertime] %/.solns[2][2][[1]] %/.solns[1][[1]] Sorry for renaming your reaction rate constants and molarities, -- http://chrischiasson.com/contact/chris_chiasson