Created by
Created December 20, 2013
Last modified December 24, 2013
Tags laplace  

Summary

Unrelated signal may fail to plot when using a Laplace block.


Description

If signals fail to plot and a Laplace block is in use, then this may be helpful.

Sometimes in CL, the Laplace block transfer function 1/(s) simulates without problems as an integrator. Then later the same circuit behaves unexpectedly. In these cases adding a small constant may ensure the region of convergence is satisfied with L { 1/(s+1f) }.

[12/24/2013 updated:] Other example CL circuits use the workaround of adding a small constant of 1f (1e-15) or 1p (1e-12). See user: @signality for more Laplace uses. Perhaps more CircuitLab Laplace-Block documentation would help users understand why unrelated signals fail to plot without warnings or errors.

[12/24/2013 updated] A Laplace block with L {1/s} has a region of convergence (ROC) of s > 0 that the L{transfer function} must satisfy. Intuitively this prevents division by 0. While s > 0 is the most common ROC, mathematical references provide ROC for other transfer functions.

[12/24/2013 added] Side effects shown with two examples: (1) In Laplace terminology if f(t) is a constant k. Then the integral of k, in the Laplace domain is the transfer function { k/s }.

(2) In Laplace terminology if f(t) = k * exp(-at). Then the integral in the Laplace domain is the transfer function { k / (s+a) }. Notice this is example (1) multiplied by a negative or "decaying" exponential exp(-at) function. This provides users an insight to the side effects of adding a small constant.

"Decaying" exponential in this sense means that as t increases, the decay (amplitude attenuation) increases. In example (2) k is multiplied by slightly less and less than 1. So "decaying" (amplitude attenuation) describes what is done to the original function. For CL this helps drive circuit simulation to "converge" to a solution.

When the product (-at) is near 0, exp(-at) = 1. For example, exp(-1E-6) = 0.999999, a one part per million (PPM) error compared to 1. Thus, the original f(t) is amplitude distorted by this "decaying" error. This time increasing error is exp(-at), and is why the smallest possible "-a" is often used and CPU dependent. (Varies with simulation tools)

To control errors to under 1 PPM, the product (-at) must be less than -1E-6. Since "1f" represents 1 femto (= E-15). Then if a circuit integrates 31.7 years or 1E9 seconds, the product (-a*t) is (-1f * t) or (-1E-15 * 1E9) or -1E-6 and the "decaying" exponential error is the difference between 1 and exp(-1E-6), the desired 1 PPM error.

Clearly, for shorter simulation time periods than 32 years the error will be less. In my opinion, most users will not notice this amplitude error, and "real" circuits will have much greater sources of error from leakage and parasitics. So this workaround handles most situations.


Comments

@John Figueroa (integerlaw)

Good post! Well spotted.

FYI:

I discovered this workaround some years ago using spice. In spice this small offset seems to be always necessary.

I must confess, I have never explored exactly why this is so.

:)

Here are some more examples of this workaround in CL:

https://www.circuitlab.com/circuit/ua9a82/voltage-controlled-oscillators-01/

https://www.circuitlab.com/circuit/f73b76/modulated-sources-01/

by signality
December 23, 2013

Thanks for the comments. The "description" sentence regarding the region of convergence for 1/s was updated to point out that s>0 is not general.

More generally find the L {TF:} region of convergence as listed in this wiki table.

http://en.wikipedia.org/wiki/Laplace_transform#Table_of_selected_Laplace_transforms

A deeper understanding of the ROC is given widely at ".edu" sites. But this wiki link is a good start, even though terse.

http://en.wikipedia.org/wiki/Laplace_transform#Region_of_convergence

by integerlaw
December 24, 2013

While updating the "description" it seemed that delaying the start of simulation to 1 nsec instead of 0 sec might provide an alternate solution, based on the definition of the Laplace transform. But the test was not successful.

by integerlaw
December 24, 2013

@signality
Your comparisons to other common simulators are great insights to CL users like myself. You provide a great service in sharing your multi-platform experience. I will contact a simulator developer (HSPICE) to inquire further, and reference your observations.

by integerlaw
December 26, 2013

Leave a Comment

Please sign in or create an account to comment.

Revision History

Only the circuit's creator can access stored revision history.