0
$\begingroup$

I have solved a second order differential equation using Mathematica code

N1 = 1/2; Q1 = 0.2; G1 = 0.2; thetas = 0.4; thetaa = 0.2; Nr = 0.2; Pe = 0.2; sh = 5;


 sol[thetaa_, alpha_] := 
     First@NDSolve[{D[y[x], {x, 2}] + (2*alpha + Pe)*D[y[x], x] - 
        Exp[-2*alpha*x]*N1^2*(y[x] - thetaa) + Q1 - 
        G1*Exp[-2*alpha*x]*(y[x]^4 - thetas^4) == 0, y[1] == 1, 
        y'[0] == -0.250}, y, {x, 0, 1}]

    Plot[{Evaluate[y[x] /. sol[0, #] & /@ {-1/5, 0, 1/5}], 
  Evaluate[y[x] /. sol[0.2, #] & /@ {-1/5, 0, 1/5}]}, {x, 0, 1}, 
 PlotStyle -> {Red, Green, Blue, Directive[Red, Dashed], 
   Directive[Green, Dashed], Directive[Blue, Dashed]}, Frame -> True, 
 FrameLabel -> {X, \[Theta][X]}, 
 FrameStyle -> Directive[Black, Bold, 12], 
 PlotLegends -> 
  Placed[Framed@
    LineLegend[{Continous, Dashed}, {"\[Theta]a=0.0", 
      "\[Theta]a=0.2"}, LabelStyle -> {Bold, 12}, 
     LegendMarkerSize -> {45, 10}], {Left, Top}]]

Now I want to draw a contour for this problem. I have no idea how can I do it.
I want to draw contour according to N on Y-axis, Nr on Z-axis and y on X-axis. All parameters ranges from 0 to 1

$\endgroup$
4
  • 1
    $\begingroup$ Please provide more details: A contour according to what parameter/constraint? Over what range? You might also be interested in ParametricNDSolveValue to set up your plot. $\endgroup$
    – MarcoB
    Jul 26 at 2:12
  • $\begingroup$ sol returns a function: y[x] that is parametrized by 2 values: theta and alpha. Now it is not clear what you want to draw. Your whole solution space is 3 dimensional. To draw a 2D contour you need to fix a variable. $\endgroup$ Jul 26 at 16:47
  • $\begingroup$ According to your edit, then perhaps you want ContourPlot3D? $\endgroup$
    – MarcoB
    Jul 27 at 2:27
  • $\begingroup$ @MacroB yes exactly $\endgroup$
    – ZDN
    Jul 27 at 9:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.