-
Notifications
You must be signed in to change notification settings - Fork 0
/
FDO.py
34 lines (24 loc) · 1.09 KB
/
FDO.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from manim import *
class FDO(Scene):
def construct(self):
axis = Axes(
x_range=[0, 200, 10], # Adjusted x-range for better visualization
y_range=[-50, 50, 10], # Adjusted y-range for better visualization
axis_config={"color": BLUE},
)
axis_labels = axis.get_axis_labels(x_label="t", y_label="A(t)")
A = 10
F = 100 # Reduced external force for less dominance
omega = 3 # Increased angular frequency for faster oscillation
b = 1 # Increased damping coefficient for more pronounced damping
m = 1
k = 1
def Ao():
return F / np.sqrt((k - m * omega**2)**2 + (b * omega)**2)
def delta():
return np.arctan((m*omega*omega - k)/b*omega)
def oss(t):
return Ao() * np.cos(omega * t - delta())
graph1 = axis.plot(oss, color=GREEN)
self.add(axis, axis_labels)
self.play(Create(graph1), run_time=10) # Increased run_time for better observation