Contents Changes to MuPAD 1.2.2 Advanced Calculus Polynomials Linear Algebra Graphics Gröbner Bases Further Nice Examples
There are three main differences of MuPAD 1.2.9 with respect to MuPAD 1.2.2 concerning the use of its libraries.
loadlib
command.
domains
Library are now shared
into three domains:
Ax
;
Cat
;
Dom
.
Therefore, the use of them is now quite different to that of MuPAD 1.2.2. We give some few examples to demonstrate this.
Without the statement loadlib("domains")
we can create the ring of square matrices over Z mod 4:
>> M:= Dom::SquareMatrix( 3, Dom::IntegerMod(4) );
Dom::SquareMatrix(3, Dom::IntegerMod(4))However, instead of the domain constructor
Matrix
and IntegerMod
we have to call these constructors as
Dom::SquareMatrix
and Dom::IntegerMod
Let us create a matrix by random:
>> A:= M::random();
+- -+ | 1 mod 4, 2 mod 4, 1 mod 4 | | | | 3 mod 4, 0 mod 4, 2 mod 4 | | | | 1 mod 4, 0 mod 4, 1 mod 4 | +- -+
We can check whether M
represents a ring or
a commutative ring in MuPAD:
>> M::hasProp( Cat::Ring ), M::hasProp( Cat::CommutativeRing );
TRUE, FALSEBut now we have to call the categories
Ring
and CommutativeRing
as methods of the
domain Cat
!
Moreover, without an explicit load of the package linalg
we can use its function det
:
>> linalg::det( A );
2 mod 4
The user can export the methods of these domains using the
command export
. Therefore, after
the statements
>> export( Ax ): export( Cat ): export( Dom ):it suffices to write, for instance,
>> M:= Matrix( DistributedPolynomial( [x], Integer ) );
Dom::Matrix(Dom::DistributedPolynomial([x], Dom::Integer))
>> expr:= exp( x^2 )*ln(x-1);
Error: Illegal assignment. Identifier is write protected [expr]Moreover, if a value is assigned to an identifier that reflects a valid option of a corresponding function a warning message will be given to the user. See for example the identifier
RatExpr
that is a valid option of the system function
indets
:
>> RatExpr:= (x^2+1)/(x-1);
Warning: protected variable RatExpr overwritten 2 x + 1 ------ x - 1Hence, an indentifier can either be not proctected (option \Mexpr{None}), be proctected such that a warning message will be given in that case where its value is changed (option
Warning
}) or be proctected
such that an assignment is forbidden and therefore will lead to an error
(option Error
).
The function protected
can be used
to change the state of an identifier. Use one of the above options
to define the kind of write protect:
>> protected( hold(RatExpr), None ): RatExpr:= (x^2+1)/(x-1);
2 x + 1 ------ x - 1Moreover, the function
sysassign
can
be used to force an assignment to an identifier without taking
into account whether it is write protected or not.
It is recomended to change the kind of write protect of an identifier with caution because this can lead to problems when using library functions.