A system of equations is a set of equations whose variables must satisfy every equation at once. It turns a practical situation into simultaneous constraints: two train speeds must add to the total distance rate, while one speed is twice the other. section 1.6
A system becomes useful when several conditions determine shared unknowns:
- Model each condition as an equation, such as Va + Vp = 450 and Vp = 2Va. section 1.6
- Represent equations in a solver-friendly form by moving expressions to one side, because Python’s = performs assignment. section 1.6
- Solve for all unknowns together; the train example produces Va = 150 and Vp = 300. section 1.6
Constraining a polynomial
A cubic polynomial can be required to pass through (1, 1) and (3, 2), while its tangent slope at both points is -1. These point and derivative conditions form a linear system whose solution supplies the polynomial coefficients. Additional equations can constrain curvature through the second derivative. section 7.1.1
solution = solve([
Vp - Va * 2,
Va * 1 + Vp * 1 - 450
], (Va, Vp))
Use SymPy’s solve call to submit several equations and request values for the shared variables Va and Vp. section 1.6
