sympy calculates limes and displays it with latex in interactive window (junpyter)
This commit is contained in:
parent
f9d4cff2d8
commit
8615beff5f
@ -1,2 +1,36 @@
|
||||
#%%
|
||||
# Grenzwerte mit python berechnen
|
||||
# %%
|
||||
# Grenzwerte mit python berechnen
|
||||
import sympy as sp
|
||||
|
||||
# Latex printing in interacitve windows initialisieren
|
||||
sp.init_printing(use_latex=True)
|
||||
|
||||
n = sp.symbols("n")
|
||||
|
||||
functions = [
|
||||
3 / (n + 2),
|
||||
(n + 2) / 3,
|
||||
(n + 2) / 3 * n,
|
||||
3 * n / (n + 2),
|
||||
3 * n / (6 * n + 2),
|
||||
(4 - n**2) / (2 + n) ** 2,
|
||||
(2 * n - 5 - 4 * n**2) / (3 - 8 * n**2 - 10 * n),
|
||||
(3 * n**2 + 5 * n + 1) / (n - 1) ** 2,
|
||||
(10**12 - 5 * n**2 + 6 * n**3 + 10**10 * n) / (5 - 7 * n**4 - 5 * n**2),
|
||||
((2**n + 3) / (3**n + 2)) - 1,
|
||||
((3 + n**100 + 2**n) / (n**2 - 3**n - 2)) + 4,
|
||||
(2 + (6 * n**6 / (2 + 3 * n**3)) - 7 * n**3) / (n + (1 + n) ** 3),
|
||||
]
|
||||
|
||||
results = []
|
||||
|
||||
for function in functions:
|
||||
a = sp.limit_seq(function, n) # Grenzwert berechnen
|
||||
lim = sp.Limit(
|
||||
function, n, sp.oo
|
||||
) # erstellt symbolisches limes n -> unendlich funktion
|
||||
results.append(
|
||||
sp.Eq(lim, a)
|
||||
) # erstellt den equation object und fügt ihn zur liste results hinzu
|
||||
|
||||
results # symbolische ausgabe
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user