Sie sind auf Seite 1von 7

Lab 6: Nonlinear Equations (Mathematica)

Objective: For a given system of Non-linear equations we want to find the solution of
this system.
Method of solution:
Using the Solver & NSolve commands
Using find root command
Procedure: the following example illustrates the procedure:

Example: Find the solution of the following system of equation


f1 = x2-y2- 1
f2 = x3+2y2- 5
Using the Solver & NSolve commands
Step by step solution:
As we know the solution of the system means the values of x and y that satisfy both
equations
Step 1: Name both equations in two names (or you can name both of them in one
name) as follows :

Name eq1  Note this sign (==) it is a 
& eq2  must in all equations 
Step 2: Use the Solve command as follows:
The Solver command (notes the 
capital letter at the beginning ) 

The solution here is too long 
because the mathematica give a 
symbolic solution 

Step 3: To get the numerical solution us NSolve command as follows :

The NSolver command (notes the 
capital letters at the beginning ) 

The numerical solution 
Using the FindRoot commands
Step 1: Try to draw both functions to see where the are intersect (these intersection
pointes are the solution of this system on equation)

Firs you have to load the 
(Graphic ’ImplicitPlot) 
command(you can load it 
from help

Then plot the firs equation 
( x2-y2- 1 ) using this 
command (ImplicitPlot)
Then plot the second equation 
( x2-y2- 1 ) using this command 
(ImplicitPlot) also but with 
different colure

Then show both figures to see 
where are the intersection 
points (solution of this system) 
using this command (Show)

As you can see we have to real 
solution (the points of intersection)
Step 2: Use the FindRoot command to find the real roots one by one as follows:

The FindRoot 
commands 

Notes here the initial 
guesses in two roots 
the have to be near 
the interested roots 
Applications: Find the solution of the following system of Nonlinear equation:
X2+ Y3 =1
X3 +Y=1.3

Das könnte Ihnen auch gefallen