Download MuPAD User's Guide

Transcript
Use Permanent Assumptions
The variable h in the equation represents the height from which the object falls. If you do
not consider that someone initially throws the object upward and that the object reflects
from the ground, the height h is always positive. Therefore, you can assume that both
gravitational acceleration g and height h are positive:
assume(g > 0 and h > 0);
t = solve(h = g*t^2/2, t)
Assuming that the time of the drop is a positive value, you get the expected result. When
you set assumptions on variables, the solver compares the obtained solutions with the
specified assumptions. This additional task can slow down the solver:
assume(g > 0 and h > 0 and t > 0);
t := solve(h = g*t^2/2, t)
The solver returns the solutions as a set, even if the set contains only one element. To
access the elements of a solution set, use square brackets or the op command:
time = t[1]
Clear the variable t for further computations:
delete t
If you set several assumptions for the same object, each new assumption overwrites the
previous one:
assume(h in R_);
assume(h <> 0);
is(h in R_), is(h <> 0)
3-117