Skip to main content
Tweeted twitter.com/#!/StackMma/status/555071516740943872
added 223 characters in body
Source Link
mastrok
  • 611
  • 3
  • 9

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

enter image description here

Does anybody know what's going wrong with the new version? How may I get the solution in V10? My sincere thanks for you patience and help!

It seems that the numerical solution behaves strangely in large $r$ region. If I set the boundary at $r=50$, the solution looks like this, enter image description here

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

enter image description here

Does anybody know what's going wrong with the new version? How may I get the solution in V10? My sincere thanks for you patience and help!

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

enter image description here

Does anybody know what's going wrong with the new version? How may I get the solution in V10? My sincere thanks for you patience and help!

It seems that the numerical solution behaves strangely in large $r$ region. If I set the boundary at $r=50$, the solution looks like this, enter image description here

added 92 characters in body
Source Link
mastrok
  • 611
  • 3
  • 9

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

enter image description here

Does anybody know what's going wrong with the new version? How may I get the solution in V10? My sincere thanks for you patience and help!

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

Does anybody know what's going wrong with the new version? How may I get the solution? My sincere thanks for you patience and help!

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

enter image description here

Does anybody know what's going wrong with the new version? How may I get the solution in V10? My sincere thanks for you patience and help!

Source Link
mastrok
  • 611
  • 3
  • 9

mathematica 10 not showing numerical solution of differential equations?

I just got the new mathematica version 10 and tried to solve the following system of differential equation.

$$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2$$ $$ f(0)=h(0)=0, \quad f(\infty)=h(\infty)=1$$

and my code in mathematica,

Clear[eqn, bc, f, h]
eqn = {r^2*f''[r] == 2 f[r] (1 - f[r]) (1 - 2 f[r]) - r^2/4 (h[r])^2 (1 - f[r]),D[r^2*h'[r], r] == 
2 h[r] (1 - f[r])^2};
bc = {f[0.000001] == 0, f[20] == 1, h[0.000001] == 0, h[20] == 1};
sol = NDSolve[{eqn, bc}, {h, f}, {r, 0.000001, 20}]

Mathematica returned the error message:

NDSolve::ndsz: At r == 16.162462464292577`, step size is effectively zero; singularity or stiff system suspected. >>

Now, my problem is the New version 10 does not give me the InterpolatingFunction

while the previous version 8 gives me,

{{h->InterpolatingFunction[{{1.`*^-6,20.`}},"<>"],f->...}}

Does anybody know what's going wrong with the new version? How may I get the solution? My sincere thanks for you patience and help!