# coupled differential equations

I have to solve a set of coupled differential equations. First I have created a table containing all the equations and then solved using NDsolve.

 equations = Table[
I D[M1n[[i]][[j]][[k]], t] ==
Part[(m2/(b[[i]]*(*10**)10^6*1.98*10^-10) +
10^5/t^4*Sum[If[l == i, 0, M1n[[l]]], {l, 1, 3, 1}]).M1n[[
i]] - M1n[[
i]].(m2/(b[[i]]*(*10**)10^6*1.98*10^-10) +
10^5/t^4*Sum[If[l == i, 0, M1n[[l]]], {l, 1, 3, 1}]), j,
k], {i, 1, 3}, {j, 1, 2}, {k, 1, 2}]
equations1 = Flatten[equations];
s1 = NDSolve[{equations1, ci, di,
ei}, {Flatten[{Variables[M1n[[1]]], Variables[M1n[[2]]],
Variables[M1n[[3]]]}]}, {t, 2.2, 10^4},
PrecisionGoal -> 5, WorkingPrecision -> 7]


where,

  b = Array[En, 3];
En[1] = 10;
En[2] = 11;
En[3] = 15;
M1n = Table[
Array[Subscript[Subscript[\[Rho], i], #1, #2][t] &, {2, 2}], {i, 1,
3}]
\[Theta] =11.53*\[Pi]/180;
m2 = 1/(2*2)*2*10^-3*{{Cos[
2 \[Theta]], -Sin[2 \[Theta]]}, {-Sin[2 \[Theta]], -Cos[
2 \[Theta]]}}
M0 = {{10, 10^-5}, {10^-5, 5}};
ci = Thread[Flatten[M1n[[1]]] == Flatten[M0]] /. {t -> 2};
M20 = {{10, 10^-5}, {10^-5, 4}};
di = Thread[Flatten[M1n[[2]]] == Flatten[M20]] /. {t -> 2};
M30 = {{10, 10^-5}, {10^-5, 3}};
ei = Thread[Flatten[M1n[[3]]] == Flatten[M30]] /. {t -> 2};


But this is showing an error

NDSolve::precw: The precision of the differential equation ({{I (TemporaryVariable$$13055^\[Prime])[t]==TemporaryVariable$$13057[t] (-0.0989128+100000 Power[<<2>>] Plus[<<2>>])-TemporaryVariable$$13056[t] (-0.0989128+100000 Power[<<2>>] Plus[<<2>>]),I (TemporaryVariable$$13056^\[Prime])[t]==TemporaryVariable$$13056[t] (0.232347 +100000 Power[<<2>>] Plus[<<2>>])-TemporaryVariable$$13055[t] (-0.0989128+100000 Power[<<2>>] Plus[<<2>>])+TemporaryVariable$$13058[t] (-0.0989128+100000 Power[<<2>>] Plus[<<2>>])-TemporaryVariable$$13056[t] (-0.232347+100000 Power[<<2>>] Plus[<<2>>]),<<20>>,TemporaryVariable$$13065[2]==1/100000,TemporaryVariable$$13066[2]==3},{},{},{},{}}) is less than WorkingPrecision (7.). >>
NDSolve::ndsz: At t == 2.7., step size is effectively zero; singularity or stiff system suspected. >>
NDSolve::ndsz: At t == 2.7., step size is effectively zero; singularity or stiff system suspected. >>
`

How to resolve this?

• Delete: " WorkingPrecision -> 7" and add: "MaxSteps -> Infinity" then your code will execute. Commented Sep 29, 2020 at 8:58
• Yes I tried that but now it is showing Commented Sep 29, 2020 at 11:19
• NDSolve::dsfun: {Subscript[Subscript[[Rho], 1], 1,1][t],Subscript[Subscript[[Rho], 1], 1,2][t],Subscript[Subscript[[Rho], 1], 2,1][t],Subscript[Subscript[[Rho], 1], 2,2][t],Subscript[Subscript[[Rho], 2], 1,1][t],Subscript[Subscript[[Rho], 2], 1,2][t],Subscript[Subscript[[Rho], 2], 2,1][t],Subscript[Subscript[[Rho], 2], 2,2][t],Subscript[Subscript[[Rho], 3], 1,1][t],Subscript[Subscript[[Rho], 3], 1,2][t],Subscript[Subscript[[Rho], 3], 2,1][t],Subscript[Subscript[[Rho], 3], 2,2][t]} cannot be used as a function. >> Commented Sep 29, 2020 at 11:21