One of the most useful functions for behavioural modelling. Hyperbolic Tan is a very good function to represent bjt longtail pair transfer functions and can be used as the core of an arbitrary opamp model. It allows very simple modelling of comparators, limit functions and clamping circuits. The same things can be done using the ATAN(x) function but are much less elegant. Functions using ATAN(x) end up more unwieldy and less intuitive. In my experience, TANH(x) tends to converge better than ATAN(x). I have a huge library of SPICE behavioural models, many of which use the TANH(x) function but which I can't port to CircuitLab because (a) there's no TANH(x) function and (b) there's no equivalent of the SPICE arbitrary functional B source to use them in. A few examples: Comparator with 0 - 1V output:
V=0.5 Ideal opamp with +/-5V output swing:
V=5 An ATAN(x) version of the same thing:
V=2/pi Ideal opamp with 0V to +5V output swing:
V=2.5 non-inverting schmitt with 0 - 1V output
V=0.5 inverting schmitt with 0 - 1V output
V=0.5 A bit more exotic .... A window comparator:
V=0.5 Very simple 3 terminal linear regulator/reference
reference voltage = vref and with dropout voltage = vdo:
V=0.5 Latching current_ramp generator.
Has a capacitor from OUT to ground (with a 1G in parallel to provide a ground return)
Put in voltage pulse in of >10mV and a duration long enough to cause VOUT to ramp up to > VMIN and o/p will ramp to VSTOP at rate governed by IOUT/C1
(From CV = IT)
IOUT An open loop function that limits output voltage to VLIM.
Does not require the closed loop technique of using an opamp with a limited output voltage swing.
Therefore, this function can be built inside other functions.
Note that the G parameter may need to be adjusted to minimise under/overshoot.
0.5 A track and hold:
Requires a capacitor from OUT to ground.
V(track) = 1 => V(OUT) tracks V(IN)
V(track) = 0 => V(OUT) held at value when V(track) 1 => 0 edge.
I=V(track) Big ask? Big please! :) |
by signality
March 26, 2012 |

Many of these should now be possible with our new support for arbitrary behavioral sources. See the blog post announcement. |
by mrobbins
April 13, 2012 |

Fantastic! It's like Christmas on Friday the 13th!! I p.s. sorry about the formatting hell in my original post: Markdown mangled some of the "*" symbols in my expressions. So, now that we have behavioural sources, is there a way to post expressions into the forums without Markdown mangling them but which preserves them so that they can be cut and pasted straight into a behavioural source in a schematic? :) |
by signality
April 14, 2012 |

Please sign in or create an account to comment.

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.