Re: Solving differential equations?
- To: mathgroup at smc.vnet.net
- Subject: [mg112527] Re: Solving differential equations?
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sat, 18 Sep 2010 07:27:33 -0400 (EDT)
Zhiyong Shen wrote:
> Following are the two differential equations:
>
> dx/dr = [a*(1-x^2+y^2)]/{r(r-1)]^(1/2)-2b*[r/(r-1)]^(1/2)*x - 0.0152*[r/(r-1)]^(1/2)*xy
>
> dy/dr = -2a*xy/[r(r-1)]-2b*[r/(r-1)]^(1/2)*y + 0.0076*[r/(r-1)]^(1/2) *(1+x^2-y^2)
>
> with initial conditions:
>
> x(5.67)= - {a[br + (b^2*r^2 + a^2 + 0.000058*r^2)^(1/2)]}/(a^2 + 0.000058*r^2)
>
> y(5.67)= -{0.0076*r[br + (b^2*r^2 + a^2 + 0.000058*r^2)^(1/2)]}/(a^2 + 0.000058*r^2)
>
> where r is the independent variable, x and y are dependent variables to be solved, and a and b are constant parameters.
>
> It would be a great help to me if someone could give me a suggestion on how to solve these equations.
>
> Sincerely,
>
> Shen
I would use Mathematica. Did you try it? Because it works on this
problem right out of the box.
eqns = {x'[r]== (a*(1-x[r]^2+y[r]^2))/(r*(r-1))^(1/2) -
2*b*(r/(r-1))^(1/2)*x[r] - 0.0152*(r/(r-1))^(1/2)*x[r]*y[r],
y'[r] == -2*a*x[r]*y[r]/(r*(r-1))-2*b*(r/(r-1))^(1/2)*y[r] +
0.0076*(r/(r-1))^(1/2)*(1+x[r]^2-y[r]^2),
x[r0] == -a*(b*r0 + (b^2*r0^2 + a^2 + 0.000058*r0^2)^(1/2))/
(a^2 + 0.000058*50^2),
y[r0] == -0.0076*r0*(b*r0 + (b^2*r0^2 + a^2 + 0.000058*r0^2)^(1/2))/
(a^2 + 0.000058*r0^2)};
For given parameter values (I use a=1,b=2) we can numerically solve this.
{a,b} = {1,2};
In[224]:= NDSolve[eqns, {x[r],y[r]}, {r,r0,r0+10}]
Out[224]= {{x[r] -> InterpolatingFunction[{{5.67, 15.67}}, <>][r],
y[r] -> InterpolatingFunction[{{5.67, 15.67}}, <>][r]}}
Daniel Lichtblau
Wolfram Research