Why doesn't Mathematica solve this simple differential equation?
- To: mathgroup at smc.vnet.net
- Subject: [mg69235] Why doesn't Mathematica solve this simple differential equation?
- From: Joseph Gwinn <JoeGwinn at comcast.net>
- Date: Sun, 3 Sep 2006 01:39:37 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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}] Approach 2: eqns21 = {Vc'[t] == -Id[t]/C1, Vc[t] == 0.026*Log[Id[t]/Is] + R1*Id[t], Vc[0] == 4.0} eqns22 = eqns11 /. {C1 -> 1.0*10^-6, R1 -> 16, Is -> 10^-13} eqns22soln = NDSolve[eqns22, Vc, {t, 0, 1}] Both approaches fail with Mathematica complaining that "NDSolve::ndode: Input is not an ordinary differential equation". Another, simpler, problem (same circuit but without the R1) solves happily, so long as I eliminate all intermediate variables manually. eqns1 = {Vd'[t] == -Is*Exp[Vd[t]/0.026]/C, Vd[0] == 4.0} eqns2 = eqns1 /. {C -> 1.0*10^-6, Is -> 10^-13} eqns2soln = NDSolve[eqns2, Vd, {t, 0, 1}] Any ideas? Joe Gwinn