MathCAD Decision Statement
MathCAD Decision Statement
(OP)
I have the following statements in a MathCAD 14 program:
X=1
Y=2000
XPRIME <== (X + 13) if X < 3
YPRIME <== (Y - 1) if X < 3
I find that the "if" statements are not executing, running the following debug lines generates "variable undefined" error, returned in red text.
Adding the two lines:
X=
Y=
does return 1 and 2000 respectively, so I know that the variables are good prior to the "if" statements.
XPRIME =
YPRIME =
What is wrong with the syntax? What am I missing?
X=1
Y=2000
XPRIME <== (X + 13) if X < 3
YPRIME <== (Y - 1) if X < 3
I find that the "if" statements are not executing, running the following debug lines generates "variable undefined" error, returned in red text.
Adding the two lines:
X=
Y=
does return 1 and 2000 respectively, so I know that the variables are good prior to the "if" statements.
XPRIME =
YPRIME =
What is wrong with the syntax? What am I missing?
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada





RE: MathCAD Decision Statement
If possible, could you post your worksheet downsaved as M11?
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: MathCAD Decision Statement
RE: MathCAD Decision Statement
Here is the program. I am correctly reading in the variables, but the decision block is not executing. Don't know why, struggling with the logic somewhat.
Much thanks. Program is attached.
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
Is this supposed to be a subprogram within Mathcad? You're using programming constructs in step 3, but using regular sheet constructs everywhere else. By program, I refer specifically to a worksheet component typified by a broad vertical bar with an assignment operator on the left, and a sequence of instructions on the right side.
It looks like you're trying to replicate the calculation from Zombeck's Astronomical Formulas, but in programmed function form?
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: MathCAD Decision Statement
The MathCAD syntax is something mysterious, I have been using website examples and some of the Help Tutorials to get a better understanding, but this one has proven to be more problematic. There is not a lot of reference material out there, "MathCAD for Dummies", that sort of thing.
The source algorithm for this one was Duffet-Smith. The program is not fully debugged yet, I need to add the October 1583 delimiter, but was working with the January/February correction at the time this "if statement" problem arose. Seems simple enough, just not executing properly.
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
RE: MathCAD Decision Statement
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
http://ww
http://fil
http://fil
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: MathCAD Decision Statement
RE: MathCAD Decision Statement
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
Peter
RE: MathCAD Decision Statement
Anyway, thanks to this threads respondants, using all the inputs, I got the program intended, which is attached below. Not perfect yet, but will work on AD years prior to 1582 Oct 15 and cases involving BC.
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada
RE: MathCAD Decision Statement
It runs correctly for years after 1582 October 15, and correct again for years -1 AD to 1582 October 15. For some odd reason I am exactly one day out for the BC years.
Thanks again.
Kenneth J Hueston, PEng
Principal
Sturni-Hueston Engineering Inc
Edmonton, Alberta Canada