Re: Why doesn't Mathematica solve this simple differential equation?

*To*: mathgroup at smc.vnet.net*Subject*: [mg69243] Re: Why doesn't Mathematica solve this simple differential equation?*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>*Date*: Sun, 3 Sep 2006 23:46:27 -0400 (EDT)*Organization*: The Open University, Milton Keynes, UK*References*: <eddqq8$3vq$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Joseph Gwinn wrote: > Here is the system I'm trying to solve. It's an electrical circuit > consisting of a capacitor C1 (with initial voltage 4.0 volts), a > resistor R1, and a diode in series. > > > Approach 1: > > eqns11 = {Q1'[t] == -Iloop[t], Q1[t] == C1*Vc[t], Vr[t] == > R1*Is*Exp[Vd[t]/0.026], Vc[t] == Vr[t] + Vd[t], Vc[0] == 4.0} > > eqns12 = eqns11 /. {C1 -> 1.0*10^-6, R1 -> 16, Is -> 10^-13} > > eqns12soln = NDSolve[eqns12, Q1, {t, 0, 1}] Let's try this one: eqns11= { Q1'[t]== - Iloop[t], Q1[t]== C1* Vc[t], Vr[t]== R1*Is* Exp[ Vd[t]/0.026], Vc[t]== Vr[t]+ Vd[t], Vc[0]==4.0} --> {Derivative[1][Q1][t] == -Iloop[t], Q1[t] == C1*Vc[t], Vr[t] == E^(38.46153846153846*Vd[t])*Is*R1, Vc[t] == Vd[t] + Vr[t], Vc[0] == 4.} eqns12= eqns11/. { C1-> 1.0* 10^ -6, R1->16, Is-> 10^ -13} --> {Derivative[1][Q1][t] == -Iloop[t], Q1[t] == 1.*^-6*Vc[t], Vr[t] == E^(38.46153846153846*Vd[t])/625000000000, Vc[t] == Vd[t] + Vr[t], Vc[0] == 4.} If I follow you correctly, you want to solve for the function Q1[t], function that you have already defined as 1.*^-6*Vc[t], that is Q1[t] depends on the function Vc[t], which is itself defined as the sum of functions that depends on another function Vd[t] that is defined nowhere. Moreover, the derivative of Q1[t] is also specified as being equal to another undefined function Iloop[t]... You wonder then why NDSolve complains about the input not being an ODE? eqns12soln= NDSolve[ eqns12,Q1, { t,0,1}] --> NDSolve::"ndode" : "Input is not an ordinary differential equation. More... Jean-Marc