View Question
Q: equation and plot demonstration for simple transcient circuit ( Answered ,   3 Comments )
 Question
 Subject: equation and plot demonstration for simple transcient circuit Category: Science Asked by: cereb-ga List Price: \$20.00 Posted: 16 Mar 2006 14:33 PST Expires: 15 Apr 2006 15:33 PDT Question ID: 708116
 ```I would like to generate curves that rise and fall exponentially. These curves simulate a phenomenon unrelated to electronics, but the best simulation would involve plotting the voltage induced by a magnet being moved at some linear velocity past a coil in a circuit that contains a capacitor. The plotted curve represents the transient voltage generated by induction that decays over a time across R and C. Although one could use a voltage source and switch, or a pulse generator, I specifically need to model individual events that involve a magnet moved past a coil. The circuit typically would look like this: ------------ | __|__ | | | | C1 R1 | | | magnet [F] L1 ------ | | | | | | ------------ The voltage transient is given by an equation with "F" being the flux, "L" the coil inductance and "x" representing time. It would be measured across "R1". The decay over time "x" is given by an equation applicable to the parallel circuit with component values "R" and "C" and the induced voltage. The generation of the transient takes place in a short time, milliseconds, typically. The decay can extend over several seconds for the type of curve I would like to see. If the above were a real circuit, C would discharge rapidly because of the low resistance of the coil. I assume that it is possible to offer a function that can be plotted that uses the peak voltage generated as the voltage that then decays via RC. In a "real" circuit I would perhaps insert a diode to preclude the discharge through "L". The solution I need is a single function that plots the exponential rise of the induced voltage and the exponential decay of that voltage via RC in one curve. It would be of the form f(x)= I could then select component values to change the shape of the transient curve from x=0 to some other value of x where "x" is time. The answer would consist of the function as described, that can be demonstrated using any plotting program that can accommodate multiple variables. Offering a link to an online or downloadable plotting program that was used to validate the proposed solution prior to submission would demonstrate that the task described here was indeed answered.``` Request for Question Clarification by hedgie-ga on 16 Mar 2006 21:20 PST ```Cereb There some issues of terminology, which I would like to sort out before we get to solving the 'the system'. The system could be mechanical, electric, or some abstract time series in economics. For all kinds of 'systems' people often ask the 'if' questions. e.g.: If we increase the toll on a bridge (for example), how will that affect to volume of the traffic across that bridge? Mathematical formulation of these situations was provided by the Control Theory http://en.wikipedia.org/wiki/Control_theory The variable we control (e.g toll on the bridge) is called 'forcing function' and the variable which we then measure is the 'response of the system'. Often the forcing function is a step : we increase the toll, and we see that after same time the system approaches new equilibrium : Step response http://en.wikipedia.org/wiki/Step_response Approach to the new equilibrium can often be approximated by a single exponential described by a single parameter (exponent) called: relaxation time http://en.wikipedia.org/wiki/Relaxation_time It is an important property of the 'Linear Systems' that once we know the response of the system to 'step function', we can easily calculate response to any forcing function. For example, to increase 'the toll for a month by \$5, and then put it back to original level' (so that forcing function is a 'square pulse' will make the system to respond by slowly lowering the volume of the traffic, and then, after a month, traffic will slowly start returning to original level. The response to such a pulse function is obtained as superposition of the two responses: 1) the response to initial step up, and then 2) the response to step down (shifted in time, by one month). Hoping to find dome nice applet illustrating that, I did this search: search terms: linear dynamic system applet and picked these links: --------------------------\\ The behavior of a linear, continuous-time, time-invariant system with input signalx(t) and output signal y(t) http://www.jhu.edu/signals/convolve/index.html The following applet was created for students to investigate the basic properties of linear systems via a simple mass, spring and Damper system. http://users.ece.gatech.edu:80/~bonnie/book1/applets/suspension/MSDdemo.htm ---------------------// None is ideal, but they do illustrate a notion of a linear system. If we can agree on the above terms, the question arises, which using these terms, can be formulated as follows: What is the forcing function for the system we want to solve? We are talking about a motion of a magnet, magnet which causes variable magnetic field, field which comes and goes. That looks like a pulse function. The pulse function is inducing the voltage in the coil L1. OK. We know that 'to solve the linear system' we just need to find a response to a step function, but we did not really defined what that forcing function is. Usually, in the circuits theory, forcing function is selected as a voltage over the input terminals. Then response can be current at any conductor, or voltage across any component. So, to make question more exactly defined, I would like to have the forcing function better defined. 1) One choice would be to put input terminals in series with the inductor L1 , like this |---------IIIIII---------0 0---------------| L1 ~ input and apply a voltage to the input terminals . That would produce the current in the L1, similar to moving a magnet close; Then we remove the voltage, and the circuit eventually comes to the rest, same was as after the magnet was removed. Or 2) In reference to the picture on the right top of this page http://www.sparkmuseum.com/INDUCT.HTM we could have two coils. What they call 'high voltage output' would be connected to the rest of the circuit (where L1 s now) and the battery would represent the applied voltage across the 'input terminals'. Switching the K on and after few seconds off, would be a voltage pulse. We would have additional two parameters in this case; we would have L1 (as now) but also L0 (inductance of the primary) and L12 - the cross inductance between the primary and secondary coil. Which one (or perhaps still another) interpretation of your question you want to use? Hedgie``` Clarification of Question by cereb-ga on 17 Mar 2006 19:40 PST ```I was hoping to hear from you, Hedgie. Thank you for responding. I am certain that you can resolve my unusual task and that it is largely a matter of communication which, I trust, we can overcome and fairly rapidly, probably now. I carefully read your comments and attempted to understand those as well as the linked-to information. You certainly have invested effort to tutor me. The closest I could come to selecting from the options you recommend would be the two-coil version. If I used the example of a typical transformer having primary and secondary windings, I could see one winding (not the L1) driven by a battery and creating a field. I could make sure that "my" circuit has no voltage anywhere. Then, by turning the energized winding off with a switch would induce a voltage and current in my L1 coil. The collapsing field in the formerly energized coil at would be a time-varying field simulating a moving magnet and RC would be off and running. EXCEPT that in a real circuit, the charge on C would dissipate through the coil before RC ever got off to a start, because the intended rise time of the induced voltage typically would milliseconds and the fall time seconds to yield my curve. I think it is best if I describe the intended use of what we are dealing with here. It deals with human responses much as the Weber-Lechner law does, but I model something else. Basically I model a "motivational signal" that registers in the human mind, brought on by some event, which then fades by something similar to "forgetfulness". For example, if I gave an employee a one dollar raise, that would generate some mental signal. But if I gave the employee twothousand Dollars for Christmas, that would yield a much larger signal. In either case, the employee will experience a decay in that signal and return to normal almost, as prior to either signal or reward. The total amount I gave will be the same for 2000 hours worked, however. So I take 2000 as the flux of a magnet - the flow of money in this case. A rapid flux change would create a steep pulse, dribbling the amount out over time, a small pulse (the signal in the employee will say "it's just a Dollar"). In either case, the signal, stored in memory C decreases because C is leaking charge through R, causes C "to forget". I can use C to model some human capacity or ability to register, and use R to model "forgetfulness", typically (though not quite). Taken together, I would have a function V(t) =" inductive term and RC term" which I could plot, and by assigning values to LCR and the "event time" and magnetic flux for event value or significance, I can then develop my scenarios and illustrated them with curves. In the above example I could use a pulse, because it takes about the same time to advise an employee of the hourly rate or the bonus, and let pulse height model the value. But there are other cases where it would not work as nicely.The moving magnet gives me greater latitude in modeling signal generation scenarios. I hope this helps, Hedgie. I was reluctant to use the "Science" category for this not-so-scientific model, at least at this stage.```
 Subject: Re: equation and plot demonstration for simple transcient circuit Answered By: hedgie-ga on 18 Mar 2006 00:51 PST Rated:
 ```OK cereb, Let's take it small in steps - meaning: do not consider this to be the answer. It is the opening step of a dialog. Do not worry too much about the the length of the dialog. Obviously, it has to be finite; (This is one example of one 'too long' dialog: http://answers.google.com/answers/threadview?id=500730 ) As you see, before the dialog gets too long, I do usually say that we have to come to closure in few more installments. The reason I want to go in small steps is to make sure we are communicating. The problem with the magnet ______________________________ Waving the magnet around the coil, is a legitimate 'forcing function' or 'stimulus'. We are able to model electro-mechanical systems, such as electric motors, where physical motion and induced EMF interact. The problem with your original description was that it was too undefined: The induced of EMF depends on speed, and the speed-profile of the motion, which determines the shape of voltage induced in L1 was not well defined. This is illustrated in these two links: Induced e.m.f. = depends on speed http://courses.science.fau.edu/~rjordan/rev_notes/28.2.htm shape of e.m.f. pulse induced in coil by a magnet http://www.data-harvest.co.uk/datalogging/easysense_fa.html Also, such a situation may require a non-linear model if the distance varies in a wide range. Again, we can solve non-linear models, but here, in what I take to be a conceptual stage, it is better to make the model as simple as possible (but 'not more simple than that :-) http://www.quotationspage.com/quote/3430.html So, following that adage, let's start really simply - we can add componets later: Description of the task _______________________ You do have a stimulus (or forcing function) which is the 'rate of pay as a function of time'. We consider two rectanglual pulses with same area of 2000 units. One is narrow and tall (the Xmass bonus), other is wide and low (a raise). We will call them Rx(t) and Rr(t). You have 'a worker' (what a control engineer would call 'a plant') which produces output P(t) (measured in some output units). The 'worker' is modelled by a linear system K, (kernel) so that the output (of production) P depends on rate of pay: P(t) = Sum K(t - p) R(p) Sum is over p ,ranging from infinite past up to present = t. meaning: the current rate of production P(t) depends not just on the current rate of pay R(t), but also on the last week R(t-1), and week before that R(t-2)... etc and the 'memory of the past' fades at the rate controlled by some 'time constant' tau= R *C . We know that K can be represented by a circuit (mechanical or electrical) but whatever circuit we choose, we want to be able, for the given K and the stimulus R we choose, to obtain a plot of P(t). In addition, we want to represent K by some simple circuit with small number of components, so we can tweek the values, obtain a modified K, and perhaps give some interpretation to their function in terms of the psychology of the worker. Questions (RFC) 1) First question: Is this, as described above, the task? An ideal tool for this would be Scilab (a free simulation paltform) which can produce plots like this: http://www.scilab.org/doc/demos_html/node179.html as described here http://www.scilab.org/ Commercial programs like http://www.wolfram.com/ ttp://www.math.ufl.edu/help/matlab-tutorial/ or free version of matlab, http://www.octave.org/ would also do the job. What job? Job b) using the Kernel K to calculate Response P and plot it and a) Calculating the K from a diagram of the circuit. It is a bit more than a plotting program, but not much more. 2) Question two is, do you have some such program installed, or do you want to install it? It is not necessary to install one, but if you want to work interactively: change the component and get a response, interactively, it would make the task easier. Alternative would be to start with the plotting applet, and some simple Kernel, someting like K(d) = e + g* expt( r * d) and get sample responses to different stimuli ( Rx and Rr ..) P.S. r = 1/tau can be complex number - in which case we get an oscilatory response - indication of 'inertia' or inductor in the circuit. 3) Are you familiar with complex numbers, stuff like http://hyperphysics.phy-astr.gsu.edu/Hbase/cmplx.html http://planetmath.org/encyclopedia/ComplexExponentialFunction.html http://www.mathworks.com/access/helpdesk/help/toolbox/dspblks/complexexponential.html Do you want to use or avoid that terminology? Hedgie``` Request for Answer Clarification by cereb-ga on 18 Mar 2006 12:07 PST ```Thorough job, Hedgie, Thank you again. I made curve generation my principle goal, and without having yet generated such curve I trust that I can do so with the links etc. you gave to me. I will download the simulation software and see what I can do with it to generate a plot shape of the type I wish to generate, and will then be ready in case more interaction is indicated. I knew that the magnet approach would be cumbersome to actually generate the desired curve on a scope, for example. The "real" issue for me is this: I have invested 20 years of work related to human/social/societal behavior. It has been rather novel work, seminal in parts, and at age 73 I feel the pressure to present it so it can be understood by many people who search for credible solutions to seemingly insurmountable obstacles to change the way we manage the affairs within and among societies. Since we have only "effective objectivity through collective subjectivity" to rely on, such as laws, treaties and such, my aim was to find a way to overcome the constraints of humans being able to be objective about humans, and I searched for an objective frame of reference to overcome these constraints. In that I suceeded, presumptuous as that may sound. I use phenomenology for explaining the method I employed. Social scientists could use some of my findings employing expert systems and AI tools to simulate policy formulation based upon the core model for individual behavior and its use for a societal core model that uses the individual core model. But I am more interested in making my work plausible to many people who have valid concerns for our future, even make it credible and mainly actionable. So I felt the need to model much of what I found. One of the most consequential Findings of my work relates to our individual as well as collective behavior of "growth" that applies in economics, in governance and the exponentially rising expansion or even race for scientific progress. The curve I am after now is but a start, subsequent graphical illustrations will further illustrate what drives this obsession with "growth", which in turn creates the many problems we face everywhere that derive from this obsession. I can use your approach to model that and other curves we may want to deal with hereafter, because it may well serve those who want to model things I describe in my work, and they would demand more rigor in my reporting. I was hoping merely for something to illustrate to non-professionals something they could use to better relate to these graphs. Such approach would also more adequately reflect my inabilities to offer more than "cute" analogies. Certainly our present task would be completed by using your approach to create scaleable graphs, and it would be completed upon generating them. Maybe I will use my LCR/magnet example to just explain verbally how such curves "could be" generated that way but because of the modelling requirements for what I am describing, that your approach was necessary. This verbiage here may help to explain my desire for the LRC/magnet model and it may help when we deal with the other curves related to this "growth" obsession. I think we are where we wanted to be, and I will now get the simulation program and see what I can do with all your inputs. Above all, I want to thank you for having stayed with this issue patiently and constructively. If you wanted to create two curves to show scalability using the simulation software link, that would be the answer that closes this part. I would hope that we can then deal with the use of that approach to create the other graphs I have not yet described but that rely upon this one.``` Clarification of Answer by hedgie-ga on 19 Mar 2006 22:52 PST ```cereb-ga http://answers.google.com/answers/threadview?id=705898 I = V / ( R1 + R2) http://www.pa.uky.edu/~phy211/graph_applets/plot_graph.html current http://answers.google.com/answers/threadview?id=708116 I made curve generation my principle goal, and without having yet generated such curve I trust that I can do so with the links etc. you gave to me. OK.Let's now move to the curve generation. Scilab software may become very useful, particularly if you have experimental data to fit and will need to introduce non-linear components. However, it is a handful and there is a steep learning curve. So, for now, we will plot simple solutions using the plotting applet. We will use the simple kernel which we found in the previous question, a solution which has a a) constant and b) one exponential with time constant 1/l1= R1 *C1 Asymptotic regime ---------------- The constant is a0= 1/(R1 +R2) and it defines 'asymptotic behavior' aka steady state: when the 'transients die away' and new (dynamic) equilibrium is reached your circuit is P(oo)= a0 * R(oo) where oo is symbol for 'infinity' = long time after last change of R = rate of pay, =long time after time 1/l1. It says that 'rate of production' P is proportional to 'rate of pay' - which is somewhat unrealistic, since workers productivity is limited, but not surprising in a linear model. (Ur can be fixed by saying that R=log(pay) or so, but that is a different issue). Transient regime ---------------- In the time interval between change in pay R, and equilibrium, the production P will oscillate around new level P(oo) like this P(delta) = (a1/l1) * exp ( delta * l1) * sin( delta * omega1) parameters of the curve a1 l1 omega1 comes from the kernel. Actually, 'solving the circuit' means to express these parameters of the kernel in terms of the values of components ( L1, R1, R2, C1 ...). Let's plot the transient P(delta) or P(t) , which is P(t) shifted in time (t is time, delta is time counted from the moment t0 in which the change of pay was made) (we will set it to zero) Let call the applet http://www.pa.uky.edu/~phy211/graph_applets/plot_graph.html and enter ((5*exp( -.03 *x) * sin (.1 *x ) )) +5 into function box min x to be zero max x to be 100 and press [plot the function] button we get a transient, starting at P=5 , swinging up to P=8, down to 4, ... to see settling we increase x.max max x to be 100 and press [plot the function] button To get further, we meed to find a 'step function' s(t,t0) = 0 if tt0 unfortunately, clicking on the Special Functions link produces error. Meaning, we have to find a better plotting program. Please, let me know if you have a preference (but it has to be multi-platform, run not only on windows) Hedgie``` Request for Answer Clarification by cereb-ga on 20 Mar 2006 13:51 PST ```The function to plot worked as you described. I made a typo in entering the function by typing .3 instead of .03 and was rather pleased to see the very shape of a curve I hoped to generate. It basically looks like a damped version of the function you offered. I agree, the Scilab software calls for an amount of learning I am not prepared to get involved with, although I think it is an incredibly powerful general engineering tool, and I am glad you steered me toward it. You referred back to previous question where you suggested a Laplace transform as well as to your "description of the task". Under the title "transient regime" you offered the production equation stating that the parameters of that equation come from the circuit components and their values. And that is what I would like to see - the correlation between curves and circuit elements and their values. So far so good. The correlation itself I do not yet understand as yet. You clearly understand what I am searching for, and I will therefore follow your lead. I trust that in the end I will be able to follow the steps you have already outlined, and others that will be needed, to generate the curves. If you have a suitable plotting program, just advise what it is, how it was generated, whether I have such program or not, and I will accept that as the answer. Thank you for your patience thus far. Re other plotting programs - I have no preference. You suggested the free version of matlab.``` Clarification of Answer by hedgie-ga on 21 Mar 2006 19:20 PST ```Octave - a free version of matlab is good, but like scilab, has more complexity then we need. After looking around a bitm I picked gnuplot. If the graphing software has the same capabilties, you can use that of course. I will use gnuplot to visualise the response function, and post in the next RFC. In the meantime, you may install it and work through a tutorial. Description http://www-128.ibm.com/developerworks/library/l-gnuplot/ tutorials http://www.gnuplot.info/help.html examples http://t16web.lanl.gov/Kawano/gnuplot/misc1-e.html homepage - download -Current officially released version is gnuplot 4.0 http://www.gnuplot.info/``` Clarification of Answer by hedgie-ga on 22 Mar 2006 05:20 PST ```So, I did entered the equations into gnuplot. It seems to do what you want - a response to rectangular pulses. I mean in a qualitative way. I used arbitrary numerical values. I can post the pictures of plot, if you need that, but it will be much better if you creeate them on your version of gnuplot, so you can change the values and tweek the axes and labels. What follows is a gnuplot script. Meaning: 1) you put the text between lines ---------\\ ------------// into a file called RCL.dem and type gnuplot RCL.dem into a shell. I believe MS people call that 'command console' . Then, at each prompt 'Hit return to continue' you 'hit return' (it is, as you see, easy) and script waks you thrue creation of stimulus pulses and responses 2) then you open the file RCL.dem in the editor and either, modify values a0, a1, lambda1 omega1, which describe the linear system and start end height , start2 height2, end2 which represent stimuli (batch mode) or lift the command from the *.dem file and paste them into fnuplot console. That should complete the portion 'how to plot response of the circuit' of the question. We will have to start thinking of the closure, but please, do ask if these instrucyions are not clear. The script ----------------------------------\\\ # # \$Id: RCL response of a simple linear system to a step function # # Requires data files "pulse.dat", kernel.dat from this directory, # so change current working directory to this directory before running. # gnuplot> set term # gnuplot> load 'RCL.dem' # set key left box set title " Test availability of functions" set samples 150 set zeroaxis set xlabel "Date\nTime" set yrange [-5:5] set xrange [-1:50] plot [-1:10] cos(x), 3*sgn(x), exp(-.5*x) pause -1 "Hit return to continue" set key right nobox set title " Plot rectangular pulses : tall (bonus)" set samples 100 plot 1+sgn(x) # select pulse 1 == rise start=3 end=33 height=1.5 #define pulse pulse(x) =( sgn(x-start) - sgn(x-end))* height * .5 #plot it set yrange [-.5:20] set xrange [0:50] plot pulse(x) pause -1 "Hit return to continue" set title " Plot both stimuli a) rise (pulse2) and b) bonus (pulse) " set key left box set samples 200 start2=3 end2=33 height2=5 pulse2(x)=( sgn(x-start2) - sgn(x-end2))* height2 *.5 start=3 end=5 height=10 set yrange [-.5:200] set xrange [0:50] set zeroaxis plot pulse(x), pulse2(x) pause -1 "Hit return to continue" set title " Rise stimulus and Response to the 'rise' " set zeroaxis set yrange [-2:100] R=0.5 a1=2 a0= 1/R lambda1=.2 omega1=.9 kernel(x) = a0 + a1*exp(-lambda1*x)*cos(omega1*x) response(x) = (x<0) ? 0 : kernel(x) prod(x)= height*(1/R+response(x-start) - response(x-end)) plot prod(x) pause -1 "Hit return to continue" set title " Response to the 'bonus timulus' " set yrange [-.5:50] plot height2*(1/R+response(x-start2) - response(x-end2)) pause -1 "Hit return to exit" reset ------------------------------------------/// Hedgie```
 cereb-ga rated this answer: and gave an additional tip of: \$15.00 ```Thanks you for both notes, Hedgie. Was gone for one day +, thus the delay. I am confident that you have offered the means to create the desired plots. I will not delay closing until I worked through the learning curve. Should I have a question later, I will open another question addressed to you. Once I generated a few plots I will then define the question for the next phase that will make use of them, and I will need your help again at that point. But for sure, it will be less involved. Thank you once again for all your help and patience```

 ```I think you should put the diode back in. The diode divides the circuit response into 2 'periods'. The first period ends at the instant when the current through the inductor reaches zero. From then on (period 2) L1 and R2 are irrelevant, and you just have exponential decay of the voltage across C1 (assuming you're done 'moving the magnet' by then). During period 2, then, the voltage across C1 is simply: Vc = A exp(-t/(R1*C1)), where A is a constant. What happens during period 1 depends on what you mean by 'move a magnet past the coil'. Of course you know there is more than 1 way to move a magnet, and different magnets, having different magnetic fields, will produce a different result even if they are moved in the same way. In general, moving a magnet at a constant speed past a coil does not produce a linear change in magnetic flux through the coil. Think about the funky shape of the magnetic field lines around a magnet. Unless you can be more specific about the voltage generated in the coil, or in some other way specify the initial conditions, your question isn't really answerable. How about this: at time t=0, there is a current I flowing through the inductor, and no charge on the capacitor (forget about the magnet altogether)? If that's no good, how about this: at time t=0, the current is 0, and a constant voltage V is switched on across the inductor (either directly, or by introducing a linearly increasing magnetic flux through the coil). V could be left on indefinitely, or switched off at some time t. These are all well defined possiblities. Pick one, or describe another one. Also, which voltage are you interested in? It sounds to me like you want the voltage across the capacitor, but I suppose you could be interested in the voltage across the inductor??```
 ```The Question concerns how to plot the behaviour of a linear electrical circuit comprising THREE independent variables. PLUS another unknown variable - the shape of the input signal. The notion of passing a magnet through a coil of wire amounts to a crude pulse generator. If we can tighten-up on this then a constructive step can be achieved. I suggest that the input signal should be represented by an e.m.f of zero impedance in series with inductance L1. The e.m.f. comprises a single cycle of a bipolar sine wave. Hence it has a positive half-cycle followed by a negative half-cycle. This is pretty much what I would expect when a magnet passes through a coil. I am not able to suggest a mathematical analysis of the circuit. But note that any such analysis should take account of the speed of the magnet's passage through the coil, hence of the duration of the single cycle sine wave input voltage.```
 ```This should cover comments offered by rracecarr and sorwin - and I thank you both for offering them. Yes, there are two logical sequential events that take place, and given the planned and substantial difference in voltage generation and decay times, these logical events can be considered as being "real". The first period starts with no voltage or current anywhere and it ends when no more flux is reaching the coil so that no further current will flow and no incremental voltage is generated. The end of the first period then marks the start of the second period where C discharge only takes place. Since we are not building a circuit and instead focus on the phenomenon of induction, I can adjust the flux density, velocity of relative motion and inductance of the coil at will until I see a voltage generated. I took the diode out this time, as well as R2 because Hedgie felt that this complicates matters. In a "real" circuit, I agree that the diode might even be necessary, or some other means to stop the discharge through the coil before RC could even respond. Re: switching a voltage would work, but I would loose the benefit of the flux phenomenon which is relevant to my aims, although it would not matter if I only wanted to see the charge/discharge curve. For my purposes, L,R and C have significance. The exponential charge/discharge curve I am after cannot be generated by measuring the voltage across the inductor only, as you hinted I might be interested in.```