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

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

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