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


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

question about ndsolve

Started by"Hagwood, Charles R" <charles.hagwood@nist.gov>
First post2013-09-10 07:24 +0000
Last post2013-09-18 01:30 +0000
Articles 3 — 3 participants

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


Contents

  question about ndsolve "Hagwood, Charles R" <charles.hagwood@nist.gov> - 2013-09-10 07:24 +0000
    Re: question about ndsolve Youngjoo Chung <ychung12@gmail.com> - 2013-09-12 06:20 +0000
    Re: question about ndsolve rchagw@gmail.com - 2013-09-18 01:30 +0000

#15395 — question about ndsolve

From"Hagwood, Charles R" <charles.hagwood@nist.gov>
Date2013-09-10 07:24 +0000
Subjectquestion about ndsolve
Message-ID<l0mhfr$ldc$1@smc.vnet.net>
I know the following differential equation has a solution, but cannot get NDSolve to find it.


dgamma[s_,a_]:=1+9.6*(s-1)^2*s+9.6*s^2*(s-1)
q2[x_]:=Sqrt[2*Pi]*{-Sin[2*Pi*x],Cos[2*Pi*x]}
q1[x_,a_]:=Sqrt[2*Pi*dgamma[x,a]]*{-Sin[2*Pi*gamma[x,a]],Cos[2*Pi*gamma[x,a]]}


h1[x_]:=q2[x].q2'[x]
h2[x_]:=q2[x].q2[x]


sol=NDSolve[{-6*y'[x]^2*(q1[x,.3].q2'[y[x]]) +6*y'[x]^(5/2)*h1[y[x]]+y''[x]*(q1[x,.3].q2[y[x]])-y''[x]*y'[x]^(1/2)*h2[y[x]]==0,y[0]==0,y[1]==1},y,{x,0.01,1},Method->{"Shooting","StartingInitialConditions"->{y[0]==0}}]

I get the error  NDSolve::ntcs: Cannot solve constraint equations for initial conditions. <http://reference.wolfram.com/mathematica/ref/message/NDSolve/ntcs.html> 


The solution is

y[x_]:=x+16*a*x^2*(x-1)^2
a=.3;

The following expression is zero for all values of x

-6*y'[x]^2*(q1[x,.3].q2'[y[x]]) +6*y'[x]^(5/2)*h1[y[x]]+y''[x]*(q1[x,.3].q2[y[x]])-y''[x]*y'[x]^(1/2)*h2[y[x]]/.x->.9


Does anyone know what is going wrong with NDSolve?

Charles Hagwood




[toc] | [next] | [standalone]


#15420

FromYoungjoo Chung <ychung12@gmail.com>
Date2013-09-12 06:20 +0000
Message-ID<l0rmf8$59i$1@smc.vnet.net>
In reply to#15395
Dear Charles,

A couple of suggestions about your equation.

1. The function gamma is not defined.
2. Try adding the slope y'[0]==1 to "StartingInitialConditions".

Youngjoo Chung

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


#15464

Fromrchagw@gmail.com
Date2013-09-18 01:30 +0000
Message-ID<l1avo2$cvk$1@smc.vnet.net>
In reply to#15395
On Tuesday, September 10, 2013 3:24:43 AM UTC-4, Hagwood, Charles R wrote:
> I know the following differential equation has a solution, but cannot get NDSolve to find it.
> 
> 
> 
> 
> 
> dgamma[s_,a_]:=1+9.6*(s-1)^2*s+9.6*s^2*(s-1)
> 
> q2[x_]:=Sqrt[2*Pi]*{-Sin[2*Pi*x],Cos[2*Pi*x]}
> 
> q1[x_,a_]:=Sqrt[2*Pi*dgamma[x,a]]*{-Sin[2*Pi*gamma[x,a]],Cos[2*Pi*gamma[x,a]]}
> 
> 
> 
> 
> 
> h1[x_]:=q2[x].q2'[x]
> 
> h2[x_]:=q2[x].q2[x]
> 
> 
> 
> 
> 
> sol=NDSolve[{-6*y'[x]^2*(q1[x,.3].q2'[y[x]]) +6*y'[x]^(5/2)*h1[y[x]]+y''[x]*(q1[x,.3].q2[y[x]])-y''[x]*y'[x]^(1/2)*h2[y[x]]==0,y[0]==0,y[1]==1},y,{x,0.01,1},Method->{"Shooting","StartingInitialConditions"->{y[0]==0}}]
> 
> 
> 
> I get the error  NDSolve::ntcs: Cannot solve constraint equations for initial conditions. <http://reference.wolfram.com/mathematica/ref/message/NDSolve/ntcs.html> 
> 
> 
> 
> 
> 
> The solution is
> 
> 
> 
> y[x_]:=x+16*a*x^2*(x-1)^2
> 
> a=.3;
> 
> 
> 
> The following expression is zero for all values of x
> 
> 
> 
> -6*y'[x]^2*(q1[x,.3].q2'[y[x]]) +6*y'[x]^(5/2)*h1[y[x]]+y''[x]*(q1[x,.3].q2[y[x]])-y''[x]*y'[x]^(1/2)*h2[y[x]]/.x->.9
> 
> 
> 
> 
> 
> Does anyone know what is going wrong with NDSolve?
> 
> 
> 
> Charles Hagwood

gamma[s_,a_]:=s+16*a*s^2*(s-1)^2

[toc] | [prev] | [standalone]


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


csiph-web