M.4.C
Verwenden Sie Linearisierungen, um Funktionswerte näherungsweise zu berechnen. Gehen Sie wie folgt vor.
a) Sinus-Funktion
Berechnen Sie eine Näherung für \(\sin\left(33{,}6^\circ\right)\) indem Sie die Linearisierung \(L_{30^\circ}\) der Sinusfunktion \(f(\varphi) = \sin \varphi\) an der Stelle \(\varphi=30^\circ\) verwenden, indem Sie also berechnen:
Runden Sie auf Rundestellenwert \(0{,}00001\). Zeigen Sie, dass:
Hinweis \(\sin 33.6^\circ\) ist gerundet auf \(0{,}0000000001\):Lösung
b) Kosinus-Funktion
Berechnen Sie eine Näherung für \(\cos\left(3.6^\circ\right)\) indem Sie die Linearisierung \(L\) der Kosinusfunktion \(f(\varphi) = \cos \varphi\) an der Stelle \(\varphi=0^\circ\) verwenden, indem Sie also berechnen:
Zeigen Sie, dass:
Für \(\varphi=3{,}6^\circ\) Hinweis \(\cos 3{,}6^\circ\) ist gerundet auf \(0{,}0000000001\):Lösung
Source Code eines Programms dazu: Programm ausführen? Dazu: Copy: Source Code in die Zwischenablage kopieren. Paste: Source Code ins Eingabefeld hinter Play: Knopf SymPy
from sympy.physics.units import *
from sympy import *
# Units:
(k, M, G ) = ( 10**3, 10**6, 10**9 )
(mm, cm) = ( m/1000, m/100 )
Newton = kg*m/s**2
Pa = Newton/m**2
MPa = M*Pa
GPa = G*Pa
kN = k*Newton
deg = pi/180
half = S(1)/2
# Rounding:
def iso_round(x, pv):
try:
x = float(x)
tmp = round(x, pv)
except TypeError:
from functools import partial
func = partial(round, ndigits = pv)
tmp = x.applyfunc(func)
return tmp
# ---
pprint("\nExact sin(33.6°) - rounded to 0.0000000001:")
tmp = S(336)/10 * deg
tmp = sin(tmp)
tmp = iso_round(tmp, 10)
pprint(tmp)
pprint("\nsin(33.6°) from linearisation - rounded to 0.00001:")
sin30 = sin(30*deg)
dy = cos(30*deg) * 3.6 *deg
tmp = sin30 + dy
tmp = iso_round(tmp, 5)
pprint(tmp)
pprint("\nExact cos(3.6°) - rounded to 0.0000000001:")
tmp = S(36)/10 * deg
tmp = cos(tmp)
tmp = iso_round(tmp, 10)
pprint(tmp)
[ ]: einfügen.▶ drücken.