Hmmm, ich krieg dann diese Fehlermeldung:
>>> f
a*x + y
>>> r = {x: -3, y: 1}
>>> f(r)
Traceback (most recent call last):
File "<pyshell#68>", line 1, in <module>
f(r)
TypeError: 'Add' object is not callable
Die Suche ergab 2 Treffer
- Dienstag 1. November 2011, 15:29
- Forum: Allgemeine Fragen
- Thema: Weiterverwendung der Lösung eines Gleichungssystems
- Antworten: 3
- Zugriffe: 255
- Dienstag 1. November 2011, 14:55
- Forum: Allgemeine Fragen
- Thema: Weiterverwendung der Lösung eines Gleichungssystems
- Antworten: 3
- Zugriffe: 255
Weiterverwendung der Lösung eines Gleichungssystems
>>> import numpy
>>> from sympy import *
>>> x = symbols("x")
>>> y = symbols("y")
>>> a = symbols("a")
>>> f = a*x + y
>>> solve([x + 5*y - 2, -3*x + 6*y -15], [x, y])
{x: -3, y: 1}
>>> print f
a*x + y
das hab ich ins python shell geschrieben - ist also gut und schön, aber...
hast einer ne idee ...
>>> from sympy import *
>>> x = symbols("x")
>>> y = symbols("y")
>>> a = symbols("a")
>>> f = a*x + y
>>> solve([x + 5*y - 2, -3*x + 6*y -15], [x, y])
{x: -3, y: 1}
>>> print f
a*x + y
das hab ich ins python shell geschrieben - ist also gut und schön, aber...
hast einer ne idee ...
