1. 현가링크를 고려한 서스펜션과 이것을 단순화한 Reduced Order Model
2. 저차의 선형모델(A, B, C, D matrix 추출)
| Simcenter Heeds 에서 정의한 design parameter |
| 비선형모델의 변위를 reference value 로 사용 |
| Sprung mass 변위의 최적화 |
| 최적화 수행 후, 목적함수의 변화 추이 (0에 가까워질수록 error 가 감소함) |
| 변수추정 최적화를 통해 얻은 최종 파라미터 (Ks, Cs, Kt) |
4. 결 론
import numpy
as np
from scipy.integrate import odeint
# Define the parameters
ms =
240.0 # sprung
mass (kg)
mu =
36.0 # unsprung
mass (kg)
Kt =
160000.0 # tire
stiffness (N/m)
Ks =
16000.0 # suspension
stiffness (N/m)
Cs =
980.0 # damping
coefficient (Ns/m)
t0 =
1.0 # road
input start time (s)
g =
9.81 # gravity
(m/s^2) - not used in original MATLAB equation
# Define the system of ODEs for
2-DOF quarter car vibration
# Z[0]: sprung mass displacement,
zs
# Z[1]: sprung mass velocity,
zs_dot
# Z[2]: unsprung mass displacement,
zu
# Z[3]: unsprung mass velocity,
zu_dot
def quarter_car_dynamics(Z, t, ms, mu, Kt, Ks, Cs, t0):
zs, zs_dot, zu, zu_dot = Z
# Road displacement input
if t
> t0:
Zr = 0.01
# Zr =
0.05 * np.sin(0.25 * t**2)
else:
Zr = 0.0
# MATLAB equivalent:
# A1 = Z(2)
# A2 =
-Ks*(Z(1)-Z(3)) - Cs*(Z(2)-Z(4))
# A3 = Z(4)
# A4 =
Ks*(Z(1)-Z(3)) + Cs*(Z(2)-Z(4)) - Kt*(Z(3)-Zr)
dzs_dt = zs_dot
dzs_dot_dt = (-Ks * (zs - zu) - Cs *
(zs_dot - zu_dot)) / ms
dzu_dt = zu_dot
dzu_dot_dt = (
Ks * (zs - zu)
+ Cs * (zs_dot - zu_dot)
-
Kt * (zu - Zr)
) / mu
return [dzs_dt,
dzs_dot_dt, dzu_dt, dzu_dot_dt]
# Initial conditions
zs0 =
0.0 # initial
sprung mass displacement (m)
zs_dot0
= 0.0 # initial
sprung mass velocity (m/s)
zu0 =
0.0 # initial
unsprung mass displacement (m)
zu_dot0
= 0.0 # initial
unsprung mass velocity (m/s)
initial_conditions
= [zs0, zs_dot0, zu0, zu_dot0]
# Time points
t =
np.linspace(0, 4, 4000) # simulate for 10 seconds
with 201 points
# Solve the ODE
solution
= odeint(
quarter_car_dynamics,
initial_conditions,
t,
args=(ms, mu, Kt, Ks, Cs, t0)
)
# Extract results from the
solution
# Unit conversion
m_to_mm
= 1000.0
# Extract results from the
solution
sprung_displacement
= solution[:, 0] * m_to_mm # m -> mm
sprung_velocity
= solution[:, 1] * m_to_mm # m/s -> mm/s
unsprung_displacement
= solution[:, 2] * m_to_mm # m -> mm
unsprung_velocity
= solution[:, 3] * m_to_mm # m/s -> mm/s
output_filename
= 'Output.txt'
try:
with open(output_filename,
'w') as f:
f.write(
"Time
(s)\t"
"Sprung
Displacement (m)\t"
"Sprung
Velocity (m/s)\t"
"Unsprung
Displacement (m)\t"
"Unsprung
Velocity (m/s)\t"
"Road
Input (m)\n"
)
for i
in range(len(t)):
time = t[i]
if time
> t0:
road_input = 0.01
# road_input
= 0.05 * np.sin(0.25 * time**2)
else:
road_input = 0.0
f.write(
f"{time:.4f}\t"
f"{sprung_displacement[i]:.6f}\t"
f"{sprung_velocity[i]:.6f}\t"
f"{unsprung_displacement[i]:.6f}\t"
f"{unsprung_velocity[i]:.6f}\t"
f"{road_input:.6f}"
)
if i
< len(t) - 1:
f.write("\n")
print(f"Calculation
results saved to {output_filename}")
except
Exception as e:
print(f"An
error occurred while saving the file: {e}")


댓글 없음
댓글 쓰기