EQUATION INDEX

EQUATION _ _ _ _ _ _ _ _ _ _ _ _ type

An equation is an expression where two algebraic expressions are connected by the (infix) operator equal or by =. For access to the components of an equation the operators lhs, rhs or part can be used. The evaluation of the left-hand side of an equation is controlled by the switch evallhseqp, while the right-hand side is evaluated unconditionally. When an equation is part of a logical expression, e.g. in a if or while statement, the equation is evaluated by subtracting both sides can comparing the result with zero.

Equations occur in many contexts, e.g. as arguments of the sub operator and in the arguments and the results of the operator solve. An equation can be member of a list and you may assign an equation to a variable. Elementary arithmetic is supported for equations: if evallhseqp is on, you may add and subtract equations, and you can combine an equation with a scalar expression by addition, subtraction, multiplication, division and raise an equation to a power.

examples:


on evallhseqp;

u:=x+y=1$

v:=2x-y=0$

2*u-v; 

  - 3*y=-2


ws/3; 

    2
  y=--
    3

Important: the equation must occur in the leftmost term of such an expression. For other operations, e.g. taking function values of both sides, use the map operator.