반응형
지난 글에서 유도한 $\theta_{3}$ 와 $L_{1}$ 공식을 파이썬으로 코딩하였습니다.
$\theta_{3}=sin^{-1}\left ( \frac{L_2\sin\theta_{2}-L_{4}}{L_{3}} \right )$
$L_{1}=L_{2}\cos\theta_{2}-L_{3}\cos \theta_{3}$
known 에 각 링크 길이와 $\theta_{1}$을 넣어주면 됩니다. Norton 기구학 책의 4-2 문제를 풀어보았습니다.
import numpy as np
#1) known
L_2=40
L_3=120
L_4=-20
theta_2=60*np.pi/180
#2) theta-3 calculation
theta_3_1=np.arcsin( (L_2*np.sin(theta_2)-L_4)/(L_3) )
theta_3_2=np.pi-theta_3_1
#3) L-1 calculation
L_1_1=L_2*np.cos(theta_2)-L_3*np.cos(theta_3_1)
L_1_2=L_2*np.cos(theta_2)-L_3*np.cos(theta_3_2)
#4) print
print("theta3_open : "+str(theta_3_1*180/np.pi))
print("theta3_crossed : "+str(theta_3_2*180/np.pi))
print("L1_open : "+str(L_1_1))
print("L1_crossed : "+ str(L_1_2))
아래는 결과입니다.
>>> print("theta3_open : "+str(theta_3_1*180/np.pi))
theta3_open : 27.086928478471272
>>> print("theta3_crossed : "+str(theta_3_2*180/np.pi))
theta3_crossed : 152.91307152152876
>>> print("L1_open : "+str(L_1_1))
L1_open : -86.83800519452289
>>> print("L1_crossed : "+ str(L_1_2))
L1_crossed : 126.83800519452289
예제 결과와 잘 일치합니다.
반응형
'기계공학 기타과목 > 기구학' 카테고리의 다른 글
[기구학] 움직이는 링크의 속도벡터 구하기 (0) | 2022.06.30 |
---|---|
[기구학] 한 끝이 고정된 링크의 속도벡터 구하기 (0) | 2022.06.30 |
[기구학] 4절 크랭크-슬라이더 위치해석 (position analysis) (1) 공식 유도 (0) | 2022.06.27 |
[기구학] 4절 링크 위치해석 (position analysis) (2) 파이썬으로 위치계산기 만들기 (0) | 2022.06.27 |
[기구학] 4절 링크 위치해석 (position analysis) (1) 공식 유도 (0) | 2022.06.23 |
댓글