Sci.Electronics.Basics

on Electronics-Related.com

  Home  |  Books  |  Sci.Electronics.Design  |  Sci.Electronics.Basics  |  Resources  |  Contact  | 
Sign in
username:

password:

Remember Me

Not a member?
Search Sci.Electronics.Basics

Search Tips

Sci.Electronics.Basics -> Simulation of a nonlinear capacitor

There are 32 messages in this thread.
You are currently looking at messages 1 to 20.






Author: sert
Date: 14:21 08-06-08


Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
characteristic of the capacitor is given by the formula

q=3*(v^3)

Let's also assume that it's charged to 1V and then connected to
a 0.2 Ohm linear ohmic resistance to discharge.

I tried to write the equations for this simple circuit and then
simulate the behaviour by approximating through the forward
Euler method.

My results are horrendous. First let's see the equations I used:

Using v as the state variable:

dv/dt = -0.556/v

Using q as the state variable:

dq/dt = -3.467*(q^.333), if q>0
dq/dt = 3.467*[(-q)^.333], if q<0

After simulating the circuit I get an oscillating behaviour with
the capacitor never discharging. What did I do wrong? Can
someone make a better analysis of the circuit in question?

Author: Jim Thompson
Date: 14:49 08-06-08

On Sun, 8 Jun 2008 18:21:45 +0000 (UTC), sert <jerry@hotmail.com>
wrote:

>Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
>characteristic of the capacitor is given by the formula
>
>q=3*(v^3)
>
>Let's also assume that it's charged to 1V and then connected to
>a 0.2 Ohm linear ohmic resistance to discharge.
>
>I tried to write the equations for this simple circuit and then
>simulate the behaviour by approximating through the forward
>Euler method.
>
>My results are horrendous. First let's see the equations I used:
>
>Using v as the state variable:
>
>dv/dt = -0.556/v
>
>Using q as the state variable:
>
>dq/dt = -3.467*(q^.333), if q>0
>dq/dt = 3.467*[(-q)^.333], if q<0
>
>After simulating the circuit I get an oscillating behaviour with
>the capacitor never discharging. What did I do wrong? Can
>someone make a better analysis of the circuit in question?

Too many twists and turns.

Fundamentals...

i = d/dt(c•v) =>

i = c•dv/dt + v•dc/dt

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

Author: Helmut Sennewald
Date: 14:56 08-06-08

"sert" <jerry@hotmail.com> schrieb im Newsbeitrag
news:Xns9AB7D951B938Djtjdfjdfjnbj@147.102.222.230... /> > Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
> characteristic of the capacitor is given by the formula
>
> q=3*(v^3)
>
> Let's also assume that it's charged to 1V and then connected to
> a 0.2 Ohm linear ohmic resistance to discharge.
>
> I tried to write the equations for this simple circuit and then
> simulate the behaviour by approximating through the forward
> Euler method.
>
> My results are horrendous. First let's see the equations I used:
>
> Using v as the state variable:
>
> dv/dt = -0.556/v
>
> Using q as the state variable:
>
> dq/dt = -3.467*(q^.333), if q>0
> dq/dt = 3.467*[(-q)^.333], if q<0
>
> After simulating the circuit I get an oscillating behaviour with
> the capacitor never discharging. What did I do wrong? Can
> someone make a better analysis of the circuit in question?


Hello,

You can have drawn the circuit and the result plotted
in 5 minutes with LTspice.
Is it required that you write your own program?

Best regards,
Helmut



Author: John Larkin
Date: 15:18 08-06-08

On Sun, 8 Jun 2008 20:56:16 +0200, "Helmut Sennewald"
<helmutsennewald@t-online.de> wrote:

>"sert" <jerry@hotmail.com> schrieb im Newsbeitrag
>news:Xns9AB7D951B938Djtjdfjdfjnbj@147.102.222.230... /> >> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
>> characteristic of the capacitor is given by the formula
>>
>> q=3*(v^3)
>>
>> Let's also assume that it's charged to 1V and then connected to
>> a 0.2 Ohm linear ohmic resistance to discharge.
>>
>> I tried to write the equations for this simple circuit and then
>> simulate the behaviour by approximating through the forward
>> Euler method.
>>
>> My results are horrendous. First let's see the equations I used:
>>
>> Using v as the state variable:
>>
>> dv/dt = -0.556/v
>>
>> Using q as the state variable:
>>
>> dq/dt = -3.467*(q^.333), if q>0
>> dq/dt = 3.467*[(-q)^.333], if q<0
>>
>> After simulating the circuit I get an oscillating behaviour with
>> the capacitor never discharging. What did I do wrong? Can
>> someone make a better analysis of the circuit in question?
>
>
>Hello,
>
>You can have drawn the circuit and the result plotted
>in 5 minutes with LTspice.
>Is it required that you write your own program?
>
>Best regards,
>Helmut
>

