Maxima – 40 – Espressioni – 9

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.122.

substinpart (x, expr, n_1, ... , n_k)
Similar to substpart, but substinpart works on the internal representation of expr.

(%i1) x . 'diff (f(x), x, 2);
                                     2
                                    d
(%o1)                          x . (--- (f(x)))
                                      2
                                    dx
(%i2) substinpart (d^2, %, 2);
                                         2
(%o2)                               x . d
(%i3) substinpart (f1, f[1](x + 1), 0);
(%o3)                              f1(x + 1)

mmmystero 🤢

If the last argument to a part function is a list of indices then several subexpressions are picked out, each one corresponding to an index of the list. Thus

(%i4) part (x + y + z, [1, 3]);
(%o4)                                z + x

piece holds the value of the last expression selected when using the part functions. It is set during the execution of the function and thus may be referred to in the function itself as shown below. If partswitch is set to true then end is returned when a selected part of an expression doesn’t exist, otherwise an error message is given.

(%i5) expr: 27*y^3 + 54*x*y^2 + 36*x^2*y + y + 8*x^3 + x + 1;
                     3         2       2            3
(%o5)            27 y  + 54 x y  + 36 x  y + y + 8 x  + x + 1
(%i6) part (expr, 2, [1, 3]);
                                         2
(%o6)                                54 y
(%i7) sqrt (piece/54);
(%o7)                               abs(y)
(%i8) substpart (factor (piece), expr, [1, 2, 3, 5]);
                                      3
(%o8)                      (3 y + 2 x)  + y + x + 1
(%i9) expr: 1/x + y/x - 1/z;
                                    1    y   1
(%o9)                            (- -) + - + -
                                    z    x   x
(%i10) substpart (xthru (piece), expr, [2, 3]);
                                   y + 1   1
(%o10)                             ----- - -
                                     x     z

Also, setting the option inflag to true and calling part or substpart is the same as calling inpart or substinpart.

substpart (x, expr, n_1, . . . , n_k)
Substitutes x for the subexpression picked out by the rest of the arguments as in part. It returns the new value of expr. x may be some operator to be substituted for an operator of expr. In some cases x needs to be enclosed in double-quotes " (e.g. substpart ("+", a*b, 0) yields b + a).

(%i11) 1/(x^2 + 2);
                                      1
(%o11)                              ------
                                     2
                                    x  + 2
(%i12) substpart (3/2, %, 2, 1, 2);
                                      1
(%o12)                             --------
                                    3/2
                                   x    + 2
(%i13) a*x + f(b, y);
(%o13)                           a x + f(b, y)
(%i14) substpart ("+", %, 1, 0);
(%o14)                          x + f(b, y) + a

Also, setting the option inflag to true and calling part or substpart is the same as calling inpart or substinpart.

symbolp (expr)
Returns true if expr is a symbol, else false.

unorder ()
Disables the aliasing created by the last use of the ordering commands ordergreat and orderless. ordergreat and orderless may not be used more than one time each without calling unorder. unorder does not substitute back in expressions the original symbols for the aliases introduced by ordergreat and orderless. Therefore, after execution of unorder the aliases appear in previous expressions.

ordergreat(a) introduces an alias for the symbol a. Therefore, the difference of %o2 and %o4 does not vanish. unorder does not substitute back the symbol a and the alias appears in the output %o7.

L’esempio del manuale non riesco a riprodurlo, neanche con wxMaxima, salto.

verbify (f)
Returns the verb form of the function name f. See also verb, noun, and nounify.

(%i8) verbify ('foo);
(%o8)                                 foo
(%i9) :lisp $%

$FOO
(%i9) nounify (foo);
(%o9)                                 foo
(%i10) :lisp $%

%FOO

â­•

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

%d blogger hanno fatto clic su Mi Piace per questo: