Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Inductance Current 1

Status
Not open for further replies.

Chezma

Electrical
Nov 8, 2010
17
0
0
CA
The relation between voltage and current for an inductor is given by:
v = L . di/dt
I think this relation is valid only in steady state periodic cyclic operation and provided that the circuit contains a resistive element.
My question now :Why a resistive element should be contained in the circuit to make this relation valid ?
 
Replies continue below

Recommended for you

The thread has died down, so I hope it is not a problem if I take it over for my own tangent.

I don't know if you guys were surprised, but I was very surprised to get such a low number for "accuracy" in the my R-L simulation posted just above, especially considering I was using such a big step size (my first reaction was: D*mn!.... that Runge-Kutta is amazing). Now I have studied it a little more and it turns out there is more to the story....

In general (from textbooks), there are 2 types of errors that can occur at a given step:
1 – Roundoff error – independent of step-size. It is assumed to vary randomly from step to step (not correlated with previous steps). Since it varies randomly, by the Central Limit theorem, we can predict that the standard deviation of the cumulative roundoff error after N steps is sqrt(N)*sigma where sigma is standard deviation of roundoff error for one step and N is number of steps (N assumed large for C.L.T.)
2 – "Local Truncation Error". This is not "truncation" as in roundoff, but "truncation" as in truncating the infinite Taylor series associated with the exact differential equation/solution down to a finite Taylor series associated with our approximate algorithm/solution. The magnitude of this particular error increases with step size. In contrast to roundoff error, the variation in LTE between steps might not be random (in this case there is a definite non-random pattern as we will discuss.

Now let's analyze how these two errors might appear in our R-L simulation example:
1 - First roundoff error. Excel uses double precision, where the relative error (of one step) will be on the order of 1E-15 to 1E-14. Since the variable varies between 0 and 2, averaging about 1 that is also our absolute error. For the previous example 25 seconds sampled every 0.002 seconds, it was 12,500 steps and (by Central Limit Theorem) we expect the standard deviation of the accumulated roundoff errors at the end to be 1E-15 to 1E-14 * (sqrt(12,500)) = 1E-13 to 1E-12. So the observed value of 7E-13 that we saw at t=25.000 seconds was very reasonable considering accumulated roundoff error alone.

2 - Next let's discuss Local Truncation Error. It could probably be analyzed mathematically, but I took a different approach... attached I have modified my spreadsheet to add a plot labeled "Error" based on numerical comparison of the simulation output to the true known solution I(t) =1-cos(2*pi*50*t). On the "Error" plot graph you see a sinusoid which varies from 0 to –0.0001. The error plot is periodic at 50hz and it roughly reaches 0 whenever time t is an exact multiple of 1/50hz = 0.020 sec. Also I made the step size an irrational number sqrt(3)/1000 to make sure relationship between step size and exciting frequency is not causing any irregularity (it is not). However if you vary the step size (cell D7, labeled "dt"), you will see that the magnitude of the error plot goes up when you increase dt and goes down when you decrease dt.... which is an expected characteristic of Local Truncation Error.

The above facts lead us to the following conclusions about this particular R-L simulation:
A – The global truncation error (sum of accumulated local truncation errors) is many many order of magnitudes higher than the roundoff error for this simulation.
B – The global truncation error in this particular simulation is periodic at frequency 50hz, which implies the local truncation error is periodic at 60hz. In retrospect, it is not surprising that the error associated with truncating a sin wave at a finite number of terms is itself periodic.
C – The periodicity of the truncation errors prevents them from accumulating to very high values during a very long simulations (global truncation error varies between 0 and some max number, but doesn't tend to increase without bound over time). However we should not expect that to be the case for general excitations other than sinusoidal. I am envisioning I could create a problem using a sawtooth voltage wave where the rising edge is given by (t-tstart)^5 and the falling edge drops sharply, and we add a constant to make the average value of the voltage waveform zero... I think the local truncation errors will be all the same sign and the global truncation error will continually grow with time during a long simulation. (If you see another post appear in this thread, it is probably me trying that idea out).
D – The previous post examined the error at a time t=25.000 sec, exactly divisible by 0.020 when the global truncation error happened to be zero, so results (1E-12 corresponding to accumulated roundoff) were a "little" misleading ;-). If we examined the error of the same simulation at a different "phase angle", we might have seen up to 1E-4 error (periodic, not increasing over time). And as described in C there may be other non-sinusoidal exciting waveforms which whose global truncation error increase continuously over time to much higher values.


=====================================
(2B)+(2B)' ?
 
 http://files.engineering.com/getfile.aspx?folder=a4bca7bf-995e-4f8f-b00b-baf141950e75&file=RL_DemoErrorAnalysi.xls
Also I forgot to tie my recent discussion back to a topic more related original question. The R-L circuit driven by periodic zero-average voltage source does not accumulate errors forever, it only accumulates them as long as it's memory will permit (roughly 10*L/R). In contrast the L-only circuit accumulates those errors forever. So if accumulation of truncation errors causes a problem, that might be the reason why the L-only circuit configuration is prohibited

=====================================
(2B)+(2B)' ?
 
There is a typo in my formula for slope K4. For example, in cell G18
=(V_*SIN(W_*($B18+dt_))-R_*($C18+dt_/2[]*F18))/L_
should have been:
=(V_*SIN(W_*($B18+dt_))-R_*($C18+dt_*F18))/L_

But it doesn't make any difference in the solution when R=0, which was the case for everything I discussed above.

Yes, the spreadsheet used a fixed-step size Runge-Kutta 4th order method shown here:

For circuits with more than one element, you have to put them into the form: d/dt(x(t)= f(x(t),t) where x is a vector of state variables. Generally that is easily done by making your inductor currents and capacitor voltages the state variables. The extension from scalar to vector case should be fairly intuitive. It does get a little cumbersome to do it in a spreadsheet which doesn't handle vector variables, so I use vba when I have more than one state variable. Beyond the fixed-step size Runge-Kutta 4th order method, it is very common to use the Runge-Kutta Felhburg (spelling?) method which adjusts the step size to control the estimated local truncation error. It determines the local truncation error of the 4th order RK by comparing it to a 5th order RK method. That's what Matlab ODE45 uses. I have a spreadsheet that does something like that using vba which I can post if you want, but if you don't know how to program vba (to define the slope function) it won't do you any good.

Any numerical analysis textbook will cover the above and a lot more about numerical solution of Ordinary Differential Equation initial value problems such as this.

I can't help you with Spice.

=====================================
(2B)+(2B)' ?
 
Here are a couple of runs in LTSpice. Trying to run with zero ohms doesn't work. Adding one microohm helps. The simulation is with simplest possible data, all ones - except series R.

Driving waveform is a sinewave and phase shift is zero. That results in an initial DC component that seems never to die because of the hefty L/R time constant (1 megaseconds). If you let the simulation run long enough, you will see the DC component decaying.


Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Sorry. A 'divide by' missing.

(tolerance times maximum voltage divided by maximum current)10 (or 100)

shall read

(tolerance times maximum voltage divided by maximum current)/10 (or 100)

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
"Let's look at a simpler excitation. Just apply a single pulse with your voltage source and then turn your voltage source back to zero for the rest of eternity.

The initial pulse will be enough to create some current in your R-L circuit. Can that current continu flowing forever"

I come late to the party, but excuse me, if you are talking a pure ideal inductor, the answer is yes, the current will go on for "the rest of eternity"

 
I only looked at your first line response after I saw

"electricpete,what is the transient response of a pure inductance to a square wave ? With no resistor included".


YOUR ANSWER

"Let's look at a simpler excitation. Just apply a single pulse with your voltage source and then turn your voltage source back to zero for the rest of eternity.

The initial pulse will be enough to create some current in your R-L circuit. Can that current continu flowing forever?

I hope you answer is No.........................."

I didn't look further and never noticed the R_L you tossed in.

No wonder why the OP was confused, especially with all the extraneous irrelevant answers he was getting.
 
Zekeman

I do not think you are fair in that last comment.

The OP got lots of valid answers to his initial question. But he never bothered to try and understand what they said.

Did you read all those "extraneous irrelevant answers he was getting"? Your reading strategy ("I only looked at your first line" could perhaps benefit from a slight adjustment.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Yes, this thread went a lot of places, including the OP stating: "My question again ,why a resistor in the circuit makes that difference ?"

To answer that question, you need to discuss both cases as I have done in this thread.

The question"electricpete,what is the transient response of a pure inductance to a square wave ? With no resistor included" was timestamped "23 Jan 11 12:09".

The post of mine addressing R-L circuit was timestamed 23 Jan 11 12:14. I was probably typing while he was posting because this was followup to an earlier point and not direct response to that question which I never saw.

The OP understood exactly what the R in R-L meant as he followed up with "I am agree with you electricpete in the case of a resistor exists in circuit ,but what would be the behavior if no resistor is there, just only pure inductance. " 23 Jan 11 12:49

Later, the OP has later acknowledged by help "Thanks pete,that is a perfect answer to my question."

Time to move on imo. Unless you would like to talk about R-L circuits or why Spice makes you put a resistor in there.


=====================================
(2B)+(2B)' ?
 
OK, I see your point. I guess timing is everything.
Good answers by you.
But in all fairness, the 1st poster nailed the rather trivial question and it should have ended right there. A lot of wasted ink.
 
There were followup questions after that first question and the exact underlying question was not clear. One aspect of the question was the unique requirements of Spice which I think have still not been definitively answered.

In the shared interest of conserving electronic ink, may I suggest to move on? (unless there are other comments related to the questions raised in this thread).

=====================================
(2B)+(2B)' ?
 
electricpete said:
One aspect of the question was the unique requirements of Spice which I think have still not been definitively answered.
What I meant is that we still dont' know definitively why Spice requires a resistor in series with an inductor. (I don't want to downplay the contributions of others who did a good job explaining what Spice requires.)

=====================================
(2B)+(2B)' ?
 
Going back to zekeman's comment (wasted ink), I should point out for anyone that cares enough to read an entire completed thread aftewards that there was at least one question asked (28 Jan 11 21:46) which was later removed. However I recognize I am not doing any myself any favors in my last 3 posts with respect to "wasted ink", so I will now adjourn and endeavor to proofread, be succinct, and avoid tangents.

=====================================
(2B)+(2B)' ?
 
Status
Not open for further replies.
Back
Top