Previous Up Next

23.3.3  Finding approximate solutions to systems of equations

In Section 23.3.2 it was shown how to use the fsolve and cfsolve commands to solve equations. This section will discuss systems of equations.

As before, the cfsolve command is the complex version of fsolve, with the same arguments. The only difference is that cfsolve gives numeric solutions over the complex numbers, even if Xcas is not in complex mode (see Section 2.5.5). fsolve will return complex roots, but only in complex mode.

Examples

Input in real mode:

fsolve([x^2+y+1,x+y^2-1],[x,y])
     


0.0−1.0
−0.453397651516−1.2055694304


          

Input in complex mode:

fsolve([x^2+y+1,x+y^2-1],[x,y])
     




0.0−1.0
0.226698825758−1.46771150871 i1.1027847152+0.665456951153 i
0.226698825758+1.46771150871 i1.1027847152−0.665456951153 i
−0.453397651516−1.2055694304




          

Input in any mode:

cfsolve([x^2+y+1,x+y^2-1],[x,y])
     




0.0−1.0
0.226698825758−1.46771150871 i1.1027847152+0.665456951153 i
0.226698825758+1.46771150871 i1.1027847152−0.665456951153 i
−0.453397651516−1.2055694304




          
cfsolve([x^2+y+2,x+y^2+2],[x,y])
     




0.5+1.65831239518 i0.5−1.65831239518 i
0.5−1.65831239518 i0.5+1.65831239518 i
−0.5+1.32287565553 i−0.5+1.32287565553 i
−0.5−1.32287565553 i−0.5−1.32287565553 i




          

Example

fsolve([x^2+y-2,x+y^2-2],[x,y],[2,2],dnewton_solver)
     

1.0,1.0
          

Previous Up Next