Message Boards Message Boards

GROUPS:

Error while using NDSolve?

Posted 4 days ago
97 Views
|
1 Reply
|
0 Total Likes
|

Hi everyone

I am new to Wolfram.Mathematica. I am having issues with NDSolve as seen in the cloud notebook below. This is modeling a complicated chain of chemical reactions. The rate constants are seen as the first input, the rate for each reaction is shown in the second input, and the equations/variables for NDSolve are the 3rd and 4th inputs. I get an error in NDSolve that the values are not a list of numbers with dimensions and I get an error when I try to plot it that says the input value lies outside the range of data from the interpolating function. Also, I know the value of E6 at equilibrium (at long-ish time) should be 0.499949. Any help is appreciated! Thank you!

Here is the cloud link: https://www.wolframcloud.com/obj/a3a3a452-5b79-4455-b675-5cb20ae81b1c

Posted 4 days ago

You have k4r,k5r,k6r that are not defined in your notebook and somehow, for reasons I cannot explain yet, show up in the output of your NDSolve.

As a temporary measure I put

k4r=1;k5r=1;k6r=1;

at the beginning of your notebook.

Then at the bottom of your notebook you have

s=NDSolve[eqs/.kp->10^5, vars, {t,0,.001}]
Plot[Evaluate[Z5[t]/.s,{t,0,1},PlotRange->{0,0.5}]

where you appear to have solved the system over the range 0<=t<=.001, but your next line tries to evaluate this system over 0<=t<=1.

I made another change to those two lines

s=vars/.NDSolve[eqs/.kp->10^5,vars, {t,0,.001}][[1]]
Plot[s,{t,0,.000107163}]

I chose 0<=t<=.000107163 because of the error message from NDSolve saying that the system had failed at that time. That may be because of the choices I made for k4r,k5r,k6r.

But that did display what appear to be graphs of all your functions.

If I change one line of that to

s=Z5[t]/.NDSolve[eqs/.kp->10^5,vars, {t,0,.001}][[1]]

then it appears to plot Z5[t]

Can you try to reproduce exactly what I have done and see if you get exactly the same result?

Can you then substitute more sensible values for k4r,k5r,k6r and see if you get sensible functions plotted, perhaps even over your range 0<=t<=.001

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract