Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to create a code that will satisfy the equation of motion for the pendulum. The pendulum will rotate with the support of a

I want to create a code that will satisfy the equation of motion for the pendulum. The pendulum will rotate with the support of a motor. At first, the pendulum will be at the position of thet_in and it will end at the position of thet_out. Please can you fix the equation of motion so that it will wor as expected:
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
from Pendulum_Animations import animate_pendulum
#Known parameters
g =9.81 #m/s^2
L =1.2 #m
m =20#kg
thet_in =120*(np.pi /180) #starting angle of mechanism (rad)
thet_out =210*(np.pi /180) #Finishing angle (rad)
#Motor constants
T_s =0.69 #Stall Torque, FROM CATALOGUE (Nm)
omega_m =2750*(2* np.pi/60) #No load angular speed (rad/s)
k = T_s / omega_m #motor gradient constant
#Range of gear ratios to try
#G_r =[295.503]
G_r =[320]
#Equation of motion (of a pendulum)
def f(t,z):
theta = z[0]
omega = z[1]
if theta thet_out and omega >0:
T_m = k *(thet_out -theta) #motor torque
else:
T_m =0
dz =[ omega,
(T_m -(g/L)*np.sin(theta))/(L**2)] #+ so will rotate upwards
return dz
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

=+ Are they breakable for any reason?

Answered: 1 week ago