Formel als Symbol - weiteres Beispiel
Verfasst: Sa Mär 17, 2018 5:33 pm
# -*- coding: utf-8 -*-
Ausdrucke als normale Darstellung und als Symbolfunktion

Code: Alles auswählen
import sympy
from sympy import pprint
def main():
a = sympy.Symbol('a') # Definieren und zuweisen
b = sympy.Symbol('b')
e = sympy.log((a + b)**5)
c = sympy.exp(e)
pprint(c) # Symboldarstellung
print('\n') # Leerzeile
c.expand() # Formel expandieren
print(c.expand()) # Ausdruck der expandierten Formel normal
print('\n')
pprint(c.expand()) # Ausdruck der expandierten Formel symbolische Darstellung
if __name__ == "__main__":
main()