10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Post-Processing Library<br />

evalExpr<br />

evalExpr<br />

Evaluates an expression in C-like syntax. The evalExpr command enables evaluation of an<br />

expression written using C-like syntax. It can contain both numbers and/or waves. Quotes are<br />

mandatory. If the expression is purely numerical a single value is returned. Otherwise the result<br />

is a vector and is printed using the display command format (display command and output will<br />

be described later). The PPL is able to handle complex arguments, and display them correctly.<br />

Tip<br />

This command is more likely to be used with numerical expressions whereas the defineVec<br />

command is for wave calculations.<br />

Syntax<br />

evalExpr expression<br />

Arguments<br />

• expression<br />

Expression to be evaluated.<br />

Examples<br />

This example demonstrates the evalExpr command. If the .tcl file contains:<br />

proc EVAL_EXPR { wv_in } {<br />

# evalExpr using numbers<br />

set a 3<br />

set numerical [evalExpr "2*$a + 4"]<br />

puts "numerical = $numerical"<br />

# evalExpr using waves<br />

set vector [evalExpr "2*$wv_in + 4"]<br />

puts "vector = $vector"<br />

}<br />

The following simple call to this function from the Eldo command in the .cir file:<br />

.call_tcl tran when=END_OF_RUN EVAL_EXPR(v(1))<br />

produces the following output:<br />

numerical = 10.00000000000000<br />

vector = { 0 0.00000000000000 4.00000000000000 + 0.00000000000000j }<br />

{ 1 0.00000000002000 4.50133293425722 }<br />

{ 2 0.00000000003900 4.97030313987119 }<br />

{ 3 0.00000000007699 5.86034757905359 }<br />

{ 4 0.00000000015297 7.27942102760290 }<br />

{ 5 0.00000000022966 7.96738275669581 }<br />

{ 6 0.00000000025000 8.00000000000000 }<br />

{ 7 0.00000000029068 7.87006296906364 }<br />

{ 8 0.00000000035325 7.18743864881722 }<br />

1144<br />

Eldo® User's Manual, 15.3

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

Saved successfully!

Ooh no, something went wrong!