I am quite new to Mathematica so sorry if this is quite a simple fix. I was just wondering if anyone knew a solution that could help me fix this. Any help is appreciated, thanks in advance.

enter image description here


closed as off-topic by Szabolcs, zhk, Bob Hanlon, Chris K, bbgodfrey Oct 8 '17 at 14:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Szabolcs, zhk, Bob Hanlon, Chris K, bbgodfrey
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ how is plot defined $\endgroup$ – Coolwater Oct 8 '17 at 12:43
  • $\begingroup$ Ah yeah, it's a Capital thanks I fixed that up, but I still have an error from the DSolve. $\endgroup$ – john smith Oct 8 '17 at 12:46
  • $\begingroup$ ca is black (not blue) in your screenshot. It indicates that it has a definition, which should not be the case. Also, you have a ; after the definition of odes. Remove it so you can see what it actually evaluates to. The same with the DSolve line. That'll make it clear to you what is happening. $\endgroup$ – Szabolcs Oct 8 '17 at 12:53
  • $\begingroup$ Thanks for the help I did as you said but I am still unsure how to fix it. $\endgroup$ – john smith Oct 8 '17 at 13:01

Here is what you are looking for.

odes = {ca'[t] == -k1*ca[t], cr'[t] == k1*ca[t] - k2*cr[t], 
  cs'[t] == k2*cr[t] - k3, ct'[t] == k3, ca[0] == ca0, cr[0] == 0, 
  cs[0] == 0, ct[0] == 0}

sol = DSolve[odes, {ca[t], cr[t], cs[t], ct[t]}, t][[1]] // Simplify

With[{expr = {ca[t], cr[t], cs[t], ct[t]} /. sol}, 
 Manipulate[Plot[expr, {t, 0, 10}], {{ca0, 0.2}, .1, 1}, {{k1, 0.2}, .1, 
   1}, {{k2, 2}, .1, 3}, {{k3, 0.2}, .1, 1}]]


With[{expr = {ca[t], cr[t], cs[t], ct[t]} /. sol}, 
 Manipulate[Plot[expr, {t, 0, 10}], {ca0, .1, 1}, {k1, 0, 1}, {k2, 2, 3}, {k3, 0, 1}]]
  • $\begingroup$ Thank you so much, your code was spot on. I appreciate the help. $\endgroup$ – john smith Oct 8 '17 at 13:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.