MathGroup Archive 2005

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

Search the Archive

Re: Avoiding divide by zero error in NDSolve


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


  • Prev by Date: Notation package in batch mode
  • Next by Date: Problems with brackets when exporting postscript
  • Previous by thread: Notation package in batch mode
  • Next by thread: Re: Re: Avoiding divide by zero error in NDSolve