I am trying to find a numerical solutions to a DE system with a following code:
n = 4;
variables =
Table[ToExpression["\[CurlyPhi]" <> ToString[i]], {i, 1, n}];
equations = {399999.99999999994` \[CurlyPhi]1[t] +
1/6 (-2.3999999999999995`*^6 \[CurlyPhi]2[t] +
0.63` (16858.8` Derivative[1][\[CurlyPhi]1][t] +
16858.8` Derivative[1][\[CurlyPhi]2][t] +
229 (-147.15` + 8.82` (\[CurlyPhi]1^\[Prime]\[Prime])[t] +
5.67` (\[CurlyPhi]2^\[Prime]\[Prime])[t] -
1.8900000000000001` (\[CurlyPhi]3^\[Prime]\[Prime])[
t]))) == 0,
1/6 (-12737.598300000001` -
2.3999999999999995`*^6 \[CurlyPhi]1[t] +
4.799999999999999`*^6 \[CurlyPhi]2[t] +
2.3999999999999995`*^6 \[CurlyPhi]3[t] +
10621.044000000002` (Derivative[1][\[CurlyPhi]1][t] +
Derivative[1][\[CurlyPhi]2][t]) +
818.0109000000001` (\[CurlyPhi]1^\[Prime]\[Prime])[t] +
727.1208` (\[CurlyPhi]2^\[Prime]\[Prime])[t] -
272.6703` (\[CurlyPhi]3^\[Prime]\[Prime])[t]) == 0,
1/6 (4245.8661` + 2.3999999999999995`*^6 \[CurlyPhi]2[t] +
4.799999999999999`*^6 \[CurlyPhi]3[t] -
2.3999999999999995`*^6 \[CurlyPhi]4[t] -
272.6703` (\[CurlyPhi]1^\[Prime]\[Prime])[t] -
272.6703` (\[CurlyPhi]2^\[Prime]\[Prime])[t] +
181.7802` (\[CurlyPhi]3^\[Prime]\[Prime])[t]) == 0}
AppendTo[equations,
Sum[variables[[i]][t], {i, 1, n/2}] -
Sum[variables[[i]][t], {i, n/2 + 1, n}] == 0];
For[i = 1, i <= n, i++,
AppendTo[equations, variables[[i]][t] == 0 /. t -> 0]];
For[i = 1, i <= n, i++,
AppendTo[equations, D[variables[[i]][t], t] == 0 /. t -> 0]];
solution =
Quiet[NDSolve[Rationalize[equations],
Table[variables[[i]][t], {i, 1, n, 1}], {t, 0, 5}]]
koti = Table[solution[[1, i, 2]], {i, 1, n, 1}]
Plot[koti, {t, 0, 1.5}, PlotRange -> All, PlotLegends -> Automatic,
AxesLabel -> {"t [s]", "\[CurlyPhi] [rad]"},
BaseStyle -> {FontFamily -> "Courier New", FontSize -> 10}]
And this works perfectly! Yet changing the equations just a bit - adding one term produces absolutely NO solution. So I am trying to solve the following set of equations:
equations = {1/
6 (2.3999999999999995`*^6 \[CurlyPhi]1[t] -
2.3999999999999995`*^6 \[CurlyPhi]2[t] +
0.63` (16858.8` Derivative[1][\[CurlyPhi]1][t] +
16858.8` Derivative[1][\[CurlyPhi]2][t] +
229 (12.6` (\[CurlyPhi]1^\[Prime]\[Prime])[t] -
3 (49.050000000000004` -
3.15` (\[CurlyPhi]2^\[Prime]\[Prime])[t] +
1.8900000000000001` (\[CurlyPhi]3^\[Prime]\[Prime])[
t] + 0.63` (\[CurlyPhi]4^\[Prime]\[Prime])[t])))) ==
0, 1/6 (-12737.598300000001` -
2.3999999999999995`*^6 \[CurlyPhi]1[t] +
4.799999999999999`*^6 \[CurlyPhi]2[t] +
2.3999999999999995`*^6 \[CurlyPhi]3[t] +
10621.044000000002` (Derivative[1][\[CurlyPhi]1][t] +
Derivative[1][\[CurlyPhi]2][t]) +
1363.3515` (\[CurlyPhi]1^\[Prime]\[Prime])[t] +
1272.4614000000001` (\[CurlyPhi]2^\[Prime]\[Prime])[t] -
818.0109000000001` (\[CurlyPhi]3^\[Prime]\[Prime])[t] -
272.6703` (\[CurlyPhi]4^\[Prime]\[Prime])[t]) == 0,
1/6 (4245.8661` + 2.3999999999999995`*^6 \[CurlyPhi]2[t] +
4.799999999999999`*^6 \[CurlyPhi]3[t] -
2.3999999999999995`*^6 \[CurlyPhi]4[t] -
818.0109000000001` (\[CurlyPhi]1^\[Prime]\[Prime])[t] -
818.0109000000001` (\[CurlyPhi]2^\[Prime]\[Prime])[t] +
727.1208` (\[CurlyPhi]3^\[Prime]\[Prime])[t] +
272.6703` (\[CurlyPhi]4^\[Prime]\[Prime])[t]) == 0}
AppendTo[equations,
Sum[variables[[i]][t], {i, 1, n/2}] -
Sum[variables[[i]][t], {i, n/2 + 1, n}] == 0];
For[i = 1, i <= n, i++,
AppendTo[equations, variables[[i]][t] == 0 /. t -> 0]];
For[i = 1, i <= n, i++,
AppendTo[equations, D[variables[[i]][t], t] == 0 /. t -> 0]];
solution =
Quiet[NDSolve[Rationalize[equations],
Table[variables[[i]][t], {i, 1, n, 1}], {t, 0, 5}]]
koti = Table[solution[[1, i, 2]], {i, 1, n, 1}]
Plot[koti, {t, 0, 1.5}, PlotRange -> All, PlotLegends -> Automatic,
AxesLabel -> {"t [s]", "\[CurlyPhi] [rad]"},
BaseStyle -> {FontFamily -> "Courier New", FontSize -> 10}]
Any Ideas what can I do? :/ I am completely lost.