Initial value problem for system of two diff. equation

  • Thread starter goos
  • Start date
  • #1
3
0
Hi all!

I have quiet a lot a problems solving and programing with Mathematica this system of diff. equations:

y'[x] == 1/b[x],
b'[x] == 1/ubb 1/(y[x] + R1) 1/b[x] (uba 1/(y[x] + R1) - ub),

b[0] == b00,
y[0] == 0
y[2] == Sqrt[5]

where ubb, uba, ub are functions:
ub = b[x] - b[x]/a Hypergeometric2F1[1/2, 3/2, 2, 1 - b[x]^2/a^2];
ubb = 1 -
1/a Hypergeometric2F1[1/2, 3/2, 2, 1 - b[x]^2/a^2] + (3 b[x]^2)/(
4 a^3) Hypergeometric2F1[3/2, 5/2, 3, 1 - b[x]^2/a^2];
uba = (3 b[x])/(4 a^2) Hypergeometric2F1[3/2, 3/2, 3, 1 - b[x]^2/a^2]
and
a = 1/(y[x] + R1)

I'm trying to find initial value for b[0] ("value b00") with respect to initial and boundary value of the other variable y[0]=0, y[2]=Sqrt[5].

I hope I wrote down enough informations and also hope that someone will have time and joy to solve this or just give some advice.

Have a nice day,
goos
 

Answers and Replies

  • #2
1,796
53
What's R1?
 
  • #4
1,796
53
Then that looks like a problem dude unless I have the equations wrong. Here's a hit-and-miss routine to find b(0) such that y(2)=sqrt(5). Note that when I set r1=1, y(2) keeps rising as b(0) drops to about 0.4 at which point Mathematica begins encountering singularities. Try uploading this code into your notebook, select it, then do a Cell/Convert To/Standard Form to see it better. Review the syntax to make sure the equations are correct. Then you can work with it and adjust both the r1 variable and mybval variable.

Code:
r1 = 1; 
bmax = 2; 
a[x_] := 1/(y[x] + r1); 

mytarget = Graphics[Line[{{0, Sqrt[5]}, {100, Sqrt[5]}}]]; 

ub[x_] := b[x] - (b[x]/a[x])*Hypergeometric2F1[1/2, 3/2, 2, 1 - 
b[x]^2/a[x]^2]; 

ubb[x_] := 1 - (1/a[x])*Hypergeometric2F1[1/2, 3/2, 2, 1 - b[x]^2/a[x]^2] + 
    ((3*b[x]^2)/(4*a[x]^3))*Hypergeometric2F1[3/2, 5/2, 3, 1 - 
b[x]^2/a[x]^2]; 

uba[x_] := ((3*b[x])/(4*a[x]^2))*Hypergeometric2F1[3/2, 3/2, 3, 1 - b[x]^2/a[x]^2]; 

mybvalues = Table[mysol = NDSolve[{Derivative[1][y][x] == 1/b[x], 
        Derivative[1][b][x] == (1/ubb[x])*(1/(y[x] + r1))*(1/b[x])*
          (uba[x]/(y[x] + r1) - ub[x]), y[0] == 0, b[0] == mybval}, {y, b}, 
       {x, 0, 2}]; {mybval, First[N[y[2] /. mysol]]}, {mybval, 0.4, 1, 0.1}]; 

Show[{ListPlot[mybvalues, Joined -> True], mytarget}, 
  PlotRange -> {{0, bmax}, {0, 5}}]
 
  • #5
3
0
Hi,
thank you for helping me. Your solution in working well, but my problem is a little bit complex like the one I posted. So, I would like you to look at it one more time.

My main problem is determining b0 (initial value of b function) so that the initial an boundary values of y are y[0]=R1 and y[L]=R2, vhere {x,0,L}, R1=1, R2=Sqrt[R1^2+2 L Rc], Rc=1 (some starting values). I have to program it in a way, that I will be able to change R1, R2, Rc which will determine b0.
I'm already solve it by 'hand' method, but I would like to use possibilities that Mathematica offer and also the solution (program) will probably look nicer.

goos


L =.
R1 =.
R2 =.
Rc =.
a =.
r =.
r0 =.
b00 =.
Clear[y, b, f]

ua = a - Hypergeometric2F1[1/2, 1/2, 2, 1 - b[x]^2/a^2];
ub = b[x] - b[x]/a Hypergeometric2F1[1/2, 3/2, 2, 1 - b[x]^2/a^2];
uaa = 1 - 1/a Hypergeometric2F1[1/2, 1/2, 2, 1 - b[x]^2/a^2] +
3/(4 a) Hypergeometric2F1[3/2, 1/2, 3, 1 - b[x]^2/a^2];
ubb = 1 -
1/a Hypergeometric2F1[1/2, 3/2, 2, 1 - b[x]^2/a^2] + (3 b[x]^2)/(
4 a^3) Hypergeometric2F1[3/2, 5/2, 3, 1 - b[x]^2/a^2];
uba = (3 b[x])/(4 a^2) Hypergeometric2F1[3/2, 3/2, 3, 1 - b[x]^2/a^2];

L = 2;
R1 = 1;
R2 = N[Sqrt[R1^2 + 2 Rc L]];(* Sqrt[5]*)
Rc = 1;
a = r/r0;
r = 1;
r0 = y[x] + R1;

(*sol=NDSolve[{y'[x] == 1/b[x],
b'[x] == 1/ubb 1/(y[x] + R1) 1/b[x] (uba r/r0 - ub), b[0] == b00,
y[0] == 0}, {y[x], b[x]}, {x, 0, L}]
*)
 
  • #6
1,796
53
Goos, you need to do a little more than that dude. What would have been better is if you had taken my code up there and at least tried to accomplish what you wanted to do but first you'd have to study it to see exactly what is going on, then just try and change it slightly, just change maybe one variable a few times to see how it behaves. Then change some more of it. Work with it then post your code (in Cell/Convert To/Raw Input Form) so it's pasted without formatting code.
 

Related Threads on Initial value problem for system of two diff. equation

Replies
3
Views
6K
Replies
1
Views
1K
Replies
1
Views
1K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
4
Views
2K
Replies
4
Views
3K
Replies
1
Views
2K
  • Last Post
Replies
8
Views
2K
Top