Some of the most common waveforms needed in simulating voltage and current sources are sine, square, triangular and sawtooth shapes.
LTspice® simulation software has a built-in pulse, sine, exponential, single frequency FM and an arbitrary piece-wise linear functions available in the source component editor. Although it may not look like it, LTspice does have a triangular and sawtooth functions available but they need to be created from either a PULSE or PWL function.
Karen Valentine, Actress: Room 222. Karen Valentine was born on a chicken farm in northern California and made her professional debut, at the age of 16, on The Ed Sullivan Show (1948) (aka 'The Ed Sullivan Show'). After performing as a contestant on a live national broadcast of 'The Miss Teenage America Pageant', Ed Sullivan phoned during the ceremonies and invited her to appear on. Ah yes, the old hold-Shift-near-a-mask-point-to-proportionally-resize-it trick.Sometimes I wonder about Adobe's decisions. Coming from After Effects where things are a lot more sensible (double-click the mask to bring up a visual transform gizmo, or hit Ctrl+T, same as Photoshop), it never occurred to me that there was a mysterious hidden way to do this and, until this point. A healthy mac and cheese recipe that is packed with protein, broccoli and spinach. Perfect as a full meal and a sneaky way to get your kids to eat more veggies. Subscribe to grab a free 3 day clean eating meal plan. By 'my page' I meant the piece of thing I'm working on. My 'page' is 1922 pixels wide, and forget about the length. I want to divide it in to four to five perfect sections of 480.5 pixels or 384.4 pixels, I was wondering how you could do that.
PULSE Function
PULSE fuction is often used in transient circuit simulation where we want the source to behave like a square wave. You can omit Ncycles if you need a free-running square waveform.
PULSE(Voff Von Tdelay Trise Tfall Ton Tperiod Ncycles)
A simple approach to creating a triangular and sawtooth waveform is using the PULSE fuction using the source component editor shown above. For the triangular waveform you can set the rise and fall time equal to 1/2 of your desired period in your pulse function. Likewise, to create a sawtooth fuction you cab set the rise time equal to the period and the fall time to zero. The PULSE function can be further modify to best match your simulation needs. Waveforms for these two fuctions are show on the top of the page.
PWL Function
For any arbitrary or complex waveform, you can always rely on the piece-wise linear function. The arbitrary piece-wise linear fuction is defined by a sequence of time and voltage pairs.
PWL(t1 v1 t2 v2 t3 v3...)
This specifies that for time before t1, the voltage is v1. For times between t1 and t2, the voltage varies linearly between v1 and v2. There can be any number of time, voltage points given and for times after the last time, the voltage is the last voltage.
To implement a triangular or sawtooth waveform you could use the following piece-wise linear functions. Waveforms for these two fuctions are show on the top of the page.
These two examples use an undocumented repeat feature of PWL function. To explore these features you will need to directly edit by right-clicking on the source symbol's text in the schematic editor rather than using the source component editor.
Here are some highlights of the undocumented features for the PWL fuction:
- Repeat date pairs forever
PWL REPEAT FOREVER (0 0 .5 1 1 0) ENDREPEAT
- Repeat data pairs for 5 cycles
PWL REPEAT 5 (0 0 .5 1 1 0) ENDREPEAT
- A trigger expression that turns the source on as long as the expression is true
PWL (0 0 .5 1 1 0) TRIGGER V(node)>1
- Scaled the time or source values
PWL TIME_SCALE_FACTOR=0.5 VALUE_SCALE_FACTOR=2 (0 0 .5 1 1 0)
1.1 Perfect Squares And Related Patternsmr. Mac's Page Sheet
More information on the pulse, sine, exponential, single frequency FM and an arbitrary piece-wise linear functions is available in the LTspice help file (F1). An example LTspice simulation is also provided below for your reference.