x = a*y + c y = 4 * c solve for [c] in terms of [a, x] first solve for other unknowns: [y] x = a*(4*c) + c x = c * (1 + 4*a) c = (1 + 4*a) / x N equations in M unknowns, P constants 0 = x + y 0 = y*2 + 1 - x ----------------------------------- solve_for(self, P: Vec, M: Vec, Q: HashMap) returns a ModelicaModel with fixed components; equations are LHS identifier, in correct order, no extends, no connections, name suffixed " (rewritten)", components as Parameter (w/ val), Input, or Output V variables Q constants (become kwargs) P bound vars (independent, inputs/passed, become like constants) M unknowns (dependent, outputs) N' total equations N equations with unknowns V = Q + P + M check: each Q is Integer or Float UnderSpecifiedConstant filter N' to get N OverConstrained if extra equations check: N >= M UnderConstrained while len(eqns) > 0: 1. find first eqn with single unknown, and pop it 2. rebalance to get unknown on LHS 3. remove unknown from unknown list return: sort equations to match order solve_for(var) impl for SimpleEquation => Result check: var only on one side VariableNotFound or NaiveImplementation put var on LHS recursively apply rules to symmetrically unwrap LHS onto RHS if try to unwrap Abs: NaiveImplementation ----------------------------------- systems of differential equations: will be N equations of N variables, in terms of implied time should be no unknowns; odex thing is just varying initial equations have JS boxes to show ranges of initial conditions