
Mupad can solve systems of equations too
You often want to solve an equation or system of equations, and then substitute that solution into a third
equation. You can use the ‘subs’ function to do this
All the [1]s and [2]s here are hard to understand. Their purpose to extract the solutions from the variable
‘sol.’ Notice that ‘sol’ is in curly parentheses {} (look at the example at the top of the page) – this means
sol contains a set (which happens to contain only a single solution – but in more complicated problems
there might be more than one solution). You need to extract the solution you want out of this set. Thus,
sol[1] extracts the first (and only) element from the set. In the first example, both the solutions for x and
y are extracted and substituted into eq3. In the second example, sol[1][1] substitutes only x. In the third,
sol[1][2] substitutes only y.
Of course not all equations can be solved exactly.
Commentaires sur ces manuels