Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2707 > unrolled thread

NDSolve issues with initial and boundary conditions (corrected characters)

Started byArturo Amador <arturo.amador@ntnu.no>
First post2011-05-25 10:59 +0000
Last post2011-05-27 10:12 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  NDSolve issues with initial and boundary conditions (corrected characters) Arturo Amador <arturo.amador@ntnu.no> - 2011-05-25 10:59 +0000
    Re: NDSolve issues with initial and boundary conditions (corrected "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-05-25 23:34 +0000
    Re: NDSolve issues with initial and boundary conditions (corrected characters) Arturo Amador <arturo.amador@ntnu.no> - 2011-05-25 23:31 +0000
      Re: NDSolve issues with initial and boundary conditions (corrected "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-05-27 10:12 +0000

#2707 — NDSolve issues with initial and boundary conditions (corrected characters)

FromArturo Amador <arturo.amador@ntnu.no>
Date2011-05-25 10:59 +0000
SubjectNDSolve issues with initial and boundary conditions (corrected characters)
Message-ID<irinec$rgn$1@smc.vnet.net>
Hi,

Sorry for the previous message, it had some weird characters I have =
corrected it and resend it.

I am having some issues when trying to solve a system of three coupled 
differential equations numerically using NDSolve. I am trying to specify 
boundary conditions for two of the variables in the same point (point at 
L) and a boundary condition for the last variable at zero. The 
mathematica code is:

IIn[24]:= vacuumlinearrhsp =
(-((4 E^(-4 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^2)/
        Lambda^4) - (12 g[t]^2)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(3/
         2)) factorp[t]
Out[24]= -((E^(5 t)
  Lambda^5 (-((E^(-4 t) Sqrt[E^(2 t) Lambda^2] (-1 + n))/Lambda^4) -
   3/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(3/2)))/(24 Pi^2))

In[25]:= vacuumcuadraticrhsg =
((24 E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^4)/
      Lambda^6 + (216 g[t]^4)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(5/
         2)) factorg[t]
Out[25]= (2 E^(5 t) Lambda^5 g[
 t]^4 ((E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n))/Lambda^6 +
  9/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(5/2)))/Pi^2

In[26]:= vacuumcubicrhsh =
[(-((160 E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^6)/
        Lambda^8) - (4320 g[t]^6)/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(7/
         2)) factorh[t]
Out[26]= -((40 E^(5 t)
  Lambda^5 g[
  t]^6 (-((E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + n))/Lambda^8) -
   27/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(7/2)))/(3 Pi^2))


(*Declarations*)
Lambda = Sqrt[5] msig;

L = -17090/10000;
msig = 400;

mp = 0;
fp = 93;

lambda = 2 (msig^2 - mp^2)/fp^2;
gk0 = (lambda/24)^(1/2);
pk0 = 1/2 fp^2;

n = 4;


sol = NDSolve[{D[p0[t], t] == vacuumlinearrhsp,
   4 D[g[t]^2, t] + 3 h[t] D[p0[t], t] == vacuumcuadraticrhsg,
   D[h[t], t] == vacuumcubicrhsh, p0[L] == pk0, g[L]^2 == =
gk0^2,
   h[0] == 0}, {p0, g, h}, {t, L, 0},
  Method -> {StiffnessSwitching,
    Method -> {ExplicitRungeKutta, Automatic}}];

with output:

Power::infy: Infinite expression 1/0. encountered. >>

Infinity::indet: Indeterminate expression (0. Sqrt[5] =
ComplexInfinity)/\[Pi]^2 encountered. >>

Power::infy: Infinite expression 1/0.^2 encountered. >>

Infinity::indet: Indeterminate expression (0. Sqrt[5] =
ComplexInfinity)/\[Pi]^2 encountered. >>

Power::infy: Infinite expression 1/0. encountered. >>

General::stop: Further output of Power::infy will be suppressed during =
this calculation. >>
Infinity::indet: Indeterminate expression 0. ComplexInfinity =
encountered. >>
General::stop: Further output of Infinity::indet will be suppressed =
during this calculation. >>
NDSolve::ndnum: Encountered non-numerical value for a derivative at t ===
 -1.709. >>

I am sure there is no singularity. I am getting this output no matter =
what value I am giving for h[0], as long as I specify the boundary =
condition in a point that is not L, it gives me this same error message. =
I have tried h[0.9L] and still the same. When h[t]==0 The system =
reduces to this:

sol = NDSolve[{D[p0[t], t] == (Lambda Exp[t])^5/(
     24 Pi^2) ( (n - 1)/(Lambda Exp[t])^3 +
       3/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(3/2)),
   D[g[t]^2, t] == ((Lambda Exp[t])^5 * g[t]^4 )/(
     2 Pi^2) ((n - 1)/(Lambda Exp[t])^5 +
       9/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(5/2)), p0[L] == pk0,=

   g[L]^2 == gk0^2}, {p0, g}, {t, L, 0},
  Method -> {StiffnessSwitching,
    Method -> {ExplicitRungeKutta, Automatic}}];

For which I get nice solutions.



Thanks in advance


--
Arturo Amador Cruz
Stipendiat				Norges =
Teknisk-Naturvitenskapelige Universitet (NTNU)
						Institutt for Fysikk
						Fakultet for =
Naturvitenskap og Teknologi
						H=F8gskoleringen 5, =
Realfagbygget, E5-108
Telefon					(735) 93366		NO-7491 =
TRONDHEIM
										=
NORWAY
arturo.amador@ntnu.no


--Apple-Mail-2--555294862
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 7914

<html><head></head><body style="word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
">Hi,<br>Sorry for the previous message, it had some weird characters I =
have corrected it and resend it.<div><br>I am having some issues when =
trying to solve a system of three coupled differential equations =
numerically using NDSolve. I am trying to specify boundary conditions =
for two of the variables in the same point (point at L) and a boundary =
condition for the last variable at zero. The mathematica code =
is:<br><br>IIn[24]:= vacuumlinearrhsp =&nbsp;<br>(-((4 E^(-4 t) =
Sqrt[E^(2 t) Lambda^2] (-1 + n) =
g[t]^2)/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lambda^4) - =
(12 g[t]^2)/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(3/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2)) =
factorp[t]<br>Out[24]= -((E^(5 t)<br>&nbsp;&nbsp;Lambda^5 (-((E^(-4 t) =
Sqrt[E^(2 t) Lambda^2] (-1 + n))/Lambda^4) =
-&nbsp;<br>&nbsp;&nbsp;&nbsp;3/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(3/2)))/(24 Pi^2))<br><br>In[25]:= vacuumcuadraticrhsg =
=&nbsp;<br>((24 E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) =
g[t]^4)/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lambda^6 + (216 =
g[t]^4)/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(5/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2)) =
factorg[t]&nbsp;<br>Out[25]= (2 E^(5 t) Lambda^5 g[<br>&nbsp;t]^4 =
((E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n))/Lambda^6 =
+&nbsp;<br>&nbsp;&nbsp;9/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(5/2)))/Pi^2<br><br>In[26]:= vacuumcubicrhsh =
=&nbsp;<br>[(-((160 E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) =
g[t]^6)/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lambda^8) - =
(4320 g[t]^6)/(E^(2 t) Lambda^2 + 16 g[t]^2 =
p0[t])^(7/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2)) =
factorh[t]<br>Out[26]= -((40 E^(5 t)<br>&nbsp;&nbsp;Lambda^5 =
g[<br>&nbsp;&nbsp;t]^6 (-((E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + =
n))/Lambda^8) -&nbsp;<br>&nbsp;&nbsp;&nbsp;27/(E^(2 t) Lambda^2 + 16 =
g[t]^2 p0[t])^(7/2)))/(3 Pi^2))<br><br><br>(*Declarations*)<br>Lambda = =
Sqrt[5] msig;<br><br>L =&nbsp;-17090/10000;&nbsp;<br>msig = =
400;&nbsp;<br><br>mp = 0;&nbsp;<br>fp = 93;&nbsp;<br><br>lambda = =
2 (msig^2 - mp^2)/fp^2;<br>gk0 = (lambda/24)^(1/2);<br>pk0 = 1/2 =
fp^2;<br><br>n = 4;&nbsp;<br><br><br>sol = NDSolve[{D[p0[t], t] ===
 vacuumlinearrhsp,&nbsp;<br>&nbsp;&nbsp;&nbsp;4 D[g[t]^2, t] + 3 h[t] =
D[p0[t], t] == =
vacuumcuadraticrhsg,&nbsp;<br>&nbsp;&nbsp;&nbsp;D[h[t], t] == =
vacuumcubicrhsh, p0[L] == pk0, g[L]^2 == =
gk0^2,&nbsp;<br>&nbsp;&nbsp;&nbsp;h[0] == 0}, {p0, g, h}, {t, L, =
0},&nbsp;<br>&nbsp;&nbsp;Method -&gt; =
{StiffnessSwitching,&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Method -&gt; =
{ExplicitRungeKutta, Automatic}}];<br><br>with =
output:<br><br>Power::infy: Infinite expression 1/0. encountered. =
&gt;&gt;<br><br>Infinity::indet: Indeterminate expression (0. Sqrt[5] =
ComplexInfinity)/\[Pi]^2 encountered. &gt;&gt;<br><br>Power::infy: =
Infinite expression 1/0.^2 encountered. &gt;&gt;<br><br>Infinity::indet: =
Indeterminate expression (0. Sqrt[5] ComplexInfinity)/\[Pi]^2 =
encountered. &gt;&gt;<br><br>Power::infy: Infinite expression 1/0. =
encountered. &gt;&gt;<br><br>General::stop: Further output of =
Power::infy will be suppressed during this calculation. =
&gt;&gt;<br>Infinity::indet: Indeterminate expression 0. ComplexInfinity =
encountered. &gt;&gt;<br>General::stop: Further output of =
Infinity::indet will be suppressed during this calculation. =
&gt;&gt;<br>NDSolve::ndnum: Encountered non-numerical value for a =
derivative at t == -1.709. &gt;&gt;<br><br>I am sure there is no =
singularity. I am getting this output no matter what value I am giving =
for h[0], as long as I specify the boundary condition in a point that is =
not L, it gives me this same error message. I have tried h[0.9L] and =
still the same. When h[t]==0 The system reduces to this:<br><br>sol =
= NDSolve[{D[p0[t], t] == (Lambda =
Exp[t])^5/(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24 Pi^2) ( (n - 1)/(Lambda =
Exp[t])^3 =
+&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3/((Lambda =
Exp[t])^2 + 16 p0[t] =
g[t]^2)^(3/2)),&nbsp;<br>&nbsp;&nbsp;&nbsp;D[g[t]^2, t] == ((Lambda =
Exp[t])^5 * g[t]^4 )/(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2 Pi^2) ((n - =
1)/(Lambda Exp[t])^5 =
+&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9/((Lambda =
Exp[t])^2 + 16 p0[t] g[t]^2)^(5/2)), p0[L] == =
pk0,&nbsp;<br>&nbsp;&nbsp;&nbsp;g[L]^2 == gk0^2}, {p0, g}, {t, L, =
0},&nbsp;<br>&nbsp;&nbsp;Method -&gt; =
{StiffnessSwitching,&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Method -&gt; =
{ExplicitRungeKutta, Automatic}}];<br><br>For which I get nice =
solutions.&nbsp;<br><br><br><br>Thanks in =
advance<br><br><br>--<br>Arturo Amador Cruz<br>Stipendiat<span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span>Norges =
Teknisk-Naturvitenskapelige Universitet (NTNU)<br><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span>Institutt =
for Fysikk<br><span class="Apple-tab-span" style="white-space: pre; =
">	</span><span class="Apple-tab-span" style="white-space: pre; =
">	</span><span class="Apple-tab-span" style="white-space: pre; =
">	</span><span class="Apple-tab-span" style="white-space: pre; =
">	</span><span class="Apple-tab-span" style="white-space: pre; =
">	</span><span class="Apple-tab-span" style="white-space: pre; =
">	</span>Fakultet for Naturvitenskap og Teknologi<br><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	=
</span>H=F8gskoleringen 5, Realfagbygget, E5-108<br>Telefon<span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span><span =
class="Apple-tab-span" style="white-space: pre; ">	</span>(735) =
93366<span class="Apple-tab-span" style="white-space: pre; ">	=
</span><span class="Apple-tab-span" style="white-space: pre; ">	=
</span>NO-7491 TRONDHEIM<br><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span><span class="Apple-tab-span" =
style="white-space: pre; ">	</span>NORWAY<br><a =
href="mailto:arturo.amador@ntnu.no">arturo.amador@ntnu.no</a><br><br></d=
iv></body></html>=

