The until function has no effect when its first argument involves no range variables. When the first argument does involve a range variable, Mathcad will iterate until the first argument evaluates to a negative value. Mathcad’s until function allows you to halt an iteration when a particular condition is met. As explained in Chapter 12, “Operators,” boolean operators can also be used to order string expressions character by character based on ASCII codes. The following table shows the meaning of boolean expressions with numbers (x and y can be real scalars, while wand z can be complex scalars). That point of discontinuity is specified by its first argument, condo The remaining two arguments let you specify the behavior of the function on either side of that discontinuity.Īlthough the argument cond can be any expression at all, it is usually more convenient to use a boolean expression from the table below. Use if to define a function that behaves one way below a certain number and behaves completely differently above that number. Although this function is of limited applicability, it would be difficult to perform this function using any other combination of Mathcad functions This returns a 0, 1,or -1 depending on the permutation of its arguments. The last function is £, the completely anti-symmetric tensor function. Mathcad Professional, however, also includes specialized programming operators that allow you to control iteration, as described in Chapter 18, “Programming.” This is the only Mathcad function which can actually halt iteration upon the occurrence of a condition. It is unique among Mathcad functions because it is designed to work only with range variables. The until function is used to drive iteration. The Heaviside step function, (x), and the Kronecker Delta function, o(m, n), are special cases of the if function.
The iffunction is useful for choosing one of two values based on a condition. There are five Mathcad functions falling into this category.
Piecewise continuous functions are useful for branching and iteration.