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


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

how can I solve my system of differential equations?

From raj <pianoman2012sg@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject how can I solve my system of differential equations?
Date 2013-12-12 06:26 +0000
Message-ID <l8bku1$65g$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


hi guys,

I have a question pertaining to my code below: for a problem that i'm working on, I require to find the values of the roots E2 that will set the function f1[E2] - f2[E2] to zero. I know how to obtain the roots one at a time: for instance finding a a root of E2 lying between, say 0 and 2. But I would like to know whether it is possible to get Mathematica to generate all the roots that lie within a certain interval at once, say all the possible ones lying between say 0 and 10. I have tried using NSolve and Reduce, but I got nothing out of them , so any help in refining the code to do this  will be most appreciated!

regards
raj n

xmin = -6.500;
xmax = 6.500;
xmatch = 1.50;
eq1[x_, x0_, E2_] := (y''[x]) + (E2 - x^2) y[x] == 0, 
   y[x0] == 0, Derivative[1][y][x0] == 1/10^6};

y1[x_, E2_] := 
 y[x] /. NDSolve[eq1[x, xmin, E2], y, {x, xmin, xmatch}][[1]]; 
f1[E2_] := Abs[\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\ \(y1[x, E2]\)\)/   y1[x, E2] /. 
   x -> xmatch];
y2[x_, E2_] := 
 y[x] /. NDSolve[eq1[x, xmax, E2], y, {x, xmax, xmatch}][[1]]; 
f2[E2_] := Abs[\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(y2[x, E2]\)\)/y2[x, E2] /. 
   x -> xmatch]
f[E2_?NumericQ] := f1[E2] - f2[E2];
NSolve[f[E2_?NumericQ] == 0 && 0 < E2 < 10, E2]
rts = Reduce[f == 0 && 2.5 < E2 < 10.0, E2]
c2 = N[E2 /. {ToRules[rts]}]
Print["The value of E2   was=", c2]

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


Thread

how can I solve my system of differential equations? raj <pianoman2012sg@gmail.com> - 2013-12-12 06:26 +0000

csiph-web