# System of equations for modeling dynamic behavior of an electronic circuit with MOSFET

#### Current_Source

Joined Dec 10, 2015
16
Hello!

I am trying to extract a system of equations that describes the dynamic behavior of the following circuit: The model for the MOSFET is iGs=iDg=0 and iDS=gnl (Vg,Vd,Vs) in which a gnl is an unknown non-linear function.

I am going to use KCL to write the equations of the circuit.

I am not sure about the equations I have written and I having a little difficulty in writing the system of equations that model the circuit. Can anyone give me a help in just marking the currents and identifying the nodes of circuit i should consider?

By the way how many state variables has the circuit? I would say 3 which correspond to the voltage levels in the nodes V1,V2 and V3 but I am not sure... $$Equation Node V1: iC1 + iR1 + iR2-iM=0 C1*d((Vi/Rth))-V1)/(dt)+(Vdd)/(R1)+(0-V1)/R2-iM=0 Equation Node V2: iRD+iC2+iDS=0 (Vdd)/(Rd)+ C2*d((Vo/Rl))-V2)/(dt)+iDS=0 Equation Node V3: iRS+iCS=iDS -V3/Rs+ Cs*d(0))-V3)/(dt)=iDS$$

Are these equations correct? Are there anymores nodes i should have consider?

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hello there,

I have found that the simplest choice of state variables seems to be the voltage across a capacitor or the current through an inductor. That makes writing the equations simpler because then we can use the definition of the capacitor and inductor as the relationship between the current and the voltage in any of those elements.
For your input capacitor for example, you have labeled ic1 with an arrow to the right, so the voltage across the cap would appear as positive to the left of the cap and negative to the right of the cap. This immediately then gives us the relationship between current and voltage as:
dv/dt=i/C

and so with the voltage as the state variable x1 (or later X1), we have simply:
i=C*x1'

where x1' is used to represent a 'dotted' lower case x1.

BTW, it becomes more convenient to write the derivatives as lower case and the state variables as upper case:
i=C*x1

where x1 is the derivative of X1, and X1 is the voltage across the cap (note case here either x1 or X1).

So an equation might look very simply like this:
x1=E/RC+X1/RC

and you can see this is a little easier to write here and in other places on the web because we dont need that dot over the lower case x1.

If you'd like to do it this way we can go further with this. If you need it in another form (such as with the dots) you can always just add the dots back in later for your course work or whatever.

My question though would be have you done any simpler circuits before this one?
I ask because this contains a non linear function and three state variables, where a simpler problem might only have one state variable and no non linear functions, and that would get you started.

#### sailorjoe

Joined Jun 4, 2013
363
I like the approach that MrAl is suggesting. Recommend you pursue that.
As to your equations in the first post, I believe they need work. The first thing I noticed was in your equation for V1, second expanded form, the current through R1 should be (Vdd - V1)/R1. You're missing the -V1.
I did a cursory look over the others and they seem ok, but double check.
Eventually you'll need to replace Ids with the gnl function, of course.

#### Current_Source

Joined Dec 10, 2015
16
Hi!

I have done simplier circuits than this before but it was already many years ago and since electronics is not my one of my main focus area i am having a hard time writing the equations for this circuit.

My idea was to extract the equations that describe the dynamic behavior of the circuit and after write it in the form of DAEs(Differential
algebric equations) that is in form that looked like this:

p(y(t))+(d/dt)*q(y(t))=x(t)

where
• y(t) represents the vector containig, the 3 state variables of the circuit;
• x(t) represnts the vector containing the exciting sources of the circuit;
• p(y) corresponds to the algebric term that models the elements of the circuit "without memory" such as the resistors,etc...
• q(y) corresponds to the algebric term that models the elements of the circuit with memory" such as the capacitors, inductors,etc..

My idea was first to extract the equations that model the circuit, for example lets suppose that i had an circuit in which i had an inductor
and that the equation for the current in that inductor looked like this:

Vss-Va= L1 * d(iL1 )/dt (current in inductor L1)

My idea was to then transform the equation in something like this: Va+d/dt*(-L1*iL1)=Vss , which is the form i want that is [p(y(t))+(d/dt)*q(y(t))=x(t) ]

Then i would be able to model the circuit with the vectors p(t), q(t), x(t) and y(t) for this example the first element of this vetors would be

p(t)=[Va] q(t)=[-L1*iL1] x(t)=Vss y(t)=[iL1(t)]

So what is the best form to approach this circuit to do something like this?

Thanks for the help.

#### MrAl

Joined Jun 17, 2014
8,562
Hello again,

Since this is the homework section I'll offer a few suggestions and see what you can do from there.

