Re: ODE in mathematica. what is wrong?
- To: mathgroup at smc.vnet.net
- Subject: [mg91317] Re: ODE in mathematica. what is wrong?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 15 Aug 2008 06:53:39 -0400 (EDT)
- References: <g813bb$4r$1@smc.vnet.net>
Hi, the first thing whats wrong is, that you have 3 equations for y[x] and the solution of y'[x] == -\[Rho]y[x] is different form the solution I\[HBar] y'[x] == \[Epsilon]y[x] and has nothing to do with the solution of y''[x] + 2 \[Rho]y'[x] + k^2 == 0 The second thing that is wrong, is that you call NDSolve[] instead of DSolve[] and the third thing is that you use Subscript[y,0] as initial value, because you have said that the symbol "y" stand for the solution function in the ode and it can't be the solution *and* the inital value. But DSolve[#, y[x], x] & /@ {{y'[x] == -\[Rho] y[x], y[0] == Subscript[\[ScriptY], 0]}, {I \[HBar] y'[x] == \[Epsilon] y[x], y[0] == Subscript[\[ScriptY], 0]}, {y''[x] + 2 \[Rho] y'[x] + k^2 == 0, y'[0] == Subscript[g, 0]}} work as it should. Regards Jens hoi-su jung wrote: > Hi, > I am a freshman of Mathematica, I need help here... > > I met such problem as: > > NDSolve[{ y'[x] == -\[Rho]y[x], y[0] == Subscript[y, 0], > I\[HBar] y'[x] == \[Epsilon]y[x], y[0] == Subscript[y, 0], > y''[x] + 2 \[Rho]y'[x] + k^2 == 0, y'[0] == Subscript[g, 0]}, y, x] > NDSolve::dvnoarg: The function y appears with no arguments. > > How to Handle??? >