From 609c90ddb7f4c3c88cfc9c6c6f26ec32deff22f1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 13 Nov 2017 22:07:35 +0000 Subject: [PATCH] symbolic.py: before giving up on unicode stuff Signed-off-by: Ian Jackson --- symbolic.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 symbolic.py diff --git a/symbolic.py b/symbolic.py new file mode 100755 index 0000000..57c11ae --- /dev/null +++ b/symbolic.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +from sympy import * + +import sys + +import sys, codecs +if sys.stdout.encoding is None: + sys.stdout = codecs.open("/dev/stdout", "w", 'utf-8') + +init_printing(use_unicode=True) + +r, theta, s, la, mu = symbols('r theta s la mu') + +pprint(theta) + +# start original formulation +# rightvars replaces + +p_start = Matrix([ + r * (1 - cos(theta)), + r * sin(theta), + mu * s, +]) + +p_rightvars = p_start.subs(theta, s/r).subs(r, 1/la) + +pprint(p_rightvars) -- 2.30.2