|
Components and Circuits For discussions about component types, alternatives and availability, circuit configurations and modifications etc. Discussions here should be of a general nature and not about specific sets. |
|
Thread Tools |
28th Dec 2017, 4:20 pm | #1 |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Integrals of waveforms?
Can anyone please signpost me to integral calcs for common waveforms?
Sine wave and square wave would be great to start with. It’s to work out eg instantaneous current in fast (tend to low hundreds of nS) switching, so high dI/dT, esp with the added complication of low duty cycle ,where RMS current is pretty meaningless . Just to let you know I’m planting this today but I’ve got some family events to attend to, so if I’m not responsive until tomorrow, it’s not that I’m ignoring the thread. Thank you and i’ll be in touch soon!
__________________
Al |
28th Dec 2017, 5:38 pm | #2 |
Nonode
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,681
|
Re: Integrals of waveforms?
The integral of a sine wave is a (negative) cosine wave. The integral of a square wave is a triangle wave.
For what you're talking about, a simulator like LTSpice might be a good idea. Chris
__________________
What's going on in the workshop? http://martin-jones.com/ |
28th Dec 2017, 7:11 pm | #3 |
Dekatron
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
|
Re: Integrals of waveforms?
Well, integral sin x dx = -cos x + C and integral cos x dx = sin x + C. As for square waves, you can treat them as simply being y = a for some values of x and y = b for other values of x.
You can do a reasonable numerical approximation of integrating a time-varying function just by using a suitably small value for δt, and adding y * δt to a running total over the time range in question.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments. |
28th Dec 2017, 8:32 pm | #4 |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Thanks folks, that’s a great start!
I’d actually like to do the maths rather than use a simulator. Partly this is because I want to choose which portion of time to go down to ... for example to illuminate what’s happening when a non-linear change happens , eg when a square wave goes vertical, etc..
__________________
Al |
28th Dec 2017, 8:34 pm | #5 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,902
|
Re: Integrals of waveforms?
Sounds like you might want the differential function rater than the integral.
David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
28th Dec 2017, 8:40 pm | #6 |
Dekatron
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
|
Re: Integrals of waveforms?
Yes. Edge detector / differentiator. Integration is unstable over time due to leakage etc as well so you end up with a situation where the mathematical integration has quite horrible constraints:
1. Leakage - integration is imperfect due to components, offsets etc. 2. Compliance. Say the high time is longer than the low time, then the integration result will rise to higher than Vcc. 3. Needs to be reset. To fix the above problems and return to "ground zero" you have to reset integrators. This makes things a lot more complicated. 4. Lag/stray capacitance. Fast integration is difficult. 5. Averaging. What's the numeric integral of a perfect sine over one cycle? 0. Sample square + differentiator: (conveniently have one on the breadboard at the moment) Best bet is to skip integration and either count stuff or differentiate and then count/measure time if you can apply it to the problem. If you can measure the peak and the time between the leading and trailing edges, then you can derive what happens between. Mathematics rarely matches the real world precisely, and perhaps unfortunately. Last edited by MrBungle; 28th Dec 2017 at 8:48 pm. |
28th Dec 2017, 10:25 pm | #7 |
Dekatron
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
|
Re: Integrals of waveforms?
The numerical approximation for differentiation is to pretend that the curve is a straight line from (x, y) to (x + δx, y + δy) and then say dy/dx = δy / δx.
You can write a program in your favourite language to produce lines of output of the form Code:
0,0 0.001,0.2 0.002,0.6 written to a file with the extension ".csv" and loaded into LibreOffice or Microsoft Excel and plotted as a graph.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments. |
29th Dec 2017, 3:30 pm | #8 |
Dekatron
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 3,077
|
Re: Integrals of waveforms?
Maybe try playing with GNU Octave for stuff like this? It's free to download and is a bit like Matlab.
There is a command line interface and a GUI/graphical interface for Octave. Also it runs on Windows or Linux or MAC etc https://www.gnu.org/software/octave/download.html The manual is here https://www.gnu.org/software/octave/octave.pdf It's worth going on youtube to download a few tutorials to see how easy it is to generate or load waveforms and then do stuff with the data. Plotting graphs is also easy with Octave.
__________________
Regards, Jeremy G0HZU |
29th Dec 2017, 10:19 pm | #9 |
Dekatron
Join Date: Jan 2004
Location: Newcastle upon Tyne, Tyne & Wear, UK.
Posts: 8,195
|
Re: Integrals of waveforms?
Hi Al, glad to see you are not yet trying to lift that transformer and sticking with brain ache not bodily strains.
Try the local ref library US Dept of Commerce, "Handbook or Mathematical Functions". There will also be some listing of both integrals and differentials of various function in Langford Smith, Radio Designers handbook and similar tomes. Best wishes for the new year, Ed |
29th Dec 2017, 11:03 pm | #10 | |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Quote:
I hope you have a restful and Happy New Year, too. I'll be in touch soon. Cheers for now!
__________________
Al |
|
29th Dec 2017, 11:09 pm | #11 |
Nonode
Join Date: Jan 2009
Location: Papamoa Beach, Bay of Plenty, New Zealand
Posts: 2,944
|
Re: Integrals of waveforms?
This book (from the mid-1970s) might also be useful if it can be found:
Integration - methodology as well as formulae - accounts for about two thirds of the content. Happy New Year! |
30th Dec 2017, 1:30 am | #12 | ||
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Quote:
Quote:
__________________
Al |
||
30th Dec 2017, 1:31 am | #13 | |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Quote:
Hey Julie, that's really interesting! Thank you
__________________
Al |
|
30th Dec 2017, 2:21 am | #14 |
No Longer a Member
Join Date: Oct 2016
Location: Maroochydore, Queensland, Australia.
Posts: 2,679
|
Re: Integrals of waveforms?
Hi Al,
One of the main reasons you might to want to integrate some shaped waveform is to calculate its rms value. I have attached ( a blue table ) of some rms values of common waves. A while back I was interested to find out how much energy loss there was in a spark plug with a 250k fouling resistance prior to a plug firing at 10kV (image attached). The shape of the rise is a sawtooth. So it required integration to add up the squares of the voltage over time and then a square root. I have attached the page and it shows that my calculations suggested that the general formula for this shaped wave was an rms value of 0.5777Vpeak , later I found from that blue table that the exact value was 0.5774Vpeak. So it is useful to be able to integrate waves at times, especially to help with power calculations and energy loss/dissipation issues. Finally, we all know that when it comes to differentiation of signals, noise and HF instability is a big issue. However, there is a trick where instead of differentiating you can integrate instead, or at least LPF the signal, then use a subtracting amplifier with the original signal. Circuit attached, which works to 5MHz, might interest Mr Bungle & Radio Wrangler too. |
30th Dec 2017, 4:43 am | #15 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,902
|
Re: Integrals of waveforms?
(1-LPF) is a very useful trick. I've also used 1-(moving average) often as a DSP DC remover after an ADC when digitising a finite-frequency IF signal. It provides a quick and efficient highpass function.
The problem with integrators is they like to drift off to infinity and need a whiff of feedback to keep them sane. David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
30th Dec 2017, 9:50 am | #16 | |
Dekatron
Join Date: Feb 2007
Location: Lynton, N. Devon, UK.
Posts: 7,088
|
Re: Integrals of waveforms?
Quote:
From the top, the averages are: Wrong (zero); right; wrong; right; wrong; wrong. To give the values shown, the waveforms would all have to be full-wave rectified so that the negative portions were 'flipped' over to become positive. |
|
30th Dec 2017, 10:20 am | #17 |
No Longer a Member
Join Date: Oct 2016
Location: Maroochydore, Queensland, Australia.
Posts: 2,679
|
Re: Integrals of waveforms?
That's right. I should have cut those average values off the side of the table before I posted it as it was the rms values I was referring to and the issue of integration.
The averages only look wrong because in isolation the table is out of context, it was trying to indicate what the averages of the waveforms would show on a meter if they were full wave rectified first, the article was in fact about making meters ! |
30th Dec 2017, 1:17 pm | #18 |
Dekatron
Join Date: Feb 2007
Location: Lynton, N. Devon, UK.
Posts: 7,088
|
Re: Integrals of waveforms?
Ah! So just confusion caused by quoting out of context. Yes, in a meter circuit, preceded by FW rectifier, it'd make perfect sense.
Referring to Astral's post, like Radio Wrangler, I tend to think it's the derivative, not the integral, of the waveforms that are needed. Integral of a current is charge, which is not often used by us folks except when determining the eventual voltage on a capacitor. Integral of a voltage is magnetic flux, only useful when designing transformers and inductors. But the derivative of a voltage waveform gives current in a capacitor (so it's useful!) and derivative of a current waveform gives voltage across an inductor (so again it's useful, to estimate the magnitude of switch-off spikes). Can we have a bit more info? It sounds intriguing! |
30th Dec 2017, 8:07 pm | #19 |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Thank you Hugo, that's a really interesting experiment and immaculately catalogued, as usual! The circuit is great - I'll take a closer look at how to use it.
Hugo and David (thanks too) yes, I now note how 1-LPF is helpful...
__________________
Al |
30th Dec 2017, 8:16 pm | #20 | |
Dekatron
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
|
Re: Integrals of waveforms?
Quote:
(by measurement, approximation or by differentiation), the current in a capacitor (in a tank circuit, specifically) then I know that the current in the inductor in the same tank circuit is the same magnitude and opposite sign. Sure, it's all part of the current project... When I'm not able to physically work on construction, I like to step back and understand things more deeply, take notes, and really immerse myself in what could go non-linear (ie, catastrophic) on me when I up the ante in terms of power. You might recall that you sent me those amorphous alloy toroids (grey and green) a couple of years ago now, maybe longer - along with some notes you prepared and tech data? Between ops I've been gradually immersing myself in making and testing my own magnetics. This is proving really handy as I can now make a pretty decent gate transformer, and more recently, have built my own current transformers when to buy a commercial one of the same spec would cost silly money! Here (yellow trace) is a snapshot of current in a (similar to mine) big inductor at resonance, via a current transformer. I'm including it to show how variably variable the current is within a short switching period. This is one of the intriguing properties of such a circuit... attack and decay lengths moving around all the time, and the amplitude of current, too. Hence RMS values are pretty hopeless here. Someone might say, well, if you have the means to look at current waveforms on a 'scope, why bother with differentiation? And I'd say, why not? ;-)
__________________
Al Last edited by Al (astral highway); 30th Dec 2017 at 8:29 pm. |
|