Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Grind Calculator

Grind

Function: grind (<expr>) -- Option variable: grind The function grind prints <expr> to the console in a form suitable for input to Maxima. grind always returns done.

y(t) := b*t + a*t^2 + d*t^3 + e*t^4;
grind(diff(y(t),t));
yp(t) := 3*d*t^2+2*a*t+b;
yp(t-1);
grind(ratsimp((23/12)*yp(t-1)-(4/3)*yp(t-2)+(5/2)*yp(t-3)));

When <expr> is the name of a function or macro, grind prints the function or macro definition instead of just the name.

See also string, which returns a string instead of printing its output. grind attempts to print the expression in a manner which makes it slightly easier to read than the output of string.

When the variable grind is true, the output of string and stringout has the same format as that of grind; otherwise no attempt is made to specially format the output of those functions. The default value of the variable grind is false.

grind can also be specified as an argument of playback. When grind is present, playback prints input expressions in the same format as the grind function. Otherwise, no attempt is made to specially format input expressions.

grind evaluates its argument.

Examples:

          (%i1) aa + 1729;
          (%o1)                       aa + 1729
          (%i2) grind (%);
          aa+1729$
          (%o2)                         done
          (%i3) [aa, 1729, aa + 1729];
          (%o3)                 [aa, 1729, aa + 1729]
          (%i4) grind (%);
          [aa,1729,aa+1729]$
          (%o4)                         done
          (%i5) matrix ([aa, 17], [29, bb]);
                                     [ aa  17 ]
          (%o5)                      [        ]
                                     [ 29  bb ]
          (%i6) grind (%);
          matrix([aa,17],[29,bb])$
          (%o6)                         done
          (%i7) set (aa, 17, 29, bb);
          (%o7)                   {17, 29, aa, bb}
          (%i8) grind (%);
          {17,29,aa,bb}$
          (%o8)                         done
          (%i9) exp (aa / (bb + 17)^29);
                                          aa
                                      -----------
                                               29
                                      (bb + 17)
          (%o9)                     %e
          (%i10) grind (%);
          %e^(aa/(bb+17)^29)$
          (%o10)                        done
          (%i11) expr: expand ((aa + bb)^10);
                   10           9        2   8         3   7         4   6
          (%o11) bb   + 10 aa bb  + 45 aa  bb  + 120 aa  bb  + 210 aa  bb
                   5   5         6   4         7   3        8   2
           + 252 aa  bb  + 210 aa  bb  + 120 aa  bb  + 45 aa  bb
                  9        10
           + 10 aa  bb + aa
          (%i12) grind (expr);
          bb^10+10*aa*bb^9+45*aa^2*bb^8+120*aa^3*bb^7+210*aa^4*bb^6
               +252*aa^5*bb^5+210*aa^6*bb^4+120*aa^7*bb^3+45*aa^8*bb^2
               +10*aa^9*bb+aa^10$
          (%o12)                        done
          (%i13) string (expr);
          (%o13) bb^10+10*aa*bb^9+45*aa^2*bb^8+120*aa^3*bb^7+210*aa^4*bb^6\
          +252*aa^5*bb^5+210*aa^6*bb^4+120*aa^7*bb^3+45*aa^8*bb^2+10*aa^9*\
          bb+aa^10
          (%i14) cholesky (A):= block ([n : length (A), L : copymatrix (A),
            p : makelist (0, i, 1, length (A))], for i thru n do
            for j : i thru n do
            (x : L[i, j], x : x - sum (L[j, k] * L[i, k], k, 1, i - 1),
            if i = j then p[i] : 1 / sqrt(x) else L[j, i] : x * p[i]),
            for i thru n do L[i, i] : 1 / p[i],
            for i thru n do for j : i + 1 thru n do L[i, j] : 0, L)$
          (%i15) grind (cholesky);
          cholesky(A):=block(
                   [n:length(A),L:copymatrix(A),
                    p:makelist(0,i,1,length(A))],
                   for i thru n do
                       (for j from i thru n do
                            (x:L[i,j],x:x-sum(L[j,k]*L[i,k],k,1,i-1),
                             if i = j then p[i]:1/sqrt(x)
                                 else L[j,i]:x*p[i])),
                   for i thru n do L[i,i]:1/p[i],
                   for i thru n do (for j from i+1 thru n do L[i,j]:0),L)$
          (%o15)                        done
          (%i16) string (fundef (cholesky));
          (%o16) cholesky(A):=block([n:length(A),L:copymatrix(A),p:makelis\
          t(0,i,1,length(A))],for i thru n do (for j from i thru n do (x:L\
          [i,j],x:x-sum(L[j,k]*L[i,k],k,1,i-1),if i = j then p[i]:1/sqrt(x\
          ) else L[j,i]:x*p[i])),for i thru n do L[i,i]:1/p[i],for i thru \
          n do (for j from i+1 thru n do L[i,j]:0),L)

(%o1)                                true
(%i2) 

Grind Example

Related Examples

grind-solve

grind(solve(y2 = (-b/...

Calculate

grind-linsolve-ratsimp-tex

eq1:I + ri*(ta*Ba+tp*...

eq2:O + ro*((1-ta)*Ba...

eq3:Ba = (1-ta)*O+ta*I;

Calculate

grind-matrix

K : matrix( [k[0], k[...

RC : matrix([r[0], r[...

grind(K.RC);

Calculate

grind-integrate-subst

tau:T/(A+T);

a_T:A/(A+T);

eq:B+(C-B)*tau^2*(1-a...

Calculate

grind-linsolve

eq1 : n_i + t*r_i*n_b...

grind(linsolve(eq1, t));

eq2 : n_i + t*r_i*n_b...

Calculate

grind-integrate-subst

tau:T/(A+T);

a_T:A/(A+T);

eq:B+(C-B)*tau^2*(1-a...

Calculate

grind-linsolve-sqrt

eq0:X=x-(1/2)*(y+z);

eq1:Y=sqrt(3)*(y-z);

eq2:x+y+z=0;

Calculate

grind-solve

e01: 25*x^2+30*x*y+9*...

e02: 1*x^2+2*x*y+1*y^...

e03: -1*x^2+2*x*y-1*y...

Calculate

grind-integrate

tau:T/(A+T);

a_T:A/(A+T);

eq:B+(C-B)*tau^2*(1-a...

Calculate