--Apple-Mail-2--555294862--

[toc] | [next] | [standalone]


#2719 — Re: NDSolve issues with initial and boundary conditions (corrected

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2011-05-25 23:34 +0000
SubjectRe: NDSolve issues with initial and boundary conditions (corrected
Message-ID<irk3lk$7ba$1@smc.vnet.net>
In reply to#2707
You have functions factorp[t], factorg[t], and factorh[t] in your code 
without definitions.

It would be a lot easier for us to cut and paste your stuff if you left 
off the In[] Out[] labels.

Kevin
On 5/25/2011 6:59 AM, Arturo Amador wrote:
> Hi,
>
> Sorry for the previous message, it had some weird characters I have corrected it and resend it.
>
> I am having some issues when trying to solve a system of three coupled
> differential equations numerically using NDSolve. I am trying to specify
> boundary conditions for two of the variables in the same point (point at
> L) and a boundary condition for the last variable at zero. The
> mathematica code is:
>

[toc] | [prev] | [next] | [standalone]


#2728

FromArturo Amador <arturo.amador@ntnu.no>
Date2011-05-25 23:31 +0000
Message-ID<irk3gt$77h$1@smc.vnet.net>
In reply to#2707
I am sorry, here is the message without the In[] Out[] labels and with 
the missing definitions:

Hi,

Sorry for the previous message, it had some weird characters I have 
corrected it and resend it.

I am having some issues when trying to solve a system of three coupled 
differential equations numerically using NDSolve. I am trying to specify 
boundary conditions for two of the variables in the same point (point at 
L) and a boundary condition for the last variable   at zero. The 
mathematica code is:


vd[x_]:=1/(2^(x+1) \[Pi]^(x/2) Gamma[x/2]) ;
factorp[t_]:=(- 2 (Lambda Exp[t])^5 vd[3])/(3 * 8 g[t]^2);
factorg[t_]:=  (2 (Lambda Exp[t])^5 vd[3])/3;
factorh[t_]:=-((2 (Lambda Exp[t])^5 vd[3])/3 );

vacuumlinearrhsp = (-((4 E^(-4 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^2)/ Lambda^4) - (12 g[t]^2)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(3/2)) factorp[t]

vacuumcuadraticrhsg = ((24 E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^4)/Lambda^6 + (216 g[t]^4)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(5/2)) factorg[t]

vacuumcubicrhsh =(-((160 E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^6)/Lambda^8) - (4320 g[t]^6)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(7/2)) factorh[t]

(*Declarations*)
Lambda = Sqrt[5] msig;

L = -17090/10000;
msig = 400;

mp = 0;
fp = 93;

lambda = 2 (msig^2 - mp^2)/fp^2;
gk0 = (lambda/24)^(1/2);
pk0 = 1/2 fp^2;

n = 4;


sol = NDSolve[{D[p0[t], t] == vacuumlinearrhsp, 4 D[g[t]^2, t] + 3 h[t] D[p0[t], t] == vacuumcuadraticrhsg, D[h[t], t] == vacuumcubicrhsh, p0[L] == pk0, g[L]^2 == gk0^2,  h[0] == 0}, {p0, g, h}, {t, L, 0}, Method -> {StiffnessSwitching,   Method -> {ExplicitRungeKutta, Automatic}}];

with output:

Power::infy: Infinite expression 1/0. encountered. >>

Infinity::indet: Indeterminate expression (0. Sqrt[5] ComplexInfinity)/\[Pi]^2 encountered. >>

Power::infy: Infinite expression 1/0.^2 encountered. >>

Infinity::indet: Indeterminate expression (0. Sqrt[5] ComplexInfinity)/\[Pi]^2 encountered. >>

Power::infy: Infinite expression 1/0. encountered. >>

General::stop: Further output of Power::infy will be suppressed during this calculation. >>
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>
General::stop: Further output of Infinity::indet will be suppressed during this calculation. >>
NDSolve::ndnum: Encountered non-numerical value for a derivative at t ==-1.709. >>

I am sure there is no singularity. I am getting this output no matter
what value I am giving for h[0], as long as I specify the boundary
condition in a point that is not L, it gives me this same error message.
I have tried h[0.9L] and still the same. When h[t]=0 The system
reduces to this:

sol = NDSolve[{D[p0[t], t] == (Lambda Exp[t])^5/(24 Pi^2) ( (n - 1)/(Lambda Exp[t])^3 +3/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(3/2)), D[g[t]^2, t] == ((Lambda Exp[t])^5 * g[t]^4 )/(2 Pi^2) ((n - 1)/(Lambda Exp[t])^5 + 9/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(5/2)), p0[L] == pk0,  g[L]^2 == gk0^2}, {p0, g}, {t, L, 0}, Method -> {StiffnessSwitching,   Method -> {ExplicitRungeKutta, Automatic}}];

For which I get nice solutions.



Thanks in advance




> You have functions factorp[t], factorg[t], and factorh[t] in your code without definitions.
>
> It would be a lot easier for us to cut and paste your stuff if you left off the In[] Out[] labels.
>
> Kevin
> On 5/25/2011 6:59 AM, Arturo Amador wrote:
>> Hi,
>>
>> Sorry for the previous message, it had some weird characters I have 
>> corrected it and resend it.
>>
>> I am having some issues when trying to solve a system of three coupled
>> differential equations numerically using NDSolve. I am trying to specify
>> boundary conditions for two of the variables in the same point (point at
>> L) and a boundary condition for the last variable at zero. The
>> mathematica code is:
>>

[toc] | [prev] | [next] | [standalone]


#2749 — Re: NDSolve issues with initial and boundary conditions (corrected

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2011-05-27 10:12 +0000
SubjectRe: NDSolve issues with initial and boundary conditions (corrected
Message-ID<irnte2$sme$1@smc.vnet.net>
In reply to#2728
Arturo,

As near as I can tell, the problem occurs because you have specified the 
"initial" conditions at two different points: t=L for p0 and g, and t=0 
for h. I tried running your code with h[L]=0, and all is well. My guess 
is that the numerical techniques that try to solve your sort of boundary 
value problem are having difficulties. Perhaps someone who is more 
familiar with the numerics can weigh in on this.

Kevin


On 5/25/2011 7:31 PM, Arturo Amador wrote:
> I am sorry, here is the message without the In[] Out[] labels and with
> the missing definitions:
>
> Hi,
>
> Sorry for the previous message, it had some weird characters I have
> corrected it and resend it.
>
> I am having some issues when trying to solve a system of three coupled
> differential equations numerically using NDSolve. I am trying to specify
> boundary conditions for two of the variables in the same point (point at
> L) and a boundary condition for the last variable   at zero. The
> mathematica code is:
>
>
> vd[x_]:=1/(2^(x+1) \[Pi]^(x/2) Gamma[x/2]) ;
> factorp[t_]:=(- 2 (Lambda Exp[t])^5 vd[3])/(3 * 8 g[t]^2);
> factorg[t_]:=  (2 (Lambda Exp[t])^5 vd[3])/3;
> factorh[t_]:=-((2 (Lambda Exp[t])^5 vd[3])/3 );
>
> vacuumlinearrhsp = (-((4 E^(-4 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^2)/ Lambda^4) - (12 g[t]^2)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(3/2)) factorp[t]
>
> vacuumcuadraticrhsg = ((24 E^(-6 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^4)/Lambda^6 + (216 g[t]^4)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(5/2)) factorg[t]
>
> vacuumcubicrhsh =(-((160 E^(-8 t) Sqrt[E^(2 t) Lambda^2] (-1 + n) g[t]^6)/Lambda^8) - (4320 g[t]^6)/(E^(2 t) Lambda^2 + 16 g[t]^2 p0[t])^(7/2)) factorh[t]
>
> (*Declarations*)
> Lambda = Sqrt[5] msig;
>
> L = -17090/10000;
> msig = 400;
>
> mp = 0;
> fp = 93;
>
> lambda = 2 (msig^2 - mp^2)/fp^2;
> gk0 = (lambda/24)^(1/2);
> pk0 = 1/2 fp^2;
>
> n = 4;
>
>
> sol = NDSolve[{D[p0[t], t] == vacuumlinearrhsp, 4 D[g[t]^2, t] + 3 h[t] D[p0[t], t] == vacuumcuadraticrhsg, D[h[t], t] == vacuumcubicrhsh, p0[L] == pk0, g[L]^2 == gk0^2,  h[0] == 0}, {p0, g, h}, {t, L, 0}, Method ->  {StiffnessSwitching,   Method ->  {ExplicitRungeKutta, Automatic}}];
>
> with output:
>
> Power::infy: Infinite expression 1/0. encountered.>>
>
> Infinity::indet: Indeterminate expression (0. Sqrt[5] ComplexInfinity)/\[Pi]^2 encountered.>>
>
> Power::infy: Infinite expression 1/0.^2 encountered.>>
>
> Infinity::indet: Indeterminate expression (0. Sqrt[5] ComplexInfinity)/\[Pi]^2 encountered.>>
>
> Power::infy: Infinite expression 1/0. encountered.>>
>
> General::stop: Further output of Power::infy will be suppressed during this calculation.>>
> Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.>>
> General::stop: Further output of Infinity::indet will be suppressed during this calculation.>>
> NDSolve::ndnum: Encountered non-numerical value for a derivative at t ==-1.709.>>
>
> I am sure there is no singularity. I am getting this output no matter
> what value I am giving for h[0], as long as I specify the boundary
> condition in a point that is not L, it gives me this same error message.
> I have tried h[0.9L] and still the same. When h[t]=0 The system
> reduces to this:
>
> sol = NDSolve[{D[p0[t], t] == (Lambda Exp[t])^5/(24 Pi^2) ( (n - 1)/(Lambda Exp[t])^3 +3/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(3/2)), D[g[t]^2, t] == ((Lambda Exp[t])^5 * g[t]^4 )/(2 Pi^2) ((n - 1)/(Lambda Exp[t])^5 + 9/((Lambda Exp[t])^2 + 16 p0[t] g[t]^2)^(5/2)), p0[L] == pk0,  g[L]^2 == gk0^2}, {p0, g}, {t, L, 0}, Method ->  {StiffnessSwitching,   Method ->  {ExplicitRungeKutta, Automatic}}];
>
> For which I get nice solutions.
>
>
>
> Thanks in advance
>
>
>
>
>> You have functions factorp[t], factorg[t], and factorh[t] in your code without definitions.
>>
>> It would be a lot easier for us to cut and paste your stuff if you left off the In[] Out[] labels.
>>
>> Kevin
>> On 5/25/2011 6:59 AM, Arturo Amador wrote:
>>> Hi,
>>>
>>> Sorry for the previous message, it had some weird characters I have
>>> corrected it and resend it.
>>>
>>> I am having some issues when trying to solve a system of three coupled
>>> differential equations numerically using NDSolve. I am trying to specify
>>> boundary conditions for two of the variables in the same point (point at
>>> L) and a boundary condition for the last variable at zero. The
>>> mathematica code is:
>>>
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web