Tried googling the error "step size is effectively zero; singularity or stiff system suspected". Haven't found any soln. Any help would mean a lot. Posting the full code.
w0 = -0.5; w1 = 0.05; wm = 0.01; \[CapitalOmega]m0 = 0.23; \
\[CapitalOmega]c0 = 0.78; \[Delta] = 0.01; H = 72;
h1[z_] := \[CapitalOmega]m0 ((1 + z)^(3 (1 + wm - \[Delta])) +
3 \[Delta] (1 + z)^(-3 (1 + w0 - w1))*
E^(w1 (1 + z))*(-3 w1)*(1 + z)^(-3 (w0 - w1 - wm + \[Delta]) -
1)*(-(-3 w1)*(1 + z))^(3 (w0 - w1 - wm + \[Delta]) -
1) Gamma[-(3 (w0 - w1 - wm + \[Delta]) - 1) -
1, -(-3 w1) (1 + z)]) + \[CapitalOmega]c0 (1 + z)^(
3 (1 + w0 - w1)) E^(3 w1 (1 + z));
s1 = NDSolve[{E^(K[z]/3) K'[z] == 3/Sqrt[h1[z]], K[.01] == .01},
K[z], {z, 0, 10}];
f1[z_] := Evaluate[K[z] /. s1];
w00 = -1;
h2[z_] := \[CapitalOmega]m0 ((1 + z)^(3 (1 + wm - \[Delta])) +
3 \[Delta] (1 + z)^(-3 (1 + w00 - w1))*
E^(w1 (1 + z))*(-3 w1)*(1 +
z)^(-3 (w00 - w1 - wm + \[Delta]) -
1)*(-(-3 w1)*(1 + z))^(3 (w00 - w1 - wm + \[Delta]) -
1) Gamma[-(3 (w00 - w1 - wm + \[Delta]) - 1) -
1, -(-3 w1) (1 + z)]) + \[CapitalOmega]c0 (1 + z)^(
3 (1 + w00 - w1)) E^(3 w1 (1 + z));
s2 = NDSolve[{E^(K[z]/3) K'[z] == 3/Sqrt[h2[z]], K[.01] == .01},
K[z], {z, 0, 10}];
f2[z_] := Evaluate[K[z] /. s2];
w000 = -1.5;
h3[z_] := \[CapitalOmega]m0 ((1 + z)^(3 (1 + wm - \[Delta])) +
3 \[Delta] (1 + z)^(-3 (1 + w000 - w1))*
E^(w1 (1 + z))*(-3 w1)*(1 +
z)^(-3 (w000 - w1 - wm + \[Delta]) -
1)*(-(-3 w1)*(1 + z))^(3 (w000 - w1 - wm + \[Delta]) -
1) Gamma[-(3 (w000 - w1 - wm + \[Delta]) - 1) -
1, -(-3 w1) (1 + z)]) + \[CapitalOmega]c0 (1 + z)^(
3 (1 + w000 - w1)) E^(3 w1 (1 + z));
s3 = NDSolve[{E^(K[z]/3) K'[z] == 3/Sqrt[h3[z]], K[.01] == .01},
K[z], {z, 0, 10}];
f3[z_] := Evaluate[K[z] /. s3];
Plot[{f1[z], f2[z], f3[z]}, {z, 0, 5}] ```
f3[z_] := Evaluate[K[z] /. s3];
andPlot[{f1[z], f2[z], f3[z]}, {z, 0, 5}]
. The problem occurs in the 3rd-to-last line withNDSolve
. I don't want toPlot
a failedNDSolve
. It potentially wastes time, distracts from the real problem, causes lots of error messages, all of which are pointless until the NDSolve code is fixed. I sometimes just skip such questions. -- P.S. You're welcome. $\endgroup$