Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

News:

Spectrum Software has released Micro-Cap 11, the eleventh generation of our SPICE circuit simulator.

For users of previous Micro-Cap versions, check out the new features available in the latest version. For those of you who are new to Micro-Cap, take our features tour to see what Micro-Cap has to offer.

 

divider

 

Stepping a Triangle Source Peak

 

Currently in MC5, it is possible to step the value of a component or a parameter in a model statement. In order to step the peak of a triangle source, two parameters of the pulse source would have to be stepped or a parameter in an equation would have to be stepped. There is not a way to do this directly in the Stepping dialog box although parameter stepping and simultaneous multiple component stepping will be added in a future version. The way to get around this is to step a component and reference its value in an equation from a nonlinear function source. The reason we don't use the pulse source model statement is that a model parameter must have a static definition when entering an analysis, but a voltage reference is a dynamic variable. The circuit used to step the peak of a triangle source appears below.

Stepping Circuit
The circuit merely consists of a battery and a nonlinear function voltage source. The battery is the component that will actually be stepped. The value of the battery is going to represent the time when the triangle source hits its peak. The triangle source is produced by the following equation:

(((t <= v(STEP)) * ((10 / v(STEP)) * t))) +
((10-(((10 / (1m - v(STEP))) * (t - v(STEP)))))*(t > v(STEP)))

This triangle is actually a combination of two different line equations that are delineated by relational operators. The relational operators produce a value of 0 or 1, and let you define time ranges that a particular part of the equation will be active in. The first part is:

(t <= v(STEP)) * ((10 / v(STEP)) * t)

This states that while the time is less than or equal to the value of the STEP battery than the equation will be a line with the slope of 10/v(STEP). When the time becomes larger than v(STEP) then this equation will produce a 0.

The second part of the equation is:

(10 - ((10 / (1m - v(STEP))) * (t - v(STEP)))) * (t > v(STEP))

This part is zero until the time reaches a value greater than the battery voltage and then it becomes the active portion of the equation. It defines a line starting at 10 with a slope (10/(1m-v(STEP))) so that it will reach zero at 1ms. This source is not repetitive.

In transient analysis, the dc.value parameter of the STEP battery is now stepped from 300u to 700u in increments of 100u. The simulation time has been set to 1ms which is the period that was assumed in the triangle source equation. As can be seen below, the peak of the triangle source is being stepped in a manner equivalent to the battery.

Stepping Analysis
 
Return to the main Newsletter page