First, you dont usually have to distinguish between energy storage elements and non energy storage elements in the final form, but if you have a specific reason for wanting to do that you can state that here.
The usual simpler state space form which represents a set of coupled ODE's looks like this:
x'=A*x+B*u
y=C*x+D*u

where x' is the derivative vector, x is the state vector, u is the input vector, and A,B,C,D are matrices that come from the circuit constants. From that you can probably convert into the form you want if that isnt good enough.

To get to this form you would analyze the circuit the way you do any circuit, after defining each capacitor and inductor with their defining equations:
dv/dt=i/C
di/dt=v/L

or in simpler form again and assuming you have both elements in the same circuit:
x1'=i/C=x1/C
x2'=v/L=x2/L

and in simpler yet upper case/lower case form we have:
x1=X1/C
x2=X2/L

Let's look at a simple RC low pass filter with input source voltage E and output voltage taken from across the capacitor. We will use upper case for the state variable and lower case for the derivative of the state variable so:
x1=d(X1)/dt

The voltage across the cap is X1, and so the current though the cap is C*x1. So we already have the expression for both the current and voltage for the cap. We also know that the voltage across a resistor divided by the resistance is the current (Ohm's Law of course), and since we know the input voltage is E and the cap voltage is X1 we know the current through the resistor is:
iR=(E-X1)/R

Since the current though the resistor is equal to the current through the capacitor, we can write:
iR=iC

and since iC=C*x1 we have:
iR=C*x1

and since iR=(E-X1)/R we have:
C*x1=(E-X1)/R

and expanding we have:
C*x1=E/R-X1/R

and dividing by C we have:
x1=E/RC-X1/RC

where RC is R*C.

So there we have it, and in actual state space form we would have:
x1=(-1/RC)*X1+(1/RC)*E
Y=x

which is now in the form:
x'=A*x+B*u
Y=x

except A and B are one element matrices now so they are simpler than when there are more state variables.

But anyway, in differential equation form the above would be:
dv/dt=(-1/RC)*v+(1/RC)*E

and so the solution can be found using regular methods for ODE's.

Now say we have a load on the circuit, another resistor, R2, across the cap. Now the current through R1 is not the same as the cap current, but we still know the cap current is iC=C*x1 so we have:
iR1=iC+iR2

which is:
iR1=C*x1+X1/R2

so you see how simple it was to calculate the current through R2, and so the entire expression comes out to:
(E-X1)/R1=C*x1+X1/R2

and we want x1 on the left and the rest on the right, so:
C*x1=E/R1-X1/R1-X1/R2

and dividing again by C we get:
x1=E/R1C-X1/R1C-X1/R2C

where R1C=R1*C and R2C=R2*C.

In state space form this would be:
x'=-(1/R1C+1/R2C)*x+(1/R1C)*E
Y=x

For a two capacitor circuit such as a second order low pass filter, we'd have state variables X1 and X2 as the voltage across each capacitor, and C1*x1 and C2*x2 as the currents through each capacitor respectively.

See if that helps.

Last edited:

#### Current_Source

Joined Dec 10, 2015
16
Hello again!

Yes i know it would probably be a lot simplier to represent the system using ODE's but i was asked to used DAE's in order to be able to have a final form in which i can distinguish between energy storage elements and non energy storage elements so that i can describe the system using the vectors p(t),q(t), x(t) and y(t) as i have said before.

I also don't know how i can convert the system to the form i wanted if i modeled the system using x'=A*x+B*u
y=C*x+D*u

And has i need to get the equations that describe the system in this form p(y(t))+(d/dt)*q(y(t))=x(t) i will just try to take the equations that describe the system in a normal form and them solve them in order to get the system in the form that i want:

So starting from the initial equation i had stated i get:

Equation Node V1

$$iC1+iR1+iR2-iM=0 C1*d(Vi-V1)/(dt)+(Vdd)/(R1)+(0-V1)/(R2)-iM=0 C1*d(Vi)/(dt)-C1*d(V1)/(dt)+(Vdd)/(R1)-(V1)/(R2)-iM=0$$

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

$$(Vdd)/(R1)-(V1)/(R2) + (d)/(dt)*(C1*Vi)+(d)/(dt)*(-C1*V1)=iM$$

Equation Node V2:

$$iRD+iC2+iDS=0 (Vdd)/(Rd)+(C2)*(d(Vo-V2)/dt)+iDS=0$$

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

$$(Vdd)/(Rd)+((d)/(dt)*(C2*Vo))-((d)/(dt)*(C2*V2))=-iDS (Vdd)/(Rd)+((d)/(dt)*(C2*Vo))+((d)/(dt)*(-C2*V2))=-iDS$$

Equation Node V3:

$$iRS+iCS-iDS=0 -(V3)/(Rs)+(Cs)*(d(0-V3)/dt)-iDS=0 -(V3)/(Rs)+((d)/(dt)*(-CS*V3))=iDS$$

Now i can describe the system using the vectors p(t),q(t),y(t) and x(t) as it was asked. So i got:

$$p(t)=[(Vdd)/(R1)-(V1)/(R2);(Vdd)/(Rd);-(V3)/(Rs)] q(t)=[(C1*Vi-C1*V1;C2*Vo-C2*V2;-CS*V3] x(t)=[iM;-iDS;iDS] y(t)=[Vi(t)-V1(t);Vo(t)-V2(t);V3(t)]$$

Is this correct?

Thanks[/plain]

Last edited:

#### PsySc0rpi0n

Joined Mar 4, 2014
1,555
Hi guys... Just to make a suggestion!

I was reading the thread, just for curiosity, and the equations, to be properly rendered, you need to use the adequate tags, as '\frac{}{}', '\left ( \right )' and so on...

Check this to know more about LaTex language and use it as leverage to make your equations more user-friendly to read! You'll increase the chance of more people to read the equations until the end...

#### Current_Source

Joined Dec 10, 2015
16
Hello!

Could someone checked if my equations are correct?

Equation Node V1

$$iC1+iR1+iR2-iM=0 C1*d(Vi-V1)/(dt)+(Vdd)/(R1)+(0-V1)/(R2)-iM=0 C1*d(Vi)/(dt)-C1*d(V1)/(dt)+(Vdd)/(R1)-(V1)/(R2)-iM=0$$

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

$$(Vdd)/(R1)-(V1)/(R2) + (d)/(dt)*(C1*Vi)+(d)/(dt)*(-C1*V1)=iM$$

Equation Node V2:

$$iRD+iC2+iDS=0 (Vdd)/(Rd)+(C2)*(d(Vo-V2)/dt)+iDS=0$$

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

$$(Vdd)/(Rd)+((d)/(dt)*(C2*Vo))-((d)/(dt)*(C2*V2))=-iDS (Vdd)/(Rd)+((d)/(dt)*(C2*Vo))+((d)/(dt)*(-C2*V2))=-iDS$$

Equation Node V3:

$$iRS+iCS-iDS=0 -(V3)/(Rs)+(Cs)*(d(0-V3)/dt)-iDS=0 -(V3)/(Rs)+((d)/(dt)*(-CS*V3))=iDS$$

Now i can describe the system using the vectors p(t),q(t),y(t) and x(t) as it was asked. So i got:

$$p(t)=[(Vdd)/(R1)-(V1)/(R2);(Vdd)/(Rd);-(V3)/(Rs)] q(t)=[(C1*Vi-C1*V1;C2*Vo-C2*V2;-CS*V3] x(t)=[iM;-iDS;iDS] y(t)=[Vi(t)-V1(t);Vo(t)-V2(t);V3(t)]$$

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hello again,

Sorry to say it looks like you made a basic mistake, although you got pretty close this time.

Looking at your first two written equations, the first one:
iC1+iR1+iR2-iM=0

and the second one:
C1*d(Vi-V1)/(dt)+(Vdd)/(R1)+(0-V1)/(R2)-iM=0

it looks like you are equating:
iC1=C1*d(Vi-V1)/dt

but the defining equation for current through a capacitor is:
iC=C*dv/dt

and showing the two terminals of the capacitor as subscripts we can write:
iC=C*dv12/dt

where dv12 means the voltage from the capacitor terminal 1 to the terminal 2, which of course are just the two leads of the capacitor. But it is important to realize that dv12 is the voltage DIRECTLY across the capacitor, not the voltage between one lead and some other foreign place in the circuit. it must be the voltage directly across the capacitor.

Writing iC=C*d(Vi-V1)/dt means the voltage across BOTH the cap and the input resistor, so that is not the same thing.

So to properly write the expression for iC1 you would have to note the voltage at the node directly to the left of the cap, which does not include the resistor. If we call this voltage node Va, then the expression becomes:
iC1=d(Va-V1)/dt

where Va is an unknown voltage for now.

Try that and see what you get. You can restrict your reply to just the first cap expression if you like that way you dont have to write everything out right away until we get this part completed.

#### Current_Source

Joined Dec 10, 2015
16
Hello again,

Sorry to say it looks like you made a basic mistake, although you got pretty close this time.

Looking at your first two written equations, the first one:
iC1+iR1+iR2-iM=0

and the second one:
C1*d(Vi-V1)/(dt)+(Vdd)/(R1)+(0-V1)/(R2)-iM=0

it looks like you are equating:
iC1=C1*d(Vi-V1)/dt

but the defining equation for current through a capacitor is:
iC=C*dv/dt

and showing the two terminals of the capacitor as subscripts we can write:
iC=C*dv12/dt

where dv12 means the voltage from the capacitor terminal 1 to the terminal 2, which of course are just the two leads of the capacitor. But it is important to realize that dv12 is the voltage DIRECTLY across the capacitor, not the voltage between one lead and some other foreign place in the circuit. it must be the voltage directly across the capacitor.

Writing iC=C*d(Vi-V1)/dt means the voltage across BOTH the cap and the input resistor, so that is not the same thing.

So to properly write the expression for iC1 you would have to note the voltage at the node directly to the left of the cap, which does not include the resistor. If we call this voltage node Va, then the expression becomes:
iC1=d(Va-V1)/dt

where Va is an unknown voltage for now.

Try that and see what you get. You can restrict your reply to just the first cap expression if you like that way you dont have to write everything out right away until we get this part completed.

Hi!

Ok i understand as we have a voltage drop across Rth the voltage level in the terminal 1 of the capacitor won't be Vi but Vi minus the voltage
drop in Rth so i should have one considered one more voltage level (Va) to the left of the capacitor rigth?

Considering what you have said "iC1=d(Va-V1)/dt"

I got for Equation 1:

iC1+iR1+iR2-iM=0

C1*d(Va-V1)/(dt)+((Vdd-V1)/(R1))+(0-V1)/(R2)-iM=0

C1*d(Va)/(dt)-C1*d(V1)/(dt)+(Vdd-V1)/(R1)-(V1)/(R2)-iM=0

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

(Vdd-V1)/(R1)-(V1)/(R2) + (d)/(dt)*(C1*Va)+(d)/(dt)*(-C1*V1)=iM

Is Equation 1 rigth now?

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hi again,

It looks like you got the original equation right, but are you sure you have the right form in the end?

To repeat part of one of your posts:

p(y(t))+(d/dt)*q(y(t))=x(t)
where
• y(t) represents the vector containing, the N state variables of the circuit;
• x(t) represents the vector containing the exciting sources of the circuit;
• p(y) corresponds to the algebraic term that models the elements of the circuit "without memory" such as the resistors,etc...
• q(y) corresponds to the algebraic term that models the elements of the circuit with memory" such as the capacitors, inductors,etc..

My question then is does "iM" look like it represents the exciting sources of the circuit?
Also, do you have a textbook example of your required output form available, even with just one variable?

#### Current_Source

Joined Dec 10, 2015
16
Hi again,

It looks like you got the original equation right, but are you sure you have the right form in the end?

To repeat part of one of your posts:

p(y(t))+(d/dt)*q(y(t))=x(t)
where
• y(t) represents the vector containing, the N state variables of the circuit;
• x(t) represents the vector containing the exciting sources of the circuit;
• p(y) corresponds to the algebraic term that models the elements of the circuit "without memory" such as the resistors,etc...
• q(y) corresponds to the algebraic term that models the elements of the circuit with memory" such as the capacitors, inductors,etc..

My question then is does "iM" look like it represents the exciting sources of the circuit?
Also, do you have a textbook example of your required output form available, even with just one variable?
Hello!

No i am not sure about the form i got in the end, since i should only have one ter in the form (d/dt)*q(y(t)), so i don't think my form is correct.

I have attached an example of a non linear circuit with two variables is(t) and vo(t).

In the attachments i have the figure of the circuit, the equations that result from the nodal analysis of the circuit and then the equations i  n the DAEs form.

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hi,

Ok, but just to note, the excitation is usually the input terms, like with E or whatever is driving the circuit.
I'll look at your notes too.

LATER:
Ok, took a quick look and i see right away that they put is(t) into the x(t) vector. is(t) is obviously in the input vector because that is the excitation.

The question now is would you have to solve for what we previously called "Va" or are you allowed to use that as a variable? In a proper state space form you'd naturally solve for that first, which could involve some network equations and possibly define some constants to keep the final form simple and easy to write out, for example like:
C*dx/dt=A*x+B*u

instead of several resistors for A and B so A might be for example:
A=(R1+R2)/(R1*R2+R1*R3+R2*R3)

for some circuit, and we dont want to have to write all that out in the final equation:
C*dx/dt=(R1+R2)/(R1*R2+R1*R3+R2*R3)*x+R2/R3*u

Just a suggestion though.

Last edited:

#### Current_Source

Joined Dec 10, 2015
16
Hi,

Ok, but just to note, the excitation is usually the input terms, like with E or whatever is driving the circuit.
I'll look at your notes too.

LATER:
Ok, took a quick look and i see right away that they put is(t) into the x(t) vector. is(t) is obviously in the input vector because that is the excitation.

The question now is would you have to solve for what we previously called "Va" or are you allowed to use that as a variable? In a proper state space form you'd naturally solve for that first, which could involve some network equations and possibly define some constants to keep the final form simple and easy to write out, for example like:
C*dx/dt=A*x+B*u

instead of several resistors for A and B so A might be for example:
A=(R1+R2)/(R1*R2+R1*R3+R2*R3)

for some circuit, and we dont want to have to write all that out in the final equation:
C*dx/dt=(R1+R2)/(R1*R2+R1*R3+R2*R3)*x+R2/R3*u

Just a suggestion though.
Hi!

iM is the current in the Gate of the MOSFET, should not it be considered as an exciting source of the circuit? And how about the currents in the source and drain of the MOSFET should they be considered as exciting sources?

No i don't think i can use Va as a variable, so i would have to find a way of expressing Va in terms of other variables that i can use in my final model such as Vi in this case (Va=Vi-(Vi)/(Rth))

I got for Equation 1:

iC1+iR1+iR2-iM=0

C1*d((Vi-(Vi)/(Rth))-V1)/(dt)+((Vdd-V1)/(R1))+(0-V1)/(R2)-iM=0

C1*d((Vi-(Vi)/(Rth)))/(dt)-C1*d(V1)/(dt)+(Vdd-V1)/(R1)-(V1)/(R2)-iM=0

Now transforming the above equation into the form p(y(t))+(d/dt)*q(y(t))=x(t) we get:

(Vdd-V1)/(R1)-(V1)/(R2) + (d)/(dt)*(C1*(Vi-(Vi)/(Rth))+(d)/(dt)*(-C1*V1)=iM

Can i use this equation to describe the system?

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hi,

I dont believe that is correct if you consider iM as an exciting source, and i dont see why you would anyway. Exciting sources are REAL physical sources such as batteries, volt sources, current sources (real physical ones not just a random branch current).

I could show you more examples but it's so easy. For example if i have a battery of 5v and resistor of 5 ohms the exciting source is the 5v battery and would NOT be the current through the resistor. You may be able to do a trick to make it look like the current is a source because of such as simple circuit, but that's not the usual way of doing it anyway. The usual way is just to include the real life sources as the excitation group. This could be one or more sources, such as Vin and Vdd where Vin is the input signal and Vdd is a power supply voltage.
In state space form this is the 'u' vector. In your required form it appears to be the 'x' vector.

Another example is a resistor and capacitor in parallel to a current source, a REAL current source that is. In this case the exciting source is the real current source, and NOT the voltage that appears across the R and C later.
Another way of putting it is that the exciting sources all supply energy, and that energy comes from some external physical device that is not simply a 'response' somewhere in the circuit itself.
A 'response' is something that results when the energy comes into the circuit from the exciting source.

Another example would be if we had a couple resistors and capacitors, say a second order low pass filter. The excitation would be the input signal, which comes from something connected to the input of the circuit that is assumed to be an independent source such as a battery or frequency generator.
However, if we connect another low pass filter ahead of this first one then the excitation is the voltage source at the input of the second low pass filter.

A rough graphical illustration:
Vin o---LPF1---o Vout

Vin here is the exciting source, but if we put LPF2 in front of that one we would have:
Vin o---LPF2---+---LPF1---o Vout

Now the output of the LPF2 is not the exciting source of the circuit (like for LPF1) but Vin still is.
In the math forms that result, you'd see resistors and capacitors and inductors making up the other parts of the expression, while the exciting sources would appear in the input (exciting) part.

You might also note that is(t) in the example you posted is an actual current source.
The only exception would be if the source came from a previous stage that was being considered as 'external' to the main circuit under consideration. Then it could be called a source which could be called an excitation, but it would have to be defined with whatever it needed and part of that could end up in the non-excitation part of the expression simply because it contains some non-exciting circuit elements such as resistors and capacitors.

• Current_Source

#### Current_Source

Joined Dec 10, 2015
16
Hi,

I dont believe that is correct if you consider iM as an exciting source, and i dont see why you would anyway. Exciting sources are REAL physical sources such as batteries, volt sources, current sources (real physical ones not just a random branch current).

I could show you more examples but it's so easy. For example if i have a battery of 5v and resistor of 5 ohms the exciting source is the 5v battery and would NOT be the current through the resistor. You may be able to do a trick to make it look like the current is a source because of such as simple circuit, but that's not the usual way of doing it anyway. The usual way is just to include the real life sources as the excitation group. This could be one or more sources, such as Vin and Vdd where Vin is the input signal and Vdd is a power supply voltage.
In state space form this is the 'u' vector. In your required form it appears to be the 'x' vector.

Another example is a resistor and capacitor in parallel to a current source, a REAL current source that is. In this case the exciting source is the real current source, and NOT the voltage that appears across the R and C later.
Another way of putting it is that the exciting sources all supply energy, and that energy comes from some external physical device that is not simply a 'response' somewhere in the circuit itself.
A 'response' is something that results when the energy comes into the circuit from the exciting source.

Another example would be if we had a couple resistors and capacitors, say a second order low pass filter. The excitation would be the input signal, which comes from something connected to the input of the circuit that is assumed to be an independent source such as a battery or frequency generator.
However, if we connect another low pass filter ahead of this first one then the excitation is the voltage source at the input of the second low pass filter.

A rough graphical illustration:
Vin o---LPF1---o Vout

Vin here is the exciting source, but if we put LPF2 in front of that one we would have:
Vin o---LPF2---+---LPF1---o Vout

Now the output of the LPF2 is not the exciting source of the circuit (like for LPF1) but Vin still is.
In the math forms that result, you'd see resistors and capacitors and inductors making up the other parts of the expression, while the exciting sources would appear in the input (exciting) part.

You might also note that is(t) in the example you posted is an actual current source.
The only exception would be if the source came from a previous stage that was being considered as 'external' to the main circuit under consideration. Then it could be called a source which could be called an excitation, but it would have to be defined with whatever it needed and part of that could end up in the non-excitation part of the expression simply because it contains some non-exciting circuit elements such as resistors and capacitors.

Hello! Thanks for your explanation, it help me to clear my doubt.

So basically in the circuit i am trying to analize we can conclude that i should not consider iDS as an exciting source right? Even if the transistor works a bit like a current source in a certain branch of the circuit, right?
I thought that iDS could be consider as an exciting source since its said that the model of the transistor could be considered as being something like iDS=gnl (Vg,Vd,Vs), and has the voltages Vg,Vd and Vs are nodal voltages that depend of Voltage Source(the exciting source of the circuit) i thought that i should also consider iDS as being an exciting source.

So to put the equation in the form that i want and considering that iDS is not an exciting source of the circuit how would my equation form (p(y(t))+(d/dt)*q(y(t))=x(t)) become for example for the equation of node V3

-(V3)/(Rs)+((d)/(dt)*(-CS*V3))-iDS=0, do i equal the equation to zero if there aren't any exciting sources in that branch?

Thanks

#### MrAl

Joined Jun 17, 2014
8,562
Hello again,

That's a very good question and i understand why you would ask that, because after all the transistor models usually have a source too, which appears to supply energy, and that energy is not being taken from anywhere else in the circuit rather it enters into the circuit as a new source of energy.

However there is a slight catch, and that is that this particular source is a DEPENDENT source. That means it gets it's input from some other place in the circuit. This also brings up another question about how we deal with energy calculations in a circuit like this.

Dependent sources differ from independent sources because they depend on other signals in the circuit, and so their entry into the matrix usually ends up being just a constant rather than as a true energy source. One rationale for thinking about this might be to think about the fact that a REAL transistor does not actually inject more energy into the circuit while the transistor MODEL might very well do so. We have to think about the difference. The real transistor just controls energy, it does not produce more energy, while the model does. We have to compensate for this in the energy calculations.

For the matrix where we dont care about the energy itself however, it usually ends up just being a constant or maybe more than one constant. There are times when it could be considered a true source, but this would be much more rare.
For a simple example, consider an input signal Vin, producing an output signal Vout, with just an amplifier "Ampl" i between. The gain of the amplifier we will say is 5. The input signal is 2v. What is the output signal?
Illustration:
Vin o---Ampl---o Vout

The amplifier is just a dependent source, a voltage controlled voltage source, and the gain constant is G=5, so for an input signal of 2v the output signal is:
Vout=G*Vin
Vout=5*Vin
Vout=5*2
Vout=10

So even though the amplifier is a source, it's influence entered only as a constant which was 5. We could show it as just "G" if we wanted to leave it variable until later, or we could use the 5 right away if we knew it was going to always be 5 and never change ever.

For a current controlled current source (a transistor considered to be current controlled) or a voltage controlled current source (a transistor considered to be voltage controlled) we have the same situation. If we have Iin=2 amps and a current gain of G=5, then the output is Iout=G*Iin, so the influence of the CCCS is just G or 5, and for the VCCS if Vin is 2 and G=5 again, we have Iout=10, and again the influence by the VCCS source is just G or 5 again and it's not a true excitation.

The excitation in any of these cases is still just the original input, either Vin or Iin.

That view is the normal view of the circuit, because we are trying to analyze the entire circuit. There are times when we just want to analyze one smaller part of the circuit and then we lump some circuit elements together. In some cases we may end up finding that one part of the circuit lumps as nearly a true source, so we might decide that is it close enough to be used as a true source. But for a more exact analysis we could probably come up with a Thevenin/Norton equivalent, which would include constants as well as the original input. So in most cases we would still end up with constants with the original input, and so the original input would still be the excitation source.

A somewhat simple example would be a second order low pass filter using two equal resistors and two equal capacitors as a passive filter would use, except here we insert a VCVS (voltage controlled voltage source) between the two stages with a gain of A. This results in the transfer function as follows...

One stage:
Hs=E*a/(s+a)
x'=E/RC-x/RC
x'=-1/RC*x+1/RC*E
x'=-1/RC*x+1/RC*u

and with the VCVS with gain G between we have:
Hs=E*a/(s+a)*G*a/(s+a)

or:
Hs=E*G*a^2/(s+a)^2

or in state space form (using upper/lower case notation):
x1=a^2*G*E-a*X2
x2=X1-2*a*X2

and it seems clear that E is the only excitation because X1 and X2 are just state variables and G just a multiplier, and this would be arranged in 'matrix' form as:
x=[0,-a; 1,-2a]x+[a^2*G,0; 0,0]u

where u=[E,0] which is the excitation.

So even though we had a VCVS in the circuit E was the only excitation.

Note that if we did it this way:
x=[0,-a; 1,-2a]x+[a^2,0; 0,0]u
with u=[E*G,0]

then we would be considering G to be an actual energy supplier, which we would not do for a passive circuit element because a passive element can not supply energy into the circuit (over all time that is).

Last edited:
• Current_Source

#### Current_Source

Joined Dec 10, 2015
16 Hello again,

That's a very good question and i understand why you would ask that, because after all the transistor models usually have a source too, which appears to supply energy, and that energy is not being taken from anywhere else in the circuit rather it enters into the circuit as a new source of energy.

However there is a slight catch, and that is that this particular source is a DEPENDENT source. That means it gets it's input from some other place in the circuit. This also brings up another question about how we deal with energy calculations in a circuit like this.

Dependent sources differ from independent sources because they depend on other signals in the circuit, and so their entry into the matrix usually ends up being just a constant rather than as a true energy source. One rationale for thinking about this might be to think about the fact that a REAL transistor does not actually inject more energy into the circuit while the transistor MODEL might very well do so. We have to think about the difference. The real transistor just controls energy, it does not produce more energy, while the model does. We have to compensate for this in the energy calculations.

For the matrix where we dont care about the energy itself however, it usually ends up just being a constant or maybe more than one constant. There are times when it could be considered a true source, but this would be much more rare.
For a simple example, consider an input signal Vin, producing an output signal Vout, with just an amplifier "Ampl" i between. The gain of the amplifier we will say is 5. The input signal is 2v. What is the output signal?
Illustration:
Vin o---Ampl---o Vout

The amplifier is just a dependent source, a voltage controlled voltage source, and the gain constant is G=5, so for an input signal of 2v the output signal is:
Vout=G*Vin
Vout=5*Vin
Vout=5*2
Vout=10

So even though the amplifier is a source, it's influence entered only as a constant which was 5. We could show it as just "G" if we wanted to leave it variable until later, or we could use the 5 right away if we knew it was going to always be 5 and never change ever.

For a current controlled current source (a transistor considered to be current controlled) or a voltage controlled current source (a transistor considered to be voltage controlled) we have the same situation. If we have Iin=2 amps and a current gain of G=5, then the output is Iout=G*Iin, so the influence of the CCCS is just G or 5, and for the VCCS if Vin is 2 and G=5 again, we have Iout=10, and again the influence by the VCCS source is just G or 5 again and it's not a true excitation.

The excitation in any of these cases is still just the original input, either Vin or Iin.

That view is the normal view of the circuit, because we are trying to analyze the entire circuit. There are times when we just want to analyze one smaller part of the circuit and then we lump some circuit elements together. In some cases we may end up finding that one part of the circuit lumps as nearly a true source, so we might decide that is it close enough to be used as a true source. But for a more exact analysis we could probably come up with a Thevenin/Norton equivalent, which would include constants as well as the original input. So in most cases we would still end up with constants with the original input, and so the original input would still be the excitation source.

A somewhat simple example would be a second order low pass filter using two equal resistors and two equal capacitors as a passive filter would use, except here we insert a VCVS (voltage controlled voltage source) between the two stages with a gain of A. This results in the transfer function as follows...

One stage:
Hs=E*a/(s+a)
x'=E/RC-x/RC
x'=-1/RC*x+1/RC*E
x'=-1/RC*x+1/RC*u

and with the VCVS with gain G between we have:
Hs=E*a/(s+a)*G*a/(s+a)

or:
Hs=E*G*a^2/(s+a)^2

or in state space form (using upper/lower case notation):
x1=a^2*G*E-a*X2
x2=X1-2*a*X2

and it seems clear that E is the only excitation because X1 and X2 are just state variables and G just a multiplier, and this would be arranged in 'matrix' form as:
x=[0,-a; 1,-2a]x+[a^2*G,0; 0,0]u

where u=[E,0] which is the excitation.

So even though we had a VCVS in the circuit E was the only excitation.

Note that if we did it this way:
x=[0,-a; 1,-2a]x+[a^2,0; 0,0]u
with u=[E*G,0]

then we would be considering G to be an actual energy supplier, which we would not do for a passive circuit element because a passive element can not supply energy into the circuit (over all time that is).
Hi!

The circuit has the folllwoing sources and a local osciltor as well: After writing the equations of the circuit in the DAE form, i simply got Vss as exciting source. So my question is in the vetor x(t) relative to the exciting sources of the circuit i should only put Vss rigth? Altough the circuit has more exciting sources they don't appear in my system of equations so they should not be in the excitation vetor, rigth?

Thanks

Last edited:

#### MrAl

Joined Jun 17, 2014
8,562
Hi,

I dont understand the question, because if you have a circuit with 4 input sources how could they not appear in your equations for the entire circuit?
If you are only looking at one section it may be possible to leave out some sources, but only if they dont affect that part of the circuit at all or in some negligible way.

For your circuit with the four sources you would have to show all four sources in most cases, unless you could lump one or more sources into another source. For example, your Vdd and Vss might be able to be lumped into one source because they are constant sources, so you could rig it so that one source is dependent on the other but since the independent one is fixed the other would always have the same (required) value also. So for example if Vdd was 10 and Vss was 5, you could rig it so that Vss=Vdd/2 and thus get rid of Vss by introducing a gain of 1/2. The gain would not be considered an excitation but Vdd would be.
Another simple example is two batteries in series. If B1 was 2v and B2 was 2v and they were in series and no other connections except for the total voltage of 4v, then you could replace the two with one source equal to 4v and that would be the only excitation.

What makes it a little more apparent is when the circuit is drawn as a flow graph. The flow graph in the attachment is for the second order low pass filter with gain G as a VCVS in between the two passive first order sections. The flow graph on the top is the more correct one even though they both produce the same output. The one on top shows the gain G as a path transmittance, while the one on the bottom shows the gain G as another input. Does it really make sense to show the gain as another input? Certainly not, and the output then is not even the correct output. So the top flow graph must be the correct one.

#### Current_Source

Joined Dec 10, 2015
16
Hi,

I dont understand the question, because if you have a circuit with 4 input sources how could they not appear in your equations for the entire circuit?
If you are only looking at one section it may be possible to leave out some sources, but only if they dont affect that part of the circuit at all or in some negligible way.

For your circuit with the four sources you would have to show all four sources in most cases, unless you could lump one or more sources into another source. For example, your Vdd and Vss might be able to be lumped into one source because they are constant sources, so you could rig it so that one source is dependent on the other but since the independent one is fixed the other would always have the same (required) value also. So for example if Vdd was 10 and Vss was 5, you could rig it so that Vss=Vdd/2 and thus get rid of Vss by introducing a gain of 1/2. The gain would not be considered an excitation but Vdd would be.
Another simple example is two batteries in series. If B1 was 2v and B2 was 2v and they were in series and no other connections except for the total voltage of 4v, then you could replace the two with one source equal to 4v and that would be the only excitation.

What makes it a little more apparent is when the circuit is drawn as a flow graph. The flow graph in the attachment is for the second order low pass filter with gain G as a VCVS in between the two passive first order sections. The flow graph on the top is the more correct one even though they both produce the same output. The one on top shows the gain G as a path transmittance, while the one on the bottom shows the gain G as another input. Does it really make sense to show the gain as another input? Certainly not, and the output then is not even the correct output. So the top flow graph must be the correct one.
Well don't appear in my DAEs because when i wrote these equations i used KCL and defined the node voltages that i wanted.So the sources which are time dependent simply do not appear in the equations, and the other source Vd appear in a derivative term and hence the derivative term of a constant is zero it dissapears from the DAEs.

I understand that the circuit has 4 input sources but they do not appear in the DAEs equations and so considering that in the form that i want to express the circuit

p(y(t))+(d/dt)*q(y(t))=x(t)
where
• y(t) represents the vector containing, the N state variables of the circuit;
• x(t) represents the vector containing the exciting sources of the circuit;
• p(y) corresponds to the algebraic term that models the elements of the circuit "without memory" such as the resistors,etc...
• q(y) corresponds to the algebraic term that models the elements of the circuit with memory" such as the capacitors, inductors,etc..

the vector of the exciting sources that is x(t) will only have the source which appears in the equations, right?