Professional Documents
Culture Documents
1пр
1пр
Робочий план
з курсу «Алгоритми, методи обчислень та структури даних»
Черкаси-2023
1. (Проста модельна задача) Група з 35 студентів знаходиться в аудиторії з розмірами
11х8х3 метрів. Кожний студент споживає близько 0,075м3 повітря та виділяє близько
80Вт (1Вт = 1Дж/с) тепла. Обчисліть підвищення температури в аудиторії протягом
перших 15 хвилин пари, якщо вважати кімнату повністю запечатаною та ізольованою.
Нехай теплоємність C v для повітря складає 0,718 кДж/(кг•К), а повітря – це ідеальний
газ при 20°С та тиску 101,325кПа.
from math import radians
import numpy as np # installed with matplotlib
import matplotlib.pyplot as plt
def main():
P = 101.325
V = 11 * 8 * 3 - 35 * 0.075
Mwt = 28.97
R = 8.314
T = 293
Cv = 0.718
Q = 35 * 80 * 20 * 60
m = P * V * Mwt / (R * T)
dT = Q / (m * Cv * 10 * 10 * 10)
print(dT)
main()
res = 1
sign = 1
fact = 1
pow = 1
rel_error = 1
approx_error = 1
print("0", " range")
print("result", 1)
print("rel_error", 0.1035)
for i in range(1,n):
print(i, " range")
sign = sign * (-1)
if i > 0:
fact = fact * (2 * i - 1) * (2 * i)
pow = pow * x * x
res_previous = res
res = res + sign * pow / fact
rel_error = abs((0.707107 - res) / 0.707107)
approx_error = abs((res - res_previous) / res)
print("result", res)
print("rel_error", rel_error)
print("approx_error", approx_error)
return res
x = 30
round(maclaurin(x, 4), 4)
import numpy as np
import matplotlib.pyplot as plt
def cannabola(theta):
return (1+0.9*np.cos(8*theta))*(1+0.1*np.cos(24*theta))*(1+np.sin(theta))*(1-0.02*np.sin(200*theta))
def main():
start=0
end=2*np.pi
theta = np.linspace(start, end, 1000)
r = list(map(cannabola, theta))
ax = plt.subplot(111, polar=True)
ax.plot(theta, r,color="green")
ax.set_rticks([])
ax.grid(True)
plt.show()
main()
unset_show()
x, y = symbols('x y')
z = x ** 3 - 3 * x * y ** 2
p = plot3d(z)
p._backend.ax[0].collections[0].set_cmap("Spectral")
p._backend.ax[0].figure.show()
main()