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
alter_element with an RPN equation and -macro
Moderators: cyao, michael_borland
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: alter_element with an RPN equation and -macro
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
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
-
- Posts: 9
- Joined: 20 Dec 2016, 08:45
Re: alter_element with an RPN equation and -macro
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?
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: alter_element with an RPN equation and -macro
Daniel,
It's discussed in section 7.2, General Command Syntax. We'll add some information elsewhere, as you suggest.
--Michael
It's discussed in section 7.2, General Command Syntax. We'll add some information elsewhere, as you suggest.
--Michael