PDF-Version - am Institut für Baustatik
PDF-Version - am Institut für Baustatik
PDF-Version - am Institut für Baustatik
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
solset := {x = -1, y = 2}, {x = 2, y = 1/2}<br />
> assign (solset[1]); x,y;<br />
-1,2<br />
When there is a choice of solutions to assign, and you haven't specified a particular choice by<br />
subscripting a particular solution in the set, assign will chose one solution to apply to the independent<br />
variables.<br />
You can make temporary assignments to mathematical variables using the function subs. This allows<br />
you to evaluate an expression for a given set of values, without turning the mathematical variables into<br />
progr<strong>am</strong>ming variables. Given that Maple generally applies full evaluation, this is an important feature.<br />
By giving subs a sequence of variable bindings and an expression, you can "test" the expression with<br />
those values:<br />
> # z is a progr<strong>am</strong>ming variable:<br />
> z;<br />
z<br />
> f := cos(z);<br />
f := cos(z)<br />
> # Now, to see what f(2) is:<br />
> subs(z=Pi, f);<br />
cos(Pi)<br />
> # Force evaluation to simplify the result:<br />
> eval(%);<br />
-1<br />
> # Now check to see the value of z:<br />
> z;<br />
z<br />
11.3.9 Printing and Plotting Values (Drucken und Plotten)<br />
When you give Maple a command, there is generally some form of expression that is the output, or<br />
value, of the command. The "prettyprinted" output that you see is created by the Maple function print.<br />
There are other forms of output that you can specify. These functions are:<br />
• lprint: print the expression in a linear format<br />
• fortran: print the expression according to Fortran 77 syntax<br />
• eqn: create an eqn version of the expression for the troff document processor<br />
• atex: generate a LaTeX description for the expression<br />
Here is an ex<strong>am</strong>ple to show the difference between print and lprint:<br />
> f := (a*b)/(c*d), c^d:<br />
> print(f);<br />
a b d<br />
---, c<br />
c d<br />
> lprint(f);<br />
a*b/c/d c**d<br />
You can also plot expressions in Maple. Two-dimensional plots are generated using the plot<br />
command, which works both in tty- and X-sessions. The basic syntax of the plot command is plot<br />
(function, range), or plot (f(x), x=a..b). For instance:<br />
> plot (cos(x), x = 0..Pi);<br />
112