Amaliy qism
Quyidagi funksiyalarni Furye qatorlariga yoyishda a0,a1 va b1 koeffitsentlar
qiymatlarini toping. Algortim va
dastur tuzing
.
import sympy as sp
# Berilgan funksiyalar y1 =
sp.Symbol('y1', real=True) y2 =
sp.Symbol('y2', real=True)
x = sp.Symbol('x', real=True)
f1 = x**4
f2 = -5*x + 3
# Furye qatorlariga yoyish uchun koeffitsentlar a0_1 =
(1/(2*sp.pi)) * sp.integrate(f1, (x, -sp.pi, sp.pi)) a0_2 =
(1/(2*sp.pi)) * sp.integrate(f2, (x, -sp.pi, sp.pi))
a1_1 = (1/(sp.pi)) * sp.integrate(f1*sp.cos(x), (x, -sp.pi, sp.pi)) a1_2
= (1/(sp.pi)) * sp.integrate(f2*sp.cos(x), (x, -sp.pi, sp.pi))
b1_1 = (1/(sp.pi)) * sp.integrate(f1*sp.sin(x), (x, -sp.pi, sp.pi)) b1_2
= (1/(sp.pi)) * sp.integrate(f2*sp.sin(x), (x, -sp.pi, sp.pi))
# Koeffitsentlarni chiqarish
print("y1(x) uchun:")
print("a0:", a0_1.evalf())
print("a1:", a1_1.evalf())
print("b1:", b1_1.evalf())
print("\ny2(x) uchun:")
print("a0:", a0_2.evalf())
print("a1:", a1_2.evalf())
print("b1:", b1_2.evalf())