pyva.systems.lumpedSystems.HarmonicOscillator
- class pyva.systems.lumpedSystems.HarmonicOscillator(mass, stiffness, damping=0.0)
Bases:
object
The harmonocOscillator class defines the dynamics of a simple damped or undamped harmonic oscillator.
The main purpose of this class is the presentation of the oscillator dynamics in [Pei2022]
- mass
oscillating mass
- Type:
float
- stiffness
stiffness of spring
- Type:
float
- damping
viscous damping
- Type:
float
- __init__(mass, stiffness, damping=0.0)
Class contructor for HarmonicOscillator
- Parameters:
mass (float) – oscillating mass
stiffness (float) – stiffness of spring
damping (float) – viscous damping
Methods
__init__
(mass, stiffness[, damping])Class contructor for HarmonicOscillator
displacement
(time, x0[, v0])Displacement of harmonic oscillator over time
displacement_amplitude
(time, x0[, v0])Complex amplitude due to initial conditions
energy
(time, x0[, v0])total energy of harmonic oscillator over time
kinetic_energy
(time, x0[, v0])kinetic energy of harmonic oscillator over time
potential_energy
(time, x0[, v0])potential energy of harmonic oscillator over time
u_force
(omega, F)Harmonic forced response of harmonic oscillator
velocity
(time, x0[, v0])Velocity of harmonic oscillator over time
velocity_amplitude
(time, x0[, v0])Complex velocity amplitude due to initial conditions
Attributes
Ratio of viscous- to critical-viscous damping
The critical viscous damping
The damping loss
Resonance frequency or harmonic oscillator
Resonance frequency or harmonic oscillator
- property critical_damping_ratio
Ratio of viscous- to critical-viscous damping
- Returns:
The ratio of damping to critical viscous damping
- Return type:
float
- property critical_viscous_damping
The critical viscous damping
- Returns:
Critical viscous damping
- Return type:
float
- property damping_loss
The damping loss
- Returns:
damping loss
- Return type:
float
- displacement(time, x0, v0=0)
Displacement of harmonic oscillator over time
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
displacement over time
- Return type:
float
- displacement_amplitude(time, x0, v0=0)
Complex amplitude due to initial conditions
This method separates between the tree cases. It provides the complex oscillation amplitude X(t) for underdamped case. And the real displacement over time for the damped cases
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
displacement amplitude over time
- Return type:
complex
- energy(time, x0, v0=0)
total energy of harmonic oscillator over time
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
energy over time
- Return type:
float
- kinetic_energy(time, x0, v0=0)
kinetic energy of harmonic oscillator over time
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
kinetic energy over time
- Return type:
float
- property omega_mode
Resonance frequency or harmonic oscillator
- Returns:
angular resonance frequency without damping
- Return type:
float
- property omega_resonance
Resonance frequency or harmonic oscillator
- Returns: float
angular resonance frequency with damping
- potential_energy(time, x0, v0=0)
potential energy of harmonic oscillator over time
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
potential energy over time
- Return type:
float
- u_force(omega, F)
Harmonic forced response of harmonic oscillator
- Parameters:
omega (float) – angular frequency
F (complex) – amplitude of force excitation
- Returns:
displacement amplitude
- Return type:
complex
- velocity(time, x0, v0=0)
Velocity of harmonic oscillator over time
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
displacement over time
- Return type:
float
- velocity_amplitude(time, x0, v0=0)
Complex velocity amplitude due to initial conditions
This method separates between the tree cases. It provides the complex oscillation velocity V(t) for underdamped case. And the real velocity over time for the damped cases
- Parameters:
time (float) – time > 0
x0 (float) – initial displacement at time=0
v0 (float) – initial velocity at time=0
- Returns:
velocity amplitude over time
- Return type:
complex