Tutorial Release 10.4 The Sage Development Team https://doc.sagemath.org/pdf/en/tutorial/sage_tutorial.pdf
Sage is free, open-source math software that supports research and teaching in algebra, geometry, number theory, cryptography, numerical computation, and related areas. Both the Sage development model and the technology in Sage itself are distinguished by an extremely strong emphasis on openness, community, cooperation, and collaboration: we are building the car, not reinventing the wheel. The overall goal of Sage is to create a viable, free, open-source alternative to Maple, Mathematica, Magma, and MATLAB.
This tutorial is the best way to become familiar with Sage in only a few hours. You can read it in HTML or PDF versions, or from the Sage notebook (click Help, then click Tutorial to interactively work through the tutorial from within Sage).
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
ubuntu2204
SageMath Example: Solving Non-Linear Systems
The following example of using Sage to solve a system of non-linear equations was provided by Jason Grout:
Solve the System Symbolically
First, we solve the system symbolically.
Declare the variables:
Define the equations:
Solve the system of equations:
Numerical Approximations of the Solutions
For numerical approximations of the solutions, you can use the following approach:
Solve the system of equations:
Print the numerical solutions:
Solving Equations Numerically
Often times, solve
will not be able to find an exact solution to the equation or equations specified. When it fails, you can use find_root
to find a numerical solution. For example, solve
does not return anything interesting for the following equation:
Declare the variable :
Solve the equation :
On the other hand, we can use find_root
to find a solution to the above equation in the range :
Declare the variable :
Find the numerical root: