Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.6K Views
|
5 Replies
|
1 Total Like
View groups...
Share
Share this post:

Boundary differential equation

Posted 10 years ago

eqns[a?NumericQ, r?NumericQ, [Gamma]_? NumericQ] := {Derivative[4][f][y] - 2 Derivative[2][f][y] a^2 + a^2 (-r y + a^2) f[y] == 0, f[0] == 0, Derivative[3][f][0] - Derivative[1][f][0] a^2 == 0, Derivative[1][f][0] == 1, Derivative[2][f][0] == [Gamma]};

sol[a_?NumericQ, r_?NumericQ, \[Gamma]_?NumericQ] := 
 NDSolveValue[eqns[a, r, \[Gamma]], f, {y, 0, 1}, Method -> "BDF", 
  MaxSteps -> Infinity, InterpolationOrder -> All]

eval = sol[1, 2, 3];
Plot[eval[y], {y, 0, 1}]

Hi everyone, I would know how i can find the value of 'r' using Findroot and plot it with this conditions target y=1,f[1] = 0, f''[1] = 0. Thanks a lot.

POSTED BY: jack hold
5 Replies

Sorry Jack. What do you mean? On my Computer there are no problems.

Regards Hans

Attachments:
POSTED BY: Hans Dolhaine
Posted 10 years ago
eqns[a_?NumericQ, r_?NumericQ, 
  gamma_?NumericQ] := {Derivative[4][f][y] - 
    2 Derivative[2][f][y] a^2 + a^2 (-r y + a^2) f[y] == 0, f[0] == 0,
   Derivative[3][f][0] - Derivative[1][f][0] a^2 == 0, 
  Derivative[1][f][0] == 1, Derivative[2][f][0] == gamma}


sol[a_?NumericQ, r_?NumericQ, \[Gamma]_?NumericQ] := 
 NDSolve[eqns[a, r, \[Gamma]], f, {y, 0, 1}, Method -> "BDF", 
  MaxSteps -> Infinity, InterpolationOrder -> All]

eval = sol[1, 2, 3][[1, 1]]

ff = f /. eval

Plot[ff[y], {y, 0, 1}]
Clear[ff]
ff[r_] := sol[1, r, 3][[1, 1]] /. Rule[x_, y_] :> y[xx]

Manipulate[
 Plot[ff[r], {xx, 0, 1}, PlotRange -> {0, 2}],
 {{r, 0}, -5, 5}]

In[119]:= (f /. sol[1, -5, 3][[1, 1]])[.546]
(f /. sol[1, -1, 3][[1, 1]])[.546]
(f /. sol[1, 0, 3][[1, 1]])[.546]
(f /. sol[1, 2.3, 3][[1, 1]])[.546]
(f /. sol[1, 4, 3][[1, 1]])[.546]

The algorithm doesn't work :/

POSTED BY: jack hold

Seems your function does not depend too much on r.....

Clear[ff]
ff[r_] := sol[1, r, 3][[1, 1]] /. Rule[x_, y_] :> y[xx]

Manipulate[
 Plot[ff[r], {xx, 0, 1}, PlotRange -> {0, 2}],
 {{r, 0}, -5, 5}]

In[119]:= (f /. sol[1, -5, 3][[1, 1]])[.546]
(f /. sol[1, -1, 3][[1, 1]])[.546]
(f /. sol[1, 0, 3][[1, 1]])[.546]
(f /. sol[1, 2.3, 3][[1, 1]])[.546]
(f /. sol[1, 4, 3][[1, 1]])[.546]

Out[119]= 1.04275

Out[120]= 1.04316

Out[121]= 1.04326

Out[122]= 1.0435

Out[123]= 1.04367
POSTED BY: Hans Dolhaine
Posted 10 years ago

hi sir hans how i can read this algorithm with the fisrt part and the second part

POSTED BY: jack hold

some mistypings.....

eqns[a_?NumericQ, r_?NumericQ, 
  gamma_?NumericQ] := {Derivative[4][f][y] - 
    2 Derivative[2][f][y] a^2 + a^2 (-r y + a^2) f[y] == 0, f[0] == 0,
   Derivative[3][f][0] - Derivative[1][f][0] a^2 == 0, 
  Derivative[1][f][0] == 1, Derivative[2][f][0] == gamma}


sol[a_?NumericQ, r_?NumericQ, \[Gamma]_?NumericQ] := 
 NDSolve[eqns[a, r, \[Gamma]], f, {y, 0, 1}, Method -> "BDF", 
  MaxSteps -> Infinity, InterpolationOrder -> All]

eval = sol[1, 2, 3][[1, 1]]

ff = f /. eval

Plot[ff[y], {y, 0, 1}]

here is the plot

POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard