# Differential equation plotting (Solved) [closed]

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.

• how is plot defined – Coolwater Oct 8 '17 at 12:43
• Ah yeah, it's a Capital thanks I fixed that up, but I still have an error from the DSolve. – john smith Oct 8 '17 at 12:46
• 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. – Szabolcs Oct 8 '17 at 12:53
• Thanks for the help I did as you said but I am still unsure how to fix it. – 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}]]


or

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}]]

• Thank you so much, your code was spot on. I appreciate the help. – john smith Oct 8 '17 at 13:19