I am searching for a while now, but I don't seem to be able to find an Answer for my Problem - if I am just not able to search properly, I am really sorry.
I Simplified my Problem to the following example:
eqnA := {a''[x] + a[x] == b*Sin[a[x]]};
condA := {a[0] == a'[0] == 1};
stopCond := {WhenEvent[Evaluate[Re[a[x]] <= 0], xMax = x; "StopIntegration"]}
system := Join[eqnA, condA, stopCond];
sol = ParametricNDSolve[system, a, {x, 0, \[Infinity]}, {b}]
Plot[Evaluate@Table[a[b][x] /. sol, {b, .8, 1.2, .05}], {x, 0, xMax},PlotRange -> All]
Now, the Plot I want to create is a Parametric Plot of a over xMax. (Yes, I understand, that in this example it would be just a line - if it is any help: I am trying to solve the TOV equations and create the Mass over Radius diagram with central density as parameter)
I think, my understanding of WhenEvent and the uses of it might be flawed.
Any Tips are appreciated!
Edit: Since I think I did not formulate my problem clearly enough I try to explain a bit further:
With the post from george2079 I was able to get a bit further, but It still does not work.
f[b_] := (a[b] /. sol)["Domain"][[1, 2]]
g[b_] := a[b][f[b]] /. sol
ParametricPlot[{f[b], g[b]}, {b, 0, 2}, PlotRange -> All]
I would expect that to produce something close to a line along the x-axis, but instead I get an error message. Plotting f[b] and g[b] individually works just fine.
{xMax, a[b][xMax]}
asb
varies? Note thata[b][xMax]
would approximately be zero. $\endgroup$