How do you set up the nonlinear capacitor in LT Spice?

John


Author: sert
Date: 15:19 08-06-08

"Helmut Sennewald" <helmutsennewald@t-online.de> wrote in
news:g2ha0d$kg0$03$1@news.t-online.com:

> You can have drawn the circuit and the result plotted
> in 5 minutes with LTspice.
> Is it required that you write your own program?
>

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.

Author: Eeyore
Date: 15:30 08-06-08



sert wrote:

> Let's assume a nonlinear capacitor

Why ? Are you trying to prove EEStor is a fraud ?

I doubt you'd need too much evidence to prove that. The behaviour of
hi-K ceramic dielectrics is very well understood.

Graham


Author: sert
Date: 15:40 08-06-08

Jim Thompson <To-Email-Use-The-Envelope-Icon@My-Web-Site.com>
wrote in news:85ao441vohrgf00boagq6lclq2ih99degm@4ax.com:

> Too many twists and turns.
>
> Fundamentals...
>
> i = d/dt(c*v) =>
>
> i = c*dv/dt + v*dc/dt
>
> Try manipulating from there, adding in c as a function of
> v. I suspect you inserted too many artificial restraints.
>

(Your post came up a bit garbled so I have it fixed above.)

I believe what you wrote is wrong, it is simply:

i = c*dv/dt

That equation is in the book, too.

Author: Jim Thompson
Date: 15:52 08-06-08

On Sun, 8 Jun 2008 19:40:46 +0000 (UTC), sert <jerry@hotmail.com>
wrote:

>Jim Thompson <To-Email-Use-The-Envelope-Icon@My-Web-Site.com>
>wrote in news:85ao441vohrgf00boagq6lclq2ih99degm@4ax.com:
>
>> Too many twists and turns.
>>
>> Fundamentals...
>>
>> i = d/dt(c*v) =>
>>
>> i = c*dv/dt + v*dc/dt
>>
>> Try manipulating from there, adding in c as a function of
>> v. I suspect you inserted too many artificial restraints.
>>
>
>(Your post came up a bit garbled so I have it fixed above.)
>
>I believe what you wrote is wrong, it is simply:
>
>i = c*dv/dt
>
>That equation is in the book, too.

Nope! The general equation is... i = d/dt(C*v)

Likewise for inductors it's... v = d/dt(L*i)

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

Author: Jim Thompson
Date: 15:55 08-06-08

On Sun, 8 Jun 2008 19:19:54 +0000 (UTC), sert <jerry@hotmail.com>
wrote:

>"Helmut Sennewald" <helmutsennewald@t-online.de> wrote in
>news:g2ha0d$kg0$03$1@news.t-online.com:
>
>> You can have drawn the circuit and the result plotted
>> in 5 minutes with LTspice.
>> Is it required that you write your own program?
>>
>
>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.

Look up device "C"

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

Author: John Popelish
Date: 15:56 08-06-08

John Larkin wrote:

> How do you set up the nonlinear capacitor in LT Spice?

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=<expression> [ic=<value>] [m=<value>]

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

Cnnn n1 n2 Q=x*if(x<0,100p,300p)

This device is useful for rapidly evaluating the behavior of
a new a hypothetical charge model for, e.g., a transistor.

(end excerpt)


--
Regards,

John Popelish

Author: Phil Hobbs
Date: 16:07 08-06-08

sert wrote:
> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
> characteristic of the capacitor is given by the formula
>
> q=3*(v^3)
>
> Let's also assume that it's charged to 1V and then connected to
> a 0.2 Ohm linear ohmic resistance to discharge.
>
> I tried to write the equations for this simple circuit and then
> simulate the behaviour by approximating through the forward
> Euler method.
>
> My results are horrendous. First let's see the equations I used:
>
> Using v as the state variable:
>
> dv/dt = -0.556/v
>
> Using q as the state variable:
>
> dq/dt = -3.467*(q^.333), if q>0
> dq/dt = 3.467*[(-q)^.333], if q<0
>
> After simulating the circuit I get an oscillating behaviour with
> the capacitor never discharging. What did I do wrong? Can
> someone make a better analysis of the circuit in question?

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.

Cheers,

Phil Hobbs

