$SPAD/src/input equation.input

Johannes Grabmeier and Timothy Daly

December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool equation.output
)set message test on
)set message auto off
)clear all

———-

To ease the use of equation (more user friendly applications) I have enhanced the datatype Equation to have more mathematical richness.

First of all now you can embed s from S to Equation S as s = s. This allows to easily manipulate equations bring terms from one side to the other by simply adding or multiplying or ... provided, that the equation domain inherits the structure of the underlying S.

So I went through the code saying

If S has BlaBla then BlaBla

for the most important structures, please suggest others if necessary, Steve, do we have a more general method in the new compiler rather than repeating all these definitions as

inv(eq) == inv lhs eq = inv rhs eq

Furthermore, we have function to put 0 or 1 on one side and factor the left hand side, after the right hand side is 0 and we have an IntegralDomain.

— * —

--S 1 of 12
eq1 := (-6*x**3+13*x**2+4)=(-x**4+12*x)
--R
--R
--R            3      2         4
--R   (1)  - 6x  + 13x  + 4= - x  + 12x
--R                                          Type: Equation(Polynomial(Integer))
--E 1
--S 2 of 12
eq2 := x**4+13*x**2-12*x = 6*x**3-4
--R
--R
--R         4      2          3
--R   (2)  x  + 13x  - 12x= 6x  - 4
--R                                          Type: Equation(Polynomial(Integer))

--E 2
--S 3 of 12
eq := eq1*y**2+eq2
--R
--R
--R             3      2      2    4      2            4        2     3
--R   (3)  (- 6x  + 13x  + 4)y  + x  + 13x  - 12x= (- x  + 12x)y  + 6x  - 4
--R                                          Type: Equation(Polynomial(Integer))
--E 3
--S 4 of 12
swap %
--R
--R
--R            4        2     3           3      2      2    4      2
--R   (4)  (- x  + 12x)y  + 6x  - 4= (- 6x  + 13x  + 4)y  + x  + 13x  - 12x
--R                                          Type: Equation(Polynomial(Integer))
--E 4
--S 5 of 12
% + 4
--R
--R
--R            4        2     3       3      2      2    4      2
--R   (5)  (- x  + 12x)y  + 6x = (- 6x  + 13x  + 4)y  + x  + 13x  - 12x + 4
--R                                          Type: Equation(Polynomial(Integer))
--E 5
--S 6 of 12
%-6*x**3
--R
--R
--R            4        2       3      2      2    4     3      2
--R   (6)  (- x  + 12x)y = (- 6x  + 13x  + 4)y  + x  - 6x  + 13x  - 12x + 4
--R                                          Type: Equation(Polynomial(Integer))
--E 6
--S 7 of 12
leftZero %
--R
--R
--R             4     3      2            2    4     3      2
--R   (7)  0= (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4
--R                                          Type: Equation(Polynomial(Integer))
--E 7
--S 8 of 12
swap %
--R

--R
--R          4     3      2            2    4     3      2
--R   (8)  (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4= 0
--R                                          Type: Equation(Polynomial(Integer))
--E 8
--S 9 of 12
factor lhs %
--R
--R
--R               2       2  2
--R   (9)  (x - 2) (x - 1) (y  + 1)
--R                                          Type: Factored(Polynomial(Integer))
--E 9
--S 10 of 12
factorAndSplit eq
--R
--R
--R                             2
--R   (10)  [x - 2= 0,x - 1= 0,y  + 1= 0]
--R                                    Type: List(Equation(Polynomial(Integer)))
--E 10
--S 11 of 12
inv (eq :: EQ FRAC POLY INT)
--R
--R
--R                             1                                1
--R   (11)  - ------------------------------------= - ----------------------
--R              3      2      2    4      2            4        2     3
--R           (6x  - 13x  - 4)y  - x  - 13x  + 12x    (x  - 12x)y  - 6x  + 4
--R                                Type: Equation(Fraction(Polynomial(Integer)))
--E 11
--S 12 of 12
- %
--R
--R
--R                           1                              1
--R   (12)  ------------------------------------= ----------------------
--R            3      2      2    4      2          4        2     3
--R         (6x  - 13x  - 4)y  - x  - 13x  + 12x  (x  - 12x)y  - 6x  + 4
--R                                Type: Equation(Fraction(Polynomial(Integer)))
--E 12
)spool
)lisp (bye)

———-

References^{[1] nothing}

6