1
$\begingroup$

I have a big struggle with numerical solution of a set of 3 ODE equations in one .nb file. This is completely wrong when I when use NDSolve[] command for them with previous substitution of certain values to parameters in these equations.

However, when I open different .nb file, paste that set of 3 ODEs and substitute the same values to parameters but right in this new file the NDSolve[] command works well.

Where is the problem? Is it possible that opening just an another .nb file makes such a difference in computation?

These are values to parameters:

Subscript[φ, start] = 0.7853981633;
Subscript[l, 1] = 1;
Subscript[l, 2] = 4;
Subscript[l, 3] = 1;
Subscript[l, 4] = 2;

Subscript[m, 12] = 4;
Subscript[m, 3] = 0;
Subscript[m, 4] = 0;
Subscript[m, pw] = 100;
Subscript[m, D] = 1
g = 9.81;

Thank you for your help.

These are ODEs with values of parameters substituted in one .nb file for which NDSolve[] gives wrong solution:

{(8*Cos[φ[t]]*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(8*(2.8284271250218156 - 4*Cos[φ[t]])*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]^3*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^2 + 
(4*Sin[φ[t]]^2*Derivative[1][φ][t]*(8*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]*
    Derivative[1][φ][t] + 8*(-2.8284271250218156 + 4*Cos[φ[t]])*Sin[φ[t]]*Derivative[1][φ][t]))/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(4*Cos[φ[t]]*Derivative[1][φ][t] + (5.656854250043631*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
  (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
 ((5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t] + 
  (8*Sin[φ[t]]^2*Derivative[1][φ][t])/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
  (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
  (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2)) + 
Derivative[1][φ][t]*
 (-((2*(4 - Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2*
     ((1/2)*(Sin[γ[t]] + 4*Sin[φ[t]])*(Cos[γ[t]]*Derivative[1][γ][t] + 
        4*Cos[φ[t]]*Derivative[1][φ][t]) + (1/2)*(-Cos[γ[t]] - 4*Cos[φ[t]])*
       (Sin[γ[t]]*Derivative[1][γ][t] + 4*Sin[φ[t]]*Derivative[1][φ][t])))/
    (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])) + 
  (2*(1 + Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2*
    ((1/2)*(Sin[γ[t]] + 4*Sin[φ[t]])*(Cos[γ[t]]*Derivative[1][γ][t] + 
       4*Cos[φ[t]]*Derivative[1][φ][t]) + (1/2)*(-Cos[γ[t]] - 4*Cos[φ[t]])*
      (Sin[γ[t]]*Derivative[1][γ][t] + 4*Sin[φ[t]]*Derivative[1][φ][t])))/
   (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])) + 
(4*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - (-2.8284271250218156 + 4*Cos[φ[t]])^
    2)*Sin[φ[t]]^2*Derivative[2][φ][t])/(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
((4/15)*(4 - Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^3 + 
  (4/15)*(1 + Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^3)*
 Derivative[2][φ][t] + (4*Cos[φ[t]] + (5.656854250043631*Sin[φ[t]])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]*Sin[φ[t]])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
 ((5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t]^2)/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t]^2)/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t]^2 + 
  (8*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
  (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
  (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) + 4*Cos[φ[t]]*Derivative[2][φ][t] + 
  (5.656854250043631*Sin[φ[t]]*Derivative[2][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
  (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[2][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2]) + 
50*(-2*Sin[γ[t]]*Derivative[1][γ][t]*(Cos[γ[t]]*Derivative[1][γ][t] + 
    Cos[γ[t]]*Derivative[1][φ][t]) + 2*Cos[γ[t]]*Derivative[1][γ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] + Sin[γ[t]]*Derivative[1][φ][t]) + 
  2*Cos[γ[t]]*((-Sin[γ[t]])*Derivative[1][γ][t]^2 - Sin[γ[t]]*Derivative[1][γ][t]*
     Derivative[1][φ][t] + Cos[γ[t]]*Derivative[2][γ][t] + Cos[γ[t]]*Derivative[2][φ][t]) + 
  2*Sin[γ[t]]*(Cos[γ[t]]*Derivative[1][γ][t]^2 + Cos[γ[t]]*Derivative[1][γ][t]*
     Derivative[1][φ][t] + Sin[γ[t]]*Derivative[2][γ][t] + Sin[γ[t]]*Derivative[2][φ][t])) + 
2*(2*((1/2)*Cos[γ[t]]*Derivative[1][φ][t] + 2*Cos[φ[t]]*Derivative[1][φ][t])*
   ((-(1/2))*Sin[γ[t]]*Derivative[1][γ][t] - 2*Sin[φ[t]]*Derivative[1][φ][t]) + 
  2*((1/2)*Cos[γ[t]]*Derivative[1][γ][t] + 2*Cos[φ[t]]*Derivative[1][φ][t])*
   ((1/2)*Sin[γ[t]]*Derivative[1][φ][t] + 2*Sin[φ[t]]*Derivative[1][φ][t]) + 
  2*((1/2)*Cos[γ[t]] + 2*Cos[φ[t]])*((-(1/2))*Sin[γ[t]]*Derivative[1][γ][t]*
     Derivative[1][φ][t] - 2*Sin[φ[t]]*Derivative[1][φ][t]^2 + 
    (1/2)*Cos[γ[t]]*Derivative[2][φ][t] + 2*Cos[φ[t]]*Derivative[2][φ][t]) + 
  2*((1/2)*Sin[γ[t]] + 2*Sin[φ[t]])*((1/2)*Cos[γ[t]]*Derivative[1][γ][t]*Derivative[1][φ][t] + 
    2*Cos[φ[t]]*Derivative[1][φ][t]^2 + (1/2)*Sin[γ[t]]*Derivative[2][φ][t] + 
    2*Sin[φ[t]]*Derivative[2][φ][t])) == -78.48*Sin[φ[t]] + 
(4*Cos[φ[t]]*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(4*(2.8284271250218156 - 4*Cos[φ[t]])*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]^3*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^2 + 
(2*Sin[φ[t]]^2*(8*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]] + 
   8*(-2.8284271250218156 + 4*Cos[φ[t]])*Sin[φ[t]])*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(1/2)*(-((2*(2*(-Cos[γ[t]] - 4*Cos[φ[t]])*Sin[φ[t]] + 2*Cos[φ[t]]*(Sin[γ[t]] + 4*Sin[φ[t]]))*
     (4 - Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2)/
    (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])) + 
  (2*(2*(-Cos[γ[t]] - 4*Cos[φ[t]])*Sin[φ[t]] + 2*Cos[φ[t]]*(Sin[γ[t]] + 4*Sin[φ[t]]))*
    (1 + Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2)/
   (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2]))*
 Derivative[1][φ][t]^2 + (4*Cos[φ[t]]*Derivative[1][φ][t] + 
  (5.656854250043631*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
  (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
 ((5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t] + 
  (8*Sin[φ[t]]^2*Derivative[1][φ][t])/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
  (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
  (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2)) + 
2*(-4*Sin[φ[t]]*Derivative[1][φ][t]*((1/2)*Cos[γ[t]]*Derivative[1][φ][t] + 
    2*Cos[φ[t]]*Derivative[1][φ][t]) + 4*Cos[φ[t]]*Derivative[1][φ][t]*
   ((1/2)*Sin[γ[t]]*Derivative[1][φ][t] + 2*Sin[φ[t]]*Derivative[1][φ][t])), 
(100 - 100*(Cos[γ[t]]^2 + Sin[γ[t]]^2))*Derivative[2][γ][t] + 
50*(-2*Sin[γ[t]]*Derivative[1][γ][t]*(Cos[γ[t]]*Derivative[1][γ][t] + 
    Cos[γ[t]]*Derivative[1][φ][t]) + 2*Cos[γ[t]]*Derivative[1][γ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] + Sin[γ[t]]*Derivative[1][φ][t]) + 
  2*Cos[γ[t]]*((-Sin[γ[t]])*Derivative[1][γ][t]^2 - Sin[γ[t]]*Derivative[1][γ][t]*
     Derivative[1][φ][t] + Cos[γ[t]]*Derivative[2][γ][t] + Cos[γ[t]]*Derivative[2][φ][t]) + 
  2*Sin[γ[t]]*(Cos[γ[t]]*Derivative[1][γ][t]^2 + Cos[γ[t]]*Derivative[1][γ][t]*
     Derivative[1][φ][t] + Sin[γ[t]]*Derivative[2][γ][t] + Sin[γ[t]]*Derivative[2][φ][t])) == 
-1981.62*Sin[γ[t]] + 
(1/2)*(-((2*((1/2)*(-Cos[γ[t]] - 4*Cos[φ[t]])*Sin[γ[t]] + (1/2)*Cos[γ[t]]*
       (Sin[γ[t]] + 4*Sin[φ[t]]))*(4 - Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + 
         (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2)/
    (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])) + 
  (2*((1/2)*(-Cos[γ[t]] - 4*Cos[φ[t]])*Sin[γ[t]] + (1/2)*Cos[γ[t]]*(Sin[γ[t]] + 4*Sin[φ[t]]))*
    (1 + Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2])^2)/
   (5*Sqrt[(1/4)*(-Cos[γ[t]] - 4*Cos[φ[t]])^2 + (1/4)*(Sin[γ[t]] + 4*Sin[φ[t]])^2]))*
 Derivative[1][φ][t]^2 + 50*(2*(Cos[γ[t]]*Derivative[1][γ][t] + Cos[γ[t]]*Derivative[1][φ][t])*
   ((-Sin[γ[t]])*Derivative[1][γ][t] - Sin[γ[t]]*Derivative[1][φ][t]) + 
  2*(Cos[γ[t]]*Derivative[1][γ][t] + Cos[γ[t]]*Derivative[1][φ][t])*
   (Sin[γ[t]]*Derivative[1][γ][t] + Sin[γ[t]]*Derivative[1][φ][t])) + 
2*((-Sin[γ[t]])*Derivative[1][φ][t]*((1/2)*Cos[γ[t]]*Derivative[1][φ][t] + 
    2*Cos[φ[t]]*Derivative[1][φ][t]) + Cos[γ[t]]*Derivative[1][φ][t]*
   ((1/2)*Sin[γ[t]]*Derivative[1][φ][t] + 2*Sin[φ[t]]*Derivative[1][φ][t]))}

These are the same ODEs with the substitution of the same parameter values was made in another nb file (now NDSolve[] gives correct result) :

{(8*Cos[φ[t]]*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(8*(2.8284271250218156 - 4*Cos[φ[t]])*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]^3*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^2 - 
(4*Sin[φ[t]]^2*Derivative[1][φ][t]*(-8*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]*
    Derivative[1][φ][t] - 8*(-2.8284271250218156 + 4*Cos[φ[t]])*Sin[φ[t]]*Derivative[1][φ][t]))/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(4*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - (-2.8284271250218156 + 4*Cos[φ[t]])^
    2)*Sin[φ[t]]^2*Derivative[2][φ][t])/(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
((4/15)*(4 - Sqrt[(9/4)*Cos[φ[t]]^2 + (9/4)*Sin[φ[t]]^2])^3 + 
  (4/15)*(1 + Sqrt[(9/4)*Cos[φ[t]]^2 + (9/4)*Sin[φ[t]]^2])^3)*Derivative[2][φ][t] + 
50*(2*Sin[φ[t]]*Derivative[1][φ][t]*(Cos[γ[t]]*Derivative[1][γ][t] - 
    Cos[φ[t]]*Derivative[1][φ][t]) - 2*Cos[φ[t]]*Derivative[1][φ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] - Sin[φ[t]]*Derivative[1][φ][t]) - 
  2*Cos[φ[t]]*((-Sin[γ[t]])*Derivative[1][γ][t]^2 + Sin[φ[t]]*Derivative[1][φ][t]^2 + 
    Cos[γ[t]]*Derivative[2][γ][t] - Cos[φ[t]]*Derivative[2][φ][t]) - 
  2*Sin[φ[t]]*(Cos[γ[t]]*Derivative[1][γ][t]^2 - Cos[φ[t]]*Derivative[1][φ][t]^2 + 
    Sin[γ[t]]*Derivative[2][γ][t] - Sin[φ[t]]*Derivative[2][φ][t])) + 
2*(3*Cos[φ[t]]*((-(3/2))*Sin[φ[t]]*Derivative[1][φ][t]^2 + (3/2)*Cos[φ[t]]*
     Derivative[2][φ][t]) + 3*Sin[φ[t]]*((3/2)*Cos[φ[t]]*Derivative[1][φ][t]^2 + 
    (3/2)*Sin[φ[t]]*Derivative[2][φ][t])) + 
(1/2)*(2*(0. + 4*Cos[φ[t]]*Derivative[1][φ][t] + (5.656854250043631*Sin[φ[t]]*
      Derivative[1][φ][t])/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
    (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[1][φ][t])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
   (0. + (5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t] + 
    (8*Sin[φ[t]]^2*Derivative[1][φ][t])/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
    (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t])/
     (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
    (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t])/
     (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2)) + 
  2*(0. + 4*Cos[φ[t]] + (5.656854250043631*Sin[φ[t]])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]*Sin[φ[t]])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
   (0. + (5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t]^2)/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t]^2)/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t]^2 + 
    (8*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
    (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/
     (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
    (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t]^2)/
     (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) + 4*Cos[φ[t]]*Derivative[2][φ][t] + 
    (5.656854250043631*Sin[φ[t]]*Derivative[2][φ][t])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
    (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[2][φ][t])/
     Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])) == 
0. + 922.14*Sin[φ[t]] + (4*Cos[φ[t]]*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(4*(2.8284271250218156 - 4*Cos[φ[t]])*(4 - 4*(1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) - 
   (-2.8284271250218156 + 4*Cos[φ[t]])^2)*Sin[φ[t]]^3*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^2 - 
(2*Sin[φ[t]]^2*(-8*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]] - 
   8*(-2.8284271250218156 + 4*Cos[φ[t]])*Sin[φ[t]])*Derivative[1][φ][t]^2)/
 (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2) + 
(0. + 4*Cos[φ[t]]*Derivative[1][φ][t] + (5.656854250043631*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 
  (8*Cos[φ[t]]*Sin[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2])*
 (0. + (5.656854250043631*Cos[φ[t]]*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - (8*Cos[φ[t]]^2*Derivative[1][φ][t])/
   Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] - 4*Sin[φ[t]]*Derivative[1][φ][t] + 
  (8*Sin[φ[t]]^2*Derivative[1][φ][t])/Sqrt[1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2] + 
  (5.656854250043631*(2.8284271250218156 - 4*Cos[φ[t]])*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2) - 
  (8*(2.8284271250218156 - 4*Cos[φ[t]])*Cos[φ[t]]*Sin[φ[t]]^2*Derivative[1][φ][t])/
   (1 - (1/4)*(2.8284271250218156 - 4*Cos[φ[t]])^2)^(3/2)) + 
50*(2*Sin[φ[t]]*Derivative[1][φ][t]*(Cos[γ[t]]*Derivative[1][γ][t] - 
    Cos[φ[t]]*Derivative[1][φ][t]) - 2*Cos[φ[t]]*Derivative[1][φ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] - Sin[φ[t]]*Derivative[1][φ][t])), 
(100 - 100*(Cos[γ[t]]^2 + Sin[γ[t]]^2))*Derivative[2][γ][t] + 
50*(-2*Sin[γ[t]]*Derivative[1][γ][t]*(Cos[γ[t]]*Derivative[1][γ][t] - 
    Cos[φ[t]]*Derivative[1][φ][t]) + 2*Cos[γ[t]]*Derivative[1][γ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] - Sin[φ[t]]*Derivative[1][φ][t]) + 
  2*Cos[γ[t]]*((-Sin[γ[t]])*Derivative[1][γ][t]^2 + Sin[φ[t]]*Derivative[1][φ][t]^2 + 
    Cos[γ[t]]*Derivative[2][γ][t] - Cos[φ[t]]*Derivative[2][φ][t]) + 
  2*Sin[γ[t]]*(Cos[γ[t]]*Derivative[1][γ][t]^2 - Cos[φ[t]]*Derivative[1][φ][t]^2 + 
    Sin[γ[t]]*Derivative[2][γ][t] - Sin[φ[t]]*Derivative[2][φ][t])) == 
-981.*Sin[γ[t]] + 50*(-2*Sin[γ[t]]*Derivative[1][γ][t]*(Cos[γ[t]]*Derivative[1][γ][t] - 
    Cos[φ[t]]*Derivative[1][φ][t]) + 2*Cos[γ[t]]*Derivative[1][γ][t]*
   (Sin[γ[t]]*Derivative[1][γ][t] - Sin[φ[t]]*Derivative[1][φ][t]))}
$\endgroup$
9
  • $\begingroup$ Prior to copy and paste into MSE, convert the cells to InputForm (or Raw InputForm). $\endgroup$
    – Bob Hanlon
    Commented Mar 27, 2022 at 14:09
  • $\begingroup$ @Bob Hanlon - I did it with Raw InputForm - however the formatting is still not pretty. The first set of 3 ODes (for which NDSolve[] doesnt wor well) are all displayed as a first block of code. The second set of ODEs (for which NDSolve gives correct result ) is partly displayed as a code and partly as a text under it. $\endgroup$
    – lodzki
    Commented Mar 27, 2022 at 15:09
  • $\begingroup$ Thanks @Goofy for improvment of code display $\endgroup$
    – lodzki
    Commented Mar 27, 2022 at 17:27
  • $\begingroup$ You're welcome. It's too bad there isn't an easy way to turn all the Derivative[1][f][x] into f'[x]. At least I don't know how, other than to paste it all into a real editor. $\endgroup$
    – Goofy
    Commented Mar 27, 2022 at 19:28
  • 1
    $\begingroup$ @lodzki How we can test your problem while we don't know what do you compute? $\endgroup$ Commented Mar 30, 2022 at 8:23

1 Answer 1

0
$\begingroup$

The problem was that the numerical data values should be put right before the NDSolve command execution (not earlier)-then it can handle this really well. I dont know why it is such a difference for that solver but I was also said that it is good practice to do it that way.

$\endgroup$
4
  • 1
    $\begingroup$ Could you provide more details? $\endgroup$
    – bbgodfrey
    Commented Jun 8, 2022 at 14:23
  • $\begingroup$ I can tell you that from now on I'm doing it in this manner on many different codes and this approach still works. Maybe it means that symbolic computations shouldnt be mixed with numerical ones? I mean "keeping computations symbolic as long as it is possible and only shift to numerical when it is required" seems a good practice. $\endgroup$
    – lodzki
    Commented Jun 8, 2022 at 15:43
  • 1
    $\begingroup$ Please provide the code used for this answer & note the changes from what you will/should provide in your original question post. As it is, this is more appropriate as a comment to provide additional clarification to your original question post. $\endgroup$ Commented Jul 9, 2022 at 5:48
  • $\begingroup$ Ok I will do it in a week time. $\endgroup$
    – lodzki
    Commented Jul 10, 2022 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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