# parametricNDSolve for solving differential equation

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

• Look for DSolve in the documentation Commented Jan 6, 2019 at 11:39
• And also ParametricNDSolve (with capital P at the beginning) seems to be relevant. Commented Jan 6, 2019 at 11:44

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 *)


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 *)


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