-2
$\begingroup$

want to solve this equation and get 2 dimensional plot with N2 on X-axis and theta(1) on the Y-axis with x from 0 to 1 and N2 varies from 0 to 5 theta''[x] + theta'[x] - (N2)^2*theta[x] +theta[x]^3 == 0, theta'[1] == 1, theta[0] == 0 please help

$\endgroup$
  • 1
    $\begingroup$ What have you tried so far? Generally, you get better (and more) answers if you show your attempts. Even if they're not working, this shows where exactly you're stuck. $\endgroup$ – Lukas Lang Jan 8 at 17:37
  • $\begingroup$ I am new in Mathematica and try to learn it $\endgroup$ – zia ud din Jan 8 at 19:57
0
$\begingroup$
$Version

(* "11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)" *)

Clear["Global`*"]

The differential equation can be solved analytically with DSolve

eqns = {theta''[x] + theta'[x] - Exp[-x]*N2^2*theta[x] == 0, 
   theta'[1] == -1/4, theta[0] == 1};

sol = DSolve[eqns, theta, x][[1]];

Verifying that sol satisfies eqns

And @@ (eqns /. sol // FullSimplify)

(* True *)

theta[x_, N2_] = (theta /. sol)[x] // FullSimplify

(* (Sqrt[E^-x]
     BesselK[1, 
     2 Sqrt[E^-x] N2] (4 Hypergeometric0F1Regularized[1, N2^2/E] - 
      E Hypergeometric0F1Regularized[2, N2^2]) + 
   E^-x (4 N2 BesselK[0, (2 N2)/Sqrt[E]] + 
      E BesselK[1, 2 N2]) Hypergeometric0F1Regularized[2, 
     E^-x N2^2])/(4 (BesselI[1, 2 N2] BesselK[0, (2 N2)/Sqrt[E]] + 
     BesselK[1, 2 N2] Hypergeometric0F1Regularized[1, N2^2/E])) *)

Plot[theta[1, N2], {N2, 0, 5},
 Frame -> True,
 FrameLabel -> (Style[#, 14, Bold] & /@ {"N2", "theta[1]"})]

enter image description here

NMinimize[{theta[1, N2], N2 > 0}, N2]

(* {-0.0588834, {N2 -> 5.74844}} *)

Limit[theta[1, N2], N2 -> Infinity]

(* 0 *)

Plot[theta[1, N2], {N2, 0, 25},
 Frame -> True,
 PlotRange -> All,
 FrameLabel -> (Style[#, 14, Bold] & /@ {"N2", "theta[1]"})]

enter image description here

$\endgroup$
  • $\begingroup$ thanks Bob Hanlon, now if i expend my problem then what to do? 'eqns = {theta''[x] + theta'[x] - Exp[-x]*N2^2*theta[x] +theta[x]^3== 0, theta'[1] == -1/4, theta[0] == 1}' $\endgroup$ – zia ud din Jan 8 at 20:34
  • $\begingroup$ Comments are not the appropriate place to ask different questions. $\endgroup$ – Bob Hanlon Jan 8 at 21:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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