10.06.2016 Views

eldo_user

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Eldo Netlist Setup<br />

Expressions<br />

Specifying the Simulation Time in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119<br />

Conditional Evaluation of Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119<br />

Specifying the Simulation Time in Expressions<br />

The current simulation time can be specified inside expressions using the TIME keyword.<br />

TIME is a variable returned by the simulator which gives the value of the current simulation<br />

time and may be used in subsequent calculations. The TIME variable may be used in the<br />

formulation of time-dependent expressions.<br />

The TIME variable may be used in conjunction with VALUE={EXPR} in resistors, capacitors,<br />

inductors, and E and G sources to specify devices/sources whose values vary with time.<br />

g1 1 0 value={TIME * 1u}<br />

r1 1 0 1<br />

.tran 1 10<br />

.print tran v(1)<br />

.end<br />

This specifies a voltage controlled current source between nodes 1 and 0. The current through<br />

g1 from node 1 to node 2 is equal to the current simulation time (TIME) multiplied by 1×10 −6 .<br />

Related Topics<br />

Expressions<br />

Conditional Evaluation of Expressions<br />

Conditional Evaluation of Expressions<br />

Parameters or source values can be evaluated in expressions containing conditional statements.<br />

Syntax<br />

VALIF(CONDITION,expression1,expression2)<br />

EVAL(CONDITION?expression1:expression2)<br />

If CONDITION is TRUE, then VALIF (or EVAL) returns expression1 else it returns<br />

expression2. The keyword VALIF (or EVAL) can be used in any expression. The VALIF<br />

operator also accepts strings in .PARAM statements. This is useful for selecting models<br />

according to parameter values.<br />

Examples<br />

.param p1 = 1.0<br />

.param p2 = 2.0<br />

.param p3 = valif(p1>p2,p1+1.5,p2+1.5)<br />

Here, P3 will be assigned the value 3.5.<br />

Eldo® User's Manual, 15.3 119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!