2
$\begingroup$

I am trying to solve the `

Eqn := D[theta[x], {x, 2}] + 
   D[theta[x], x] + \[Beta]*(D[theta[x], x])^2 - N1^2*theta[x] + Q1 - 
   G1*theta[x]^3 == 0;`

with parameters

N1 = 0.5; G1 = 0.2; \[Beta] = 2

as

sol[Q1_] := 
 First@NDSolve[{D[theta[x], {x, 2}] + 
      D[theta[x], x] + \[Beta]*(D[theta[x], x])^2 - N1^2*theta[x] + 
      Q1 - G1*theta[x]^3 == 0, theta[0] == 1, theta'[1] == 0}, 
   theta, {x, 0, 1}]

and plot it as `

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

Now I want to solve and plot the following equation how can I plot it

q=(1+π›½πœƒ)π‘‘πœƒ/𝑑𝑋.

$\endgroup$

1 Answer 1

4
$\begingroup$
  q=(1+π›½πœƒ)π‘‘πœƒ/𝑑x

Since everything is known in the RHS. Just need to evaluate this

Clear["Global`*"]
N1 = 1/2; G1 = 2/10; beta = 2; 

ode = D[theta[x], {x, 2}] + D[theta[x], x] + beta*(D[theta[x], x])^2 -
     N1^2*theta[x] + Q1 - G1*theta[x]^3 == 0;

sol = ParametricNDSolveValue[{ode, theta[0] == 1, theta'[1] == 0}, 
   theta, {x, 0, 1}, {Q1}];

Plot[{sol[0][1], sol[0.2][x]}, {x, 0, 1}, PlotStyle -> {Red, Green}, 
 Frame -> True, FrameLabel -> {X, \[Theta][X]}, 
 FrameStyle -> Directive[Black, Bold, 12]]

(*pick value say Q1=1 for the solution parameter to evaluate q *)
q = (1 + beta*sol[1][x])*D[sol[1][x],x]

Plot[q, {x, 0, 1}]

Mathematica graphics

btw, I do not know why you call this the "heat equation". It does not look like one for me.

$\endgroup$

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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