# 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 – mattiav27 Jan 6 '19 at 11:39
• And also ParametricNDSolve (with capital P at the beginning) seems to be relevant. – Henrik Schumacher Jan 6 '19 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 == t01, theta' == 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, 10, Appearance -> "Labeled"},
{{tp01, 0, "theta'"}, 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 == t02, theta' == 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", "theta"}),
ClippingStyle -> None]],
{{Q12, 5, Q1}, 0, 10, Appearance -> "Labeled"},
{{N22, 5, N2}, 0, 10, Appearance -> "Labeled"},
{{tp02, 0, "theta'"}, 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 – zia ud din Jan 7 '19 at 7:42
• @ziauddin - so what are the ranges of interest or values for Q1 and x and the range of interest for theta? – Bob Hanlon Jan 7 '19 at 13:10
• Q1 may be any constant, theta(0) may be from 0-1 and N2 from 0-10 – zia ud din Jan 7 '19 at 16:03
• You still have not specified the range for x` – Bob Hanlon Jan 7 '19 at 16:17
• x may be from 0-1 – zia ud din Jan 7 '19 at 16:27