Skip to main content
edited tags
Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
edited tags
Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774
Made a mistake in asking my question; corrected it
Source Link
E3labs
  • 485
  • 2
  • 12
soli =NDSolve[{pde, ic, bcs, WhenEvent[{p1[z, t] == 2520}, {Print[z]}]} /. 
params, {p1[z, t], p2[z, t]}, {z, 0, 515}, {t, 0, 100}, Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 750}}];

That gave me all sorts of errors. Not to mention it would just print "z". So myMy question is how do I get it to print out the distance along z that it take for p1[z,t] to decay to 20?

ss = Table[Plot[p1[z, t] /. soli, {z, 0, 515}, PlotRange -> All], {t, 0, 10, .25}];
soli =NDSolve[{pde, ic, bcs, WhenEvent[{p1[z, t] == 25}, {Print[z]}]} /. 
params, {p1[z, t], p2[z, t]}, {z, 0, 5}, {t, 0, 100}, Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 750}}];

That gave me all sorts of errors. Not to mention it would just print "z". So my question is how do I get it to print out the distance along z?

ss = Table[Plot[p1[z, t] /. soli, {z, 0, 5}, PlotRange -> All], {t, 0, 10, .25}];
soli =NDSolve[{pde, ic, bcs, WhenEvent[{p1[z, t] == 20}, {Print[z]}]} /. 
params, {p1[z, t], p2[z, t]}, {z, 0, 15}, {t, 0, 100}, Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 750}}];

That gave me all sorts of errors. My question is how do I get it to print out the distance along z that it take for p1[z,t] to decay to 20?

ss = Table[Plot[p1[z, t] /. soli, {z, 0, 15}, PlotRange -> All], {t, 0, 10, .25}];
Clearly stating my question
Source Link
E3labs
  • 485
  • 2
  • 12
Loading
Source Link
E3labs
  • 485
  • 2
  • 12
Loading