0
$\begingroup$

i want to solve this equation and plot it solution w.r.t N2 and theta(0)

theta''[x] + 2*theta'[x] - Exp[-2*x]*(N2)^2*(theta[x] - 5) + Q1 == 0 anyone please help

$\endgroup$
  • $\begingroup$ Look for DSolve in the documentation $\endgroup$ – mattiav27 Jan 6 at 11:39
  • $\begingroup$ And also ParametricNDSolve (with capital P at the beginning) seems to be relevant. $\endgroup$ – Henrik Schumacher Jan 6 at 11:44
0
$\begingroup$

It is not clear what you want plotted nor how you want the plots done. Neither have you specified the range of the variables that are of interest. The following will need to be tailored once you understand your needs.

Clear["Global`*"]

{xmin, xmax} = {0, 1};

Manipulate[
 Module[{eqns1, sol1},
  eqns1 = 
  {theta''[x] + 2*theta'[x] - Exp[-2*x]*N21^2*(theta[x] - 5) + Q11 == 0, 
    theta[0] == t01, theta'[0] == tp01};
  sol1 = ParametricNDSolve[eqns1, theta, {x, xmin, xmax}, N21];
  Plot3D[Evaluate[theta[N21][x] /. sol1],
   {x, xmin, xmax}, {N21, 0, 5},
   AxesLabel -> (Style[#, 14, Bold] & /@ {"x", "N2", "theta"}),
   ClippingStyle -> None]],
 {{Q11, 5, Q1}, 0, 10, Appearance -> "Labeled"},
 {{t01, 0, "theta[0]"}, 0, 10, Appearance -> "Labeled"},
 {{tp01, 0, "theta'[0]"}, 0, 10, Appearance -> "Labeled"}]
(* spacer *)

enter image description here

Manipulate[
 Module[{eqns2, sol2},
  eqns2 = 
  {theta''[x] + 2*theta'[x] - Exp[-2*x]*N22^2*(theta[x] - 5) + Q12 == 0, 
  theta[0] == t02, theta'[0] == tp02};
  sol2 = ParametricNDSolve[eqns2, theta, {x, xmin, xmax}, t02];
  Plot3D[Evaluate[theta[t02][x] /. sol2],
   {x, xmin, xmax}, {t02, 0, 5},
   AxesLabel -> (Style[#, 14, Bold] & /@ {"x", "theta[0]", "theta"}),
   ClippingStyle -> None]],
 {{Q12, 5, Q1}, 0, 10, Appearance -> "Labeled"},
 {{N22, 5, N2}, 0, 10, Appearance -> "Labeled"},
 {{tp02, 0, "theta'[0]"}, 0, 10, Appearance -> "Labeled"}]
(* spacer *)

enter image description here

$\endgroup$
  • $\begingroup$ thanks a lot, I want to get a two-dimensional plot with N2 on X-axis and theta(0) on y axis $\endgroup$ – zia ud din Jan 7 at 7:42
  • $\begingroup$ @ziauddin - so what are the ranges of interest or values for Q1 and x and the range of interest for theta[0]? $\endgroup$ – Bob Hanlon Jan 7 at 13:10
  • $\begingroup$ Q1 may be any constant, theta(0) may be from 0-1 and N2 from 0-10 $\endgroup$ – zia ud din Jan 7 at 16:03
  • $\begingroup$ You still have not specified the range for x $\endgroup$ – Bob Hanlon Jan 7 at 16:17
  • $\begingroup$ x may be from 0-1 $\endgroup$ – zia ud din Jan 7 at 16:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.