Author: Tim Wescott
Date: 16:27 08-06-08

sert wrote:
> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
> characteristic of the capacitor is given by the formula
>
> q=3*(v^3)
>
> Let's also assume that it's charged to 1V and then connected to
> a 0.2 Ohm linear ohmic resistance to discharge.
>
> I tried to write the equations for this simple circuit and then
> simulate the behaviour by approximating through the forward
> Euler method.
>
> My results are horrendous. First let's see the equations I used:
>
> Using v as the state variable:
>
> dv/dt = -0.556/v
>
> Using q as the state variable:
>
> dq/dt = -3.467*(q^.333), if q>0
> dq/dt = 3.467*[(-q)^.333], if q<0
>
> After simulating the circuit I get an oscillating behaviour with
> the capacitor never discharging. What did I do wrong? Can
> someone make a better analysis of the circuit in question?

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

Author: Helmut Sennewald
Date: 16:27 08-06-08

"sert" <jerry@hotmail.com> schrieb im Newsbeitrag
news:Xns9AB7E32E8D917jtjdfjdfjnbj@147.102.222.230... /> > "Helmut Sennewald" <helmutsennewald@t-online.de> wrote in
> news:g2ha0d$kg0$03$1@news.t-online.com:
>
>> You can have drawn the circuit and the result plotted
>> in 5 minutes with LTspice.
>> Is it required that you write your own program?
>>
>
> 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.

Hello,

Save the text below into a file named test.asc .
Open it with LTspice and press RUN.

It's using the charge equation (x=voltage)

q=3*x*x*x

This is a capacitor with the voltage dependent
capcitance of

C = dq/dv = 9*x*x

Best regards,
Helmut


Version 4
SHEET 1 880 680
WIRE 96 48 16 48
WIRE 192 48 96 48
WIRE 192 80 192 48
WIRE 16 96 16 48
WIRE 16 192 16 160
WIRE 192 192 192 160
FLAG 16 192 0
FLAG 192 192 0
FLAG 96 48 vc
SYMBOL cap 0 96 R0
SYMATTR InstName C1
SYMATTR Value q=3*x*x*x
SYMBOL res 176 64 R0
SYMATTR InstName R1
SYMATTR Value 0.2
TEXT 16 -8 Left 0 !..ic V(vc)=1
TEXT 16 -40 Left 0 !.tran 0 1 0 1m



Author: Tim Woodall
Date: 17:07 08-06-08

On Sun, 08 Jun 2008 13:27:35 -0700,
Tim Wescott <tim@seemywebsite.com> wrote:
> sert wrote:
>> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
>> characteristic of the capacitor is given by the formula
>>
>> q=3*(v^3)
>>
>> Let's also assume that it's charged to 1V and then connected to
>> a 0.2 Ohm linear ohmic resistance to discharge.
>>
>> I tried to write the equations for this simple circuit and then
>> simulate the behaviour by approximating through the forward
>> Euler method.
>>
>> My results are horrendous. First let's see the equations I used:
>>
>> Using v as the state variable:
>>
>> dv/dt = -0.556/v
>>
>> Using q as the state variable:
>>
>> dq/dt = -3.467*(q^.333), if q>0
>> dq/dt = 3.467*[(-q)^.333], if q<0
>>
>> After simulating the circuit I get an oscillating behaviour with
>> the capacitor never discharging. What did I do wrong? Can
>> someone make a better analysis of the circuit in question?
>
> 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.
>
tim@feynman:~$ maxima

Maxima 5.10.0 http://maxima.sourceforge.net
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/

Author: Jim Thompson
Date: 18:39 08-06-08

On Sun, 8 Jun 2008 21:07:33 +0000 (UTC), Tim Woodall
<devnull@woodall.me.uk> wrote:

>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 http://www.analog-innovations.com | 1962 |

America: Land of the Free, Because of the Brave

Author: Fred Bloggs
Date: 18:41 08-06-08


> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
> characteristic of the capacitor is given by the formula
>
> q=3*(v^3)
>
> Let's also assume that it's charged to 1V and then connected to
> a 0.2 Ohm linear ohmic resistance to discharge.
>
> I tried to write the equations for this simple circuit and then
> simulate the behaviour by approximating through the forward
> Euler method.
>
> My results are horrendous. First let's see the equations I used:
>
> Using v as the state variable:
>
> dv/dt = -0.556/v
>
> Using q as the state variable:
>
> dq/dt = -3.467*(q^.333), if q>0
> dq/dt = 3.467*[(-q)^.333], if q<0
>
> After simulating the circuit I get an oscillating behaviour with
> the capacitor never discharging. What did I do wrong? Can
> someone make a better analysis of the circuit in question?

