1
$\begingroup$

I will do my best to describe the simplest version of my problem as clearly as I can. Please bear with me:

We have a,b and c which are functions of x and y, and their t-evolution is given by coupled non-linear differential equations in {expr}. I have:

NDSolve[{expr},a[0]==A,b[0]==B,c[0]==C,{a,b,c},{t,0,10}]

Now I want to essentially plot y vs x, displaying the band of values for which:

  • a<1 for all t in range.
  • with the initial conditions a[0],b[0],c[0] specified by a range in x and in y -- the axes of the plot. Am confused about the syntax for this.

Essentially I am trying to plot, on an x-y plot, the band of values for which certain functions of them, a,b,c, with DE's giving their time evolution, satisfy a certain inequality for all t in a range.

Additionally, would be great if I was also able to plot this 3D region:

  • run t to infinity and plot on an x-y plot the cutoff t value where the inequality condition ceases to hold, on the z axis, and

  • same thing but plot on the z axis the value for which t is singular (I know there exists a pole at large t)


Work so far (Note, the evolutions depend on a very large set of very complex DE's, so I have omitted them for simplicity):

  • Poles: When I simply do NDSolve[{expr},{a,b,c},{t,0,100}] with a set of chosen initial conditions in {expr}, it gives me the pole for this set, i.e. "At t==20.3256 step size is effectively zero; singularity or stiff system suspected." Wondering how to automate this and have variable initial conditions and store all the singularities. That would allow me to plot x,y,t-pole values. Confused about the syntax of making variable initial conditions (in terms of x,y) and where to specify a,b,c in terms of x,y.

  • Plots: Again by choosing particular initial condition values I am able to use NDSolveValue to extract the a,b,c values as functions of t and plot their t behaviour. Alas, this is not the eventual plot I want -- I have to somehow check for my inequality conditions at every point in his plot and plot the a,b,c values that satisfy the conditions as regions on an x,y plot.

  • Cutoff: Once again with specified initial values I can use a WhenEvent[a[t]=1,Print[t]]},a,{t,0,100}] function to output the cutoff value where the inequality a<1 stops being true. Not sure how to implement such a function with the initial values in the NDSolve scanning through a range.

I'm very new to Mathematica so would appreciate any help or guidance.

$\endgroup$
  • 3
    $\begingroup$ I don't think we can help you without knowing what your differential equations are. $\endgroup$ – m_goldberg May 27 '18 at 15:55
  • 1
    $\begingroup$ Welcome to StackExchange. As m_goldberg already said, your question would be really hard to answer without an example. In addition to that, your question contains many sub-questions. Usually, such questions won't get as much attention as they could get when you would concentrate on one problem per question. $\endgroup$ – halirutan May 27 '18 at 16:06
  • $\begingroup$ @m_goldberg - Thanks, I will try reword this $\endgroup$ – SarahThompson May 28 '18 at 1:51
  • $\begingroup$ @halirutan - Thank you. I will take your advice and write sub-questions. What's the etiquette for closing a question, so that I may write a new one? $\endgroup$ – SarahThompson May 28 '18 at 1:52
  • $\begingroup$ @halirutan - After simplifying my problem I have rewritten it in another question: mathematica.stackexchange.com/questions/174089/… $\endgroup$ – SarahThompson May 28 '18 at 1:58