alter_element with an RPN equation and -macro

Moderators: cyao, michael_borland

Post Reply
Chris Prokop
Posts: 7
Joined: 14 Apr 2012, 17:15

alter_element with an RPN equation and -macro

Post by Chris Prokop » 19 Apr 2012, 18:55

Hi,

I am attempting to use alter_element to modify several components of an EMATRIX based on a -macro entered at the command line. Each of the components that I am changing is to be replaced with an equation, usually a function of the variable specified with the -macro command. However, it appears that only the first term in the equation is being used in the transfer matrix.

For example, if I use:
&alter_elements
name = TDC_*,
item = R12
value = "0.07687 2.0 /"
&end

The R12 element will then become (by inspecting the .matext file)
R12 = 0.07687 M

i.e. ignoring the division by two. Likewise,

&alter_elements
name = TDC_*,
item = R65
value ="$TDCSTRENGTH $TDCSTRENGTH * 0.07687 * 8 /"
&end

with -macro=TDCSTRENGTH=1.5 gives

R65 = 1.5 1/M

What am I doing wrong?

Thanks,
Chris

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: alter_element with an RPN equation and -macro

Post by michael_borland » 23 Jul 2012, 20:31

Chris,

Sorry, I just saw this in going through some old posts.

The correct syntax is
&alter_elements
name = TDC_*,
item = R12
value = "(0.07687 2.0 /)"
&end

and

&alter_elements
name = TDC_*,
item = R65
value ="($TDCSTRENGTH $TDCSTRENGTH * 0.07687 * 8 /)"
&end

--Michael

daniel.marx
Posts: 9
Joined: 20 Dec 2016, 08:45

Re: alter_element with an RPN equation and -macro

Post by daniel.marx » 13 Mar 2018, 04:50

I was also confused by this until I saw this post. May I suggest that a note about parentheses is added to the alter_elements entry in the manual?

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: alter_element with an RPN equation and -macro

Post by michael_borland » 13 Mar 2018, 08:13

Daniel,

It's discussed in section 7.2, General Command Syntax. We'll add some information elsewhere, as you suggest.

--Michael

Post Reply