Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- smin = -1;
- h[z_] := Exp[-z/2]
- smax=zmax/.Last @ Reap[
- NDSolveValue[
- {
- int'[z] == (Exp[z] - 1) h[z], int[smin] == 0,
- WhenEvent[int[z]==0, {"StopIntegration", Sow[z, "zmax"]}]
- },
- int,
- {z, smin, Infinity}
- ],
- _,
- #1 -> First@#2&
- ]
- sol = Last@
- Reap[NDSolveValue[{int'[z] == (Exp[z] - 1) h[z], int[smin] == 0,
- WhenEvent[int[z] == 0, {"StopIntegration", Sow[z, "zmax"]}]},
- int, {z, smin, Infinity}], _, #1 -> First@#2 &]
- smax = zmax /. First@sol
- sol = Last@
- Reap[NDSolveValue[{int'[z] == (Exp[z] - 1) h[z], int[smin] == 0,
- WhenEvent[int[z] == 0, {"StopIntegration", Sow[z, "zmax"]}]},
- int, {z, smin, Infinity}], _, #1 -> First@#2 &]
- smax = zmax /.sol
- smax = Hold[
- zmax /. Last@
- Reap[NDSolveValue[{int'[z] == (Exp[z] - 1) h[z], int[smin] == 0,
- WhenEvent[int[z] == 0, {"StopIntegration", Sow[z, "zmax"]}]},
- int, {z, smin, Infinity}], _, #1 -> First@#2 &]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement