Timeline for WhenEvent used in a PDE to output independent variable
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 21, 2015 at 21:55 | comment | added | E3labs | Thank you so much for the help Michael | |
Jun 21, 2015 at 20:57 | comment | added | Michael E2 |
@e3labs Oops, copied the wrong code. See the update. I usually prefer solving for the functions {p1, p2} instead of the value expressions {p1[z, t], p2[z, t]} , as it makes certain operations easier, such as computing residuals from pde and in this case, extracting properties of the InterpolatingFunction . (The blue in the post is due to Stackexchange; I have green too, which indicates that p is a local variable used to name the pattern.)
|
|
Jun 21, 2015 at 20:52 | history | edited | Michael E2 | CC BY-SA 3.0 |
Fixed code
|
Jun 21, 2015 at 20:28 | vote | accept | E3labs | ||
Jun 21, 2015 at 20:28 | comment | added | E3labs |
Thanks a lot-All you guys here are great! The WhenEvent approach answers my original question so I consider this answered. FYI though, your addendum isn't working out. Just running zt20 I'm getting Position specification Missing["NotFound"] in Extract[p1["Grid"], Missing["NotFound"]] is not applicable and the output is Extract[p1["Grid"], Missing["NotFound"]] . Only thing I see is when I copy it over the p in FirstPosition 's p<20 is green and not blue as in the post. Perhaps I'm missing your point about the extra braces.
|
|
Jun 21, 2015 at 19:46 | history | edited | Michael E2 | CC BY-SA 3.0 |
Added addendum
|
Jun 21, 2015 at 19:14 | history | answered | Michael E2 | CC BY-SA 3.0 |