Skip to content
3 changes: 0 additions & 3 deletions README.md

This file was deleted.

Empty file added hgfgh.py
Empty file.
30 changes: 30 additions & 0 deletions lab_1_extratask1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

r_0 = 384400000 # высота, м
v_0 = 1

R_earth = 6378.1 * 10**3 # радиус Земли, м
M_earth = 5.974 * 10**24 # масса Земли, кг
G = 6.67 * 10**(-11)

r = np.arange(0, r_0 - R_earth, 500)

def speed_function(v, r):
print(r)
dvdr = (G*M_earth)/(v*(r_0 - r)**2)
return dvdr

v_r = odeint(speed_function, v_0, r)

plt.plot(r_0 - r, v_r[:,0], label="скорость")
plt.xlabel("Высота над Землёй, м")
plt.ylabel("Скорость, м/с")
plt.title("Закон изменения скорости")
plt.xlim(r_0, -R_earth)
plt.legend()

plt.savefig("lab_extratask1.png")

print("Скорость столкновения метеорита на Землю равна:", round(v_r[-1,0]), "м/с.")
27 changes: 27 additions & 0 deletions lab_1_extratask2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

S_0 = 1600
E_0 = 1360
k = 250 * 10**(-6)

t = np.arange(0, 24, 0.01)


def func_victoria_rega(S, t):
if t >= 6 and t <= 18:
dsdt = k * E_0*np.cos((12-t)*np.pi/12)*np.sqrt((S/10**4)**3/np.pi)*10**4
else:
dsdt = 0
return dsdt

S_t = odeint(func_victoria_rega, S_0, t)

plt.plot(t, S_t, label="Площадь")
plt.xlabel("Время, часы")
plt.ylabel("Функция площади, см^2")
plt.title("Закон изменения площади")
plt.legend()

plt.savefig("lab_extratask2.png")
46 changes: 46 additions & 0 deletions lab_1_extratask3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

G = 6.67 * 10**(-11)
M_son = 1.989 * 10**30
L_son = 3.827 * 10**26
R = 6400 * 10**3
q = 147 * 10**9
v_q = 30.4 * 10**3

e = (v_q**2 * q)/(G*M_son) - 1
p = q *(1+e)
a = q / (1-e)
T = np.sqrt((4*np.pi**2 * a**3)/(G*M_son))

t = np.arange(0, T, 1000)

def enrgy_func(z, t):
phi, E = z

r = p / (1 + e*np.cos(phi))

dphi_dt = np.sqrt(G*M_son*p) / r**2

dE_dt = (L_son * R**2)/(4*r**2)

return dphi_dt, dE_dt

phi_0 = 0
E_0 = 0
z_0 = phi_0, E_0

E_t = odeint(enrgy_func, z_0, t)

plt.plot(t/3600, E_t[:,1], label="Энергия")
plt.xlabel("Время, часы")
plt.ylabel("Энергия, Дж")
plt.title("Закон изменения энергии")
plt.legend()

plt.savefig("lab_extratask3.png")

E_sum = round(E_t[-1,-1] / 10**25, 2) * 10**25

print("Энергия, которую планета получила за лдин оборот равна:", E_sum, "Дж")
30 changes: 30 additions & 0 deletions lab_1_task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

n_0 = 10
m = 10
k = 10**(-6)
t = np.arange(0, 3/k, 100)

print("Закон увеличения бактерий: v = k * n,\nгде v - скорость, n - кол-во бактерий в моменте, k - коэфицент пропорциональности.")
print()

def bacterium_function(n, t):
dndt = k * n
return dndt

n_t = odeint(bacterium_function, n_0, t)

for i in range(len(n_t)):
if round(n_t[i,0], 1) == m * n_0:
print(f"Время, спустя которое бактерий станет в {m} раз больше", t[i])
break

plt.plot(t, n_t[:,0], label="Размножение бактерий")
plt.xlabel("Время увеличения, секунды")
plt.ylabel("Функция увеличения")
plt.title("Закон увеличения")
plt.legend()

plt.savefig("lab_task1.png")
31 changes: 31 additions & 0 deletions lab_1_task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

n_0 = 1000
k = 0.08
t = np.arange(0, 10, 0.01)
summa = 0

print("Закон изменения инвестиций: v = 0.08 * n,\nгде v - скорость, n - инвестируемые в данный момент времени средства, k - коэфицент пропорциональности.")
print()

def investment_function(n, t):
dndt = -(k * n * t)
return dndt

for i in range(0, 5):
summa += n_0 * (1-k)**i

print("Объём инвестиций за 4 года:", round(summa))


n_t = odeint(investment_function, n_0, t)

plt.plot(t, n_t[:,0], label="Инвестиции")
plt.xlabel("Время уменьшения, дни")
plt.ylabel("Функция уменьшения")
plt.title("Закон уменьшения")
plt.legend()

plt.savefig("lab_task2.png")
25 changes: 25 additions & 0 deletions lab_1_task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

m = 3
a_0 = 10
v_0 = 0
gamma = 0.2
t = np.linspace(0, 7, 10000)

def boost_function(v, t):
dvdt = a_0 - (gamma/m) * v**2
return dvdt

v_t = odeint(boost_function, v_0, t)

plt.plot(t, v_t[:,0], label="скорость")
plt.xlabel("Время, секунды")
plt.ylabel("Функция скорости")
plt.title("Закон изменения скорости")
plt.legend()

plt.savefig("lab_task3.png")


Binary file added lab_extratask1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab_extratask2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab_extratask3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab_task1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab_task2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lab_task3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lec_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions lec_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt

t = np.arange(0, 10**6, 100)

def radio_function(m, t):
dmdt = - k * m
return dmdt

m_0 = 10
k = 1.61 * 10**(-6)

m_t = odeint(radio_function, m_0, t)

plt.plot(t, m_t[:,0], label="Расппад Висмута 210")
plt.xlabel("Период распада, секунды")
plt.ylabel("Функция распада")
plt.title("Радиоактивный распад")
plt.legend()

plt.savefig("lec_1.png")