Solving System of Equations Using Matrices

Click For Summary
SUMMARY

This discussion addresses the solution of a nonlinear system of equations using MATLAB. The equations in question are x² + y² = 42 and x + 3y + 2y² = 6. The user implemented the MATLAB code to solve these equations, resulting in four pairs of (x, y) values. However, it is clarified that matrices are not suitable for solving nonlinear systems, as they are designed for linear equations.

PREREQUISITES
  • Understanding of nonlinear equations
  • Familiarity with MATLAB syntax and functions
  • Knowledge of symbolic computation in MATLAB
  • Basic concepts of systems of equations
NEXT STEPS
  • Study the use of MATLAB's 'solve' function for nonlinear equations
  • Learn about numerical methods for solving nonlinear systems, such as Newton's method
  • Explore the differences between linear and nonlinear systems of equations
  • Investigate graphical methods for visualizing solutions of nonlinear equations
USEFUL FOR

Students, educators, and researchers in mathematics or engineering who are dealing with systems of nonlinear equations and wish to understand the application of MATLAB in solving such problems.

GreenPrint
Messages
1,186
Reaction score
0

Homework Statement


Is it possible to solve this system of equations using matrices?
x^2 + y^2 = 42
x+3y+2y^2=6

Homework Equations





The Attempt at a Solution


I solved the system of equations using the following MATLAB code. I'm kind of confused by the results. Are there two x values and two y values? I don't know how to interpret what it says x and y are equal to. Thanks in advance.

Code:
>>one=sym('x^2+y^2-42');
two=sym('x+3*y+2*y^2-6');
[x,y]=solve(one,two)
 
x =
 
 -6.2161908711674029137999766546085
  6.4782037201238076694174751205659
  6.3321946913754454971273459117746
  -5.594207540331850252744844377732
 
 
y =
 
   1.8327495882457713513416277757555
 -0.18131894709064188368251606877471
  -1.3796051574695662000556283784362
  -3.2718254836855632676034833285446
 
Physics news on Phys.org
GreenPrint said:
Is it possible to solve this system of equations using matrices?

x^2 + y^2 = 42
x+3y+2y^2=6

No, matrices are applied to linear systems of equations.

GreenPrint said:

The Attempt at a Solution


I solved the system of equations using the following MATLAB code. I'm kind of confused by the results. Are there two x values and two y values? I don't know how to interpret what it says x and y are equal to. Thanks in advance.

There are four solutions: (x,y) pairs

x=-6.216 and y=1.832,
x=6.478 and y=-0.181 and so on.

ehild
 

Similar threads

Replies
2
Views
2K
Replies
3
Views
2K
Replies
10
Views
2K
  • · Replies 27 ·
Replies
27
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K