Try manipulating from there, adding in c as a function of v. I suspect you inserted too many artificial restraints.
...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
America: Land of the Free, Because of the Brave
"Helmut Sennewald" wrote in news:g2ha0d$kg0$03$ snipped-for-privacy@news.t-online.com:
Actually it was an exercise from a book. After getting the suspicious results I tried to do what you suggest but I couldn't find a model for a nonlinear capacitor of the parameters I specified (or any nonlinear capacitor.)
If you can help me model the circuit in LTSpice I'd be grateful.
Don't dispute the MIT grad who found this stuff fascinating ;-)
...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
America: Land of the Free, Because of the Brave
In virtually _any_ flavor of Spice, terms can be added to the model card to make it have a first and second order temperature sensitivity, and a first and second order voltage sensitivity.
If your version of Spice supports behavioral modeling you can have almost any kind of non-linear behavior.
...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
America: Land of the Free, Because of the Brave
Copied from LTspice help file for component capacitor:
(begin excerpt)
There is also a general nonlinear capacitor available. Instead of specifying the capacitance, one writes an expression for the charge.
LTspice will compile this expression and symbolically differentiate it with respect to all the variables, finding the partial derivative's that correspond to capacitances.
Syntax: Cnnn n1 n2 Q= [ic=] [m=]
There is a special variable, x, that means the voltage across the device. Therefore, a 100pF constant capacitance can be written as
Cnnn n1 n2 Q=100p*x
A capacitance with an abrupt change from 100p to 300p at zero volts can be written as
The Euler method and its relatives (such as the Milne predictor-corrector) have real trouble with decaying exponential-ish things like this. The problem is that the difference scheme has an extraneous solution (the oscillating one) that dominates the decaying exponential.
You need a better solver--a simple one that works OK for this is the classical fourth-order Runge-Kutta scheme, or with a bit more work you can code up the Adams-Bashforth-Moulton predictor-corrector (my personal fave). You can look them up on the web, or find them in most elementary numerical analysis books.
After all that extra crap you have to simulate this?
First, you don't have to go past q = 3 * v^3, and dq/dt = -v/0.2 ohms. This gives you your dv/dt = -(5/9)(1/v).
Then, you have an ordinary separable differential equation, and you don't have to simulate it. A few minutes of quality time with a
2nd-year differential equations book (you did save yours, didn't you?) gets you
v^2 = -(10/9 V^2/sec)t + C, with C = 1V^2.
So v = sqrt(1V^2 - (10/9 V^2/sec)t)
Couldn't be easier.
You can do a similar exercise using q as the state variable. I didn't, because solving one first-order nonlinear problem keeps the really nerdy part of me happy for about a year, so unless I'm getting paid for it I don't do more than that.
I suspect that you are running into trouble with your simulation because with v being a perfect square root of time, your effective gain is going to infinity as the charge goes to zero. Modifying your model to a more easily calculated
q = (some constant)*v + (some other constant)*v^3
would alleviate your simulation problems, and would probably be more realistic, too, in that you'd model the inevitable capacitance formed by the end conductors and whatever space is between them.
(note that you didn't have to solve the whole differential equation to see the infinite gain; it's buried in your dq/dt = -(something)*q^(1/3), which goes to infinity as q goes to zero).
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. (%i1) 'diff(v,t) = -5/(9*v); dv 5 (%o1) -- = - --- dt 9 v (%i2) ode2(%,v,t); 2 9 v (%o2) - ---- = t + %c 10 (%i3)
That's easier ;-)
Tim.
--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.
http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
My sweat shirt says, "And God said, 'Let there be light'..."
Then the div/curl expressions.
...Jim Thompson
-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at
formatting link
| 1962 | America: Land of the Free, Because of the Brave
. .----------. v= i x R . | ^ | . | | | d 3 . | | | and i= - -- (3 x v ) . --- / dt . C --- v \\ R . | / 2 dv . | | \\ so v = -9 x R x v x -- . | | | dt . | | | . '----------. . or dt= -9 x R x v x dv . . . . t v(t) . / / . from which | dt = | -9 x R x v x dv . / / . 0 v(0) . . . -------------- . 9 2 | 2 . or t = - - x R x (v - 1) from which v = | 1 - ----- x t . 2 \\| 9 x R . .
Only if you already have Maxima (or some commercial variant) loaded.
Besides, every once in a while you need to do it by hand, just to remind your self that it _can_ be done.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
Fred Bloggs wrote in news: snipped-for-privacy@nospam.com:
Thanks. But there's something unusual going on; the capacitor is discharging completely. A linear capacitor, as we know, never discharges completely.
Also, for values of t over a certain threshold the formula is undefined.
Let's assume that the capacitor will discharge completely as the formula suggests. Surely the time t will continue (time will not stop!) but the formula doesn't actually give v=0 for any t after the discharging, it's simply undefined.
Why? Is there some other non-obvious solution to the DE?
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.