Re: Why doesn't Mathematica solve this simple differential equation?
- To: mathgroup at smc.vnet.net
- Subject: [mg69294] Re: Why doesn't Mathematica solve this simple differential equation?
- From: Joseph Gwinn <JoeGwinn at comcast.net>
- Date: Tue, 5 Sep 2006 05:31:14 -0400 (EDT)
- Organization: Gwinn Instruments
- References: <eddqq8$3vq$1@smc.vnet.net> <edg8jf$ghs$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <edg8jf$ghs$1 at smc.vnet.net>, Peter Pein <petsie at dordos.net> wrote: > Joseph Gwinn schrieb: > > 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}] > > > > You want to solve for Q1. Unless there is an dependency in a previous > definition of Iloop between Q1 and the voltages, the relevant equations > remaining are: > Q1'[t] == -Iloop[t] and Q1[t] == C1*Vc[t] > with unknown(?) Iloop. Obviously this can not be solved. So, it's underdetermined. > > 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}] > > The same happens here more functions (all undefined?) than equations. When I fixed the above system (to say eqns22=eqns21...), that's the complaint I now get. Anyway, I'll focus on that. Thanks, Joe > > 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}] > > > > One function, one equation - Mathematica is happy > > > > > Any ideas? > > > > Joe Gwinn > > > > consider this example, where elimination is trivial: > > In[4]:= > DSolve[{f'[x] == g[x] - f[x], g[x] == Sin[x]}, f[x], x] > From In[4]:= > "DSolve::deqx: Supplied equations are not differential equations of the > given functions." > Out[4]= > DSolve[{f'[x] == g[x] - f[x], g[x] == Sin[x]}, f[x], x] > > and > > In[5]:= > DSolve[ > Eliminate[{f'[x] == g[x] - f[x], g[x] == Sin[x]}, g[x]], > f, x] > > solves the deq. > > HTH > Peter