Origin for each line in src/algebra.txt from check-in c1ddb4c814:

c1ddb4c814 2021-03-01 jeff@gridfini: %%%%%%%%%%%%%%%%%%%%%
c1ddb4c814 2021-03-01 jeff@gridfini: %  ALGEBRA (SOLVE)
c1ddb4c814 2021-03-01 jeff@gridfini: %%%%%%%%%%%%%%%%%%%%%
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Solve quadratic equation
c1ddb4c814 2021-03-01 jeff@gridfini: solve(x^2+8x+15=0, x);
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Solve for expression
c1ddb4c814 2021-03-01 jeff@gridfini: solve(a*log(sin(x+3))^2 - b, sin(x+3));
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Solve simultaneous equations
c1ddb4c814 2021-03-01 jeff@gridfini: solve({x+3y=7, y-x=1},{x,y});
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Solve a system with parameters
c1ddb4c814 2021-03-01 jeff@gridfini: solve({x=a*z+1, y=b*z},{z,x});
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Simplify expression
c1ddb4c814 2021-03-01 jeff@gridfini: ((((-r1*(1+k1))/(r2*(1+k2)))+((r1)/(r2)))/(((r1)/(r2))));
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Another solve example
c1ddb4c814 2021-03-01 jeff@gridfini: % Note the use of $ as the line termination 
c1ddb4c814 2021-03-01 jeff@gridfini: % character to suppress output from
c1ddb4c814 2021-03-01 jeff@gridfini: % intermediate computations
c1ddb4c814 2021-03-01 jeff@gridfini: x1 := sqrt(h^2 + p1^2)$
c1ddb4c814 2021-03-01 jeff@gridfini: x2 := sqrt((h/2)^2 + (p-p1)^2)$
c1ddb4c814 2021-03-01 jeff@gridfini: x3 := x1 + x2$
c1ddb4c814 2021-03-01 jeff@gridfini: dx := df(x3, p1)$
c1ddb4c814 2021-03-01 jeff@gridfini: solve(dx, p1);
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Suppose you are given the equation
c1ddb4c814 2021-03-01 jeff@gridfini: % x^2+x+1=0 and wish to determine the
c1ddb4c814 2021-03-01 jeff@gridfini: % value of x^3.  The following simple
c1ddb4c814 2021-03-01 jeff@gridfini: % substitution achieves this.
c1ddb4c814 2021-03-01 jeff@gridfini: rule := solve(x^2+x+1=0,x)$
c1ddb4c814 2021-03-01 jeff@gridfini: y := (x^3 where rule);
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: % Then y=1, because
c1ddb4c814 2021-03-01 jeff@gridfini: % x^3=x*(x^2)=-x*(x+1)=-x^2-x=1.
c1ddb4c814 2021-03-01 jeff@gridfini: 
c1ddb4c814 2021-03-01 jeff@gridfini: end;

olli-scripts
English Homepage | German Homepage | DL2MIE | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]