Write and Solve Equations that Represent Diagrams