This preview shows page 1. Sign up to view the full content.
Unformatted text preview: an assumption on the variable, namely that it is an integer. In addition, with the fsolve command you can specify the range in which to look for a solution. Thereby you may gain more control over the solution.
> fsolve({sin(x)=0}, {x}, 3..4); {x = 3.14159265358979323846264338328} These types of problems are common to all symbolic computation systems, and are symptoms of the natural limitations of an algorithmic approach to equation solving. When using solve, check your results. Removable Singularities The following example highlights an issue that can arise with removable singularities.
> expr := (x1)^2/(x^21); expr := (x − 1)2 x2 − 1 Maple ﬁnds a solution
> soln := solve({expr=0},{x}); soln := {x = 1} 3.2 Solving Numerically Using the fsolve Command • 57 but when you evaluate the expression at 1, you get 0/0.
> eval(expr, soln); Error, numeric exception: division by zero The limit shows that x = 1 is nearly a solution.
> Limit(expr, x=1); (x − 1)2 x→1 x2 − 1 lim
> value (%); 0 Maple displays a vertical line at the asymptote, unless you specify discont=true.
> plot(expr, x=5..5, y=10..10);
10 8 6 y 4 2 –4 –2 0 –2 –4 –6 –8 –10 2 x 4 Maple removes the singularity x = 1 from the expression before solving it. Independent of the method or tools you use to solve equations, always check your results using the eval command. 58 • Chapter 3: Finding Solutions 3.3 Other Solvers Maple contains many specialized solve commands. This section brieﬂy mentions some of them. If you require more details on any of these commands, use the help system by entering ? and the command name at the Maple prompt. Finding Integer Solutions
The isolve command ﬁnds integer solutions to equations, solving for all unknowns in the expression(s).
> isolve({3*x4*y=7}); {x = 5 + 4 _Z1 , y = 2 + 3 _Z1 } Maple uses the global names _Z1, . . . , _Zn to denote the integer parameters of the solution. Finding Solutions Modulo m
The msolve command solves equations in the integers modulo m (the positive representation for integers), solving for all unknowns in the expression(s).
> msolve({3*x4*y=1,7*x+y=2},17); {y = 6, x = 14}
> msolve({2^n=3},19); {n = 13 + 18 _Z1 ~} The tilde (~) on _Z1 indicates that msolve has placed an assumption on _Z1, in this case that _Z1 is an integer.
> about( _Z1 ); Originally _Z1, renamed _Z1~: is assumed to be: integer Section 6.2 Assumptions describes how you can place assumptions on unknowns. 3.4 Polynomials • 59 Solving Recurrence Relations
The rsolve command solves recurrence equations, returning an expression for the general term of the function.
> rsolve({f(n)=f(n1)+f(n2),f(0)=1,f(1)=1},{f(n)}); {f(n) = 1√ 1 1√ 1 1 1√ 1 1√ 5) ( 5 + )n + ( − 5) (− 5 + )n } (+ 2 10 2 2 2 10 2 2 For more information, refer to ?LREtools. 3.4 Polynomials A polynomial in Maple is an expression containing unknowns. Each term in the polynomial contains a product of the unknowns. For example, if the polynomia...
View
Full
Document
This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.
 Spring '12
 NIL
 Math, Division

Click to edit the document details