From b25d4a855d9b5d08e8e1d174bcc0902797d0661f Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Sun, 11 Jun 2017 17:08:44 +0200
Subject: [PATCH] Quadratic equilibrium construction - demo notebook

---
 sympyextensions.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sympyextensions.py b/sympyextensions.py
index 489849ca7..c580680be 100644
--- a/sympyextensions.py
+++ b/sympyextensions.py
@@ -20,6 +20,11 @@ def scalarProduct(a, b):
     return sum(a_i * b_i for a_i, b_i in zip(a, b))
 
 
+def equationsToMatrix(equations, degreesOfFreedom):
+    return sp.Matrix(len(equations), len(degreesOfFreedom),
+                     lambda row, col: equations[row].coeff(degreesOfFreedom[col]))
+
+
 def normalizeProduct(product):
     """
     Expects a sympy expression that can be interpreted as a product and
-- 
GitLab