# Solving a Set of Differential Equations and just get the Equations Returned

I'm trying to solve a set of differential equations and it just returns the equations back to me. I'm not entirely sure why, but admit there's probably some strategy I don't know.

Here's the code.

ClearAll["Global*"];
DSolve[{W'[t] == -12 A W[t]^3 - 4 B - 4 C W[t]*Y[t],
X'[t] == 12 A W[t]^3 - 12 B, Y'[t] == 16 B - 16 C W[t]*Y[t],
Z'[t] == 20 C W[t]*Y[t], W[0] == 1, X[0] == 0, Y[0] == 0,
Z[0] == 0 }, {W[t], X[t], Y[t], Z[t]}, t]


A, B, and C are large and complicated constants, but ultimately just constants. W, X, Y, and Z are all functions of t that I'm trying to solve for, hopefully at least to the point I can plot them. However, when I run the code I just get -

DSolve[{Derivative[1][W][t] == -4 B - 12 A W[t]^3 - 4 C W[t] Y[t],
Derivative[1][X][t] == -12 B + 12 A W[t]^3,
Derivative[1][Y][t] == 16 B - 16 C W[t] Y[t],
Derivative[1][Z][t] == 20 C W[t] Y[t], W[0] == 1, X[0] == 0,
Y[0] == 0, Z[0] == 0}, {W[t], X[t], Y[t], Z[t]}, t]


Any help would be appreciated.

• It means DSolve does not know how to solve it. Oct 6, 2020 at 16:45
• Thank you, I kind of figured that. Is there something else that would work better? Oct 6, 2020 at 17:00
• Note that X and Z depend on W and Y, but W and Y do not depend on X and Z. Therefore, you can first solve for W and Y and afterwards for X and Z. However, even when you make this simplification, DSolve can not solve it. It is possible that there is no closed solution or that MMA is not up to it. But you may try giving numerical values to the constants and use NDSolve. Oct 6, 2020 at 17:05
• If the constants A, B, and C have numerical values, you can use NDSolve to get a numerical solution. Oct 6, 2020 at 17:21
• Note that C is a Mathematica built-in symbol. This is why it appears a different color. Oct 6, 2020 at 19:31

ClearAll["Global*"];

eqns = {W'[t] == -12 A W[t]^3 - 4 B - 4 C W[t]*Y[t],
X'[t] == 12 A W[t]^3 - 12 B, Y'[t] == 16 B - 16 C W[t]*Y[t],
Z'[t] == 20 C W[t]*Y[t], W[0] == 1, X[0] == 0, Y[0] == 0, Z[0] == 0};

tmax = 10;


When DSolve cannot solve the system you need to use a numeric approach. Using ParametricNDSolve

sol = ParametricNDSolve[eqns, {W, X, Y, Z}, {t, 0, tmax}, {A, B, C}]


Manipulate[
Module[{funcs},
funcs =
{W[A, B, C], X[A, B, C], Y[A, B, C], Z[A, B, C]} /. sol;
Plot[
Evaluate[(#[t] & /@ funcs) /. sol],
{t, 0, tmax},
PlotStyle -> {Automatic, Dashed},
PlotLegends -> {W, X, Y, Z},
Frame -> True]],
{{A, 0}, 0, 1, 0.05, Appearance -> "Labeled"},
{{B, 0.05}, 0, 1, 0.05, Appearance -> "Labeled"},
{{C, 0.1}, 0, 1, 0.05, Appearance -> "Labeled"}]


• I admit I never would have thought of this. I'll need to tweek it a bit to see if it meets my needs but it's a fascinating possibility. Oct 6, 2020 at 17:38