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


Groups > comp.soft-sys.math.mathematica > #8014

Re: NIntegrate and Plot solution of differ. equa. over initial conditions

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NIntegrate and Plot solution of differ. equa. over initial conditions
Date 2012-01-19 10:21 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jf8qs6$3s1$1@smc.vnet.net> (permalink)

Show all headers | View raw


You didn't define "sol". You defined "sol[p,v]" when p and v are numeric.

Hence, NIntegrate[p*v*(v-y'[2])/.sol,{p,0.1,1}] doesn't work because "sol"  
is undefined.

You didn't give v a numeric value in that expression, either, so there's  
no chance of sol[p, v] being defined.

Give your problem a lot more thought, until it actually makes sense.

Bobby

On Wed, 18 Jan 2012 04:59:51 -0600, Itzhak Shechtman  
<shechtma@netvision.net.il> wrote:

> Hi all,
>
> I would be grateful for any help.
>
> I have the set of 2 ordinary differential equations:
>
>
> Clear[sol, q, k];
> B = 5.5*10^7;
> q[x_, y_] = 1 + 2 x + x^2 + y^2;
> k[x_, y_] = 2 (x/(1 + 2 x + x^2 + y^2))^0.5;
> sol[p_?NumericQ,v_
> ?NumericQ]:=NDSolve[{
>    x''[t]==
>       B*(2 (1 - k[x[t], y[t]]^2)*
>       EllipticK[k[x[t], y[t]]] - (2 - k[x[t], y[t]]^2*
>       (1+x[t]))* EllipticE[k[x[t], y[t]]])/(q[x[t],
>       y[t]]^1.5 k[x[t], y[t]]^2*(1 - k[x[t], y[t]]^2)),
>    y''[t] ==
>      B*2 y[t]*
>       EllipticE[k[x[t], y[t]]]/(q[x[t], y[t]]^1.5*(1 - k[x[t], y[t]]^2)),
>    x[0] == p, x'[0] == 0,
>    y'[0]== v, y[0]==-100000},
> {x, y}, {t, 0,2}];
>
> I wish to:
>
> 1) sol1=NIntegrate[p*v*(v-y'[2])/.sol,{p,0.1,1}]; and
>
> 2) Plot[sol1,{v,10^3,10^5}]
> Mathematica does not accept it, objecting to solving the equations with  
> non numeric initial conditions( p and v ), despite the above definition  
> of sol.
>
> Does anyone have an idea?
> Thanks for the trouble.
>
> Itzhak
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: NIntegrate and Plot solution of differ. equa. over initial conditions DrMajorBob <btreat1@austin.rr.com> - 2012-01-19 10:21 +0000

csiph-web