liveBook · Manning

System of equations

As explained in Geometry for Programmers

A system of equations is a set of equations whose variables are solved subject to all equations simultaneously.

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

How Geometry for Programmers covers it

How deep it goes
Defines simultaneous equations and demonstrates solver usage, then applies linear systems to point, tangent, and curvature constraints.
Examples
Uses a two-train speed problem and a cubic polynomial constrained by points, tangent slopes, and curvature.
What it assumes
Assumes basic algebra and Python assignment rules, while introducing symbolic variables and equation encoding.
What you can do after
Apply it via SymPy to encode equations, solve shared unknowns, and derive numerical or symbolic results.
How it connects
Connects symbolic mathematics, computer algebra, derivatives, polynomial interpolation, tangent constraints, and curvature.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.