View in a fixed-width font such as Courier.


.
.
.
.
. i
. ->
. .----------. 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
.
.


Author: Tim Wescott
Date: 19:50 08-06-08

Tim Woodall wrote:
> On Sun, 08 Jun 2008 13:27:35 -0700,
> Tim Wescott <tim@seemywebsite.com> wrote:
>> sert wrote:
>>> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
>>> characteristic of the capacitor is given by the formula
>>>
>>> q=3*(v^3)
>>>
>>> Let's also assume that it's charged to 1V and then connected to
>>> a 0.2 Ohm linear ohmic resistance to discharge.
>>>
>>> I tried to write the equations for this simple circuit and then
>>> simulate the behaviour by approximating through the forward
>>> Euler method.
>>>
>>> My results are horrendous. First let's see the equations I used:
>>>
>>> Using v as the state variable:
>>>
>>> dv/dt = -0.556/v
>>>
>>> Using q as the state variable:
>>>
>>> dq/dt = -3.467*(q^.333), if q>0
>>> dq/dt = 3.467*[(-q)^.333], if q<0
>>>
>>> After simulating the circuit I get an oscillating behaviour with
>>> the capacitor never discharging. What did I do wrong? Can
>>> someone make a better analysis of the circuit in question?
>> 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.
>>
> tim@feynman:~$ maxima
>
> Maxima 5.10.0 http://maxima.sourceforge.net
> 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.
>
>
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

Author: google@woodall.me.uk
Date: 07:50 09-06-08

On Jun 9, 12:50 am, Tim Wescott <t...@seemywebsite.com> wrote:
> 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.
>
True, but you have to also use maxima occasionally or you forget how
to drive it. I started with:

(%i1) 'diff(v(t),t) = -1/(9*R*v(t));
d 1
(%o1) -- (v(t)) = - ------
dt 9 v(t) R
(%i2) desolve(%,v(t));
1
9 v(0) R - laplace(----, t, lvar)
v(t)
(%o2) v(t) = ilt(---------------------------------, lvar, t)
9 lvar R


"That CAN'T be right, I think there should be a square root in there
somewhere ... well it can be but I don't think it's what the OP was
expecting."

Goes and looks in manual. "Oh, of course, it's ode2 for ordinary
differential equations"

Tim.

Author: Helmut Sennewald
Date: 13:41 09-06-08

"Fred Bloggs" <nospam@nospam.com> schrieb im Newsbeitrag
news:484C6008.5070809@nospam.com...
>
>> Let's assume a nonlinear capacitor with c(v)=dq/dv. The q-v
>> characteristic of the capacitor is given by the formula q=3*(v^3)
>>
>> Let's also assume that it's charged to 1V and then connected to a 0.2 Ohm
>> linear ohmic resistance to discharge.
>>
>> I tried to write the equations for this simple circuit and then simulate
>> the behaviour by approximating through the forward Euler method.
>>
>> My results are horrendous. First let's see the equations I used:
>>
>> Using v as the state variable:
>>
>> dv/dt = -0.556/v
>>
>> Using q as the state variable:
>>
>> dq/dt = -3.467*(q^.333), if q>0
>> dq/dt = 3.467*[(-q)^.333], if q<0
>>
>> After simulating the circuit I get an oscillating behaviour with the
>> capacitor never discharging. What did I do wrong? Can someone make a
>> better analysis of the circuit in question?
>
> View in a fixed-width font such as Courier.
>
>
> .
> .
> .
> .
> . i
> . ->
> . .----------. 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
> .

Hello Fred,

Thanks for this calculation. It's perfect.
It's exactly the same curve which I see in LTspice.

Best regards,
Helmut



Author: sert
Date: 17:19 09-06-08

Fred Bloggs <nospam@nospam.com> wrote in
news:484C6008.5070809@nospam.com:

> View in a fixed-width font such as Courier.
> .
> --------------
> . 9 2 | 2
> . or t = - - x R x (v - 1) from which v = | 1 -
> ----- x t . 2
> \| 9 x R .
> .
>
>

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?

1 2


      Contact  |  Electronic Portal


Sci.Electronics.Basics by Keywords
ADC
Antenna
CAD
Coil
Generator
IDE
LCD
Modulator
MOSFET
NiMH
Opamp
Oscilloscope
PID
RS232
Telephone
Transformers
TTL
USB

Sci.Electronics.Basics By Author