Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write the pseudocode for this python script In [1import rumpy as np from numpy import sin, cos from scipy.integrate import odeint from matplotlib import

image text in transcribed

Please write the pseudocode for this python script

In [1import rumpy as np from numpy import sin, cos from scipy.integrate import odeint from matplotlib import pyplot as plt In [2] : | # define the Equations f equations (yo, t): r-[x, -(g/1) in(hela) ] return f def plot results (time, thetal, theta2) plt. plot (tino, plt.plot (time, thot al I : , O I ) theta2) (nitial Angle -'+st.r(initial_angle) ' degrees) l. Pendulum Mol.ion: +) plt.xlabel ('Time (s)") plt.ylabelAngle (rad) ') plt.grid (True) plt.lcqond nonlincar, 'lincar', loc 'lowor right plt.show ) In [3]:| # parameters 9.81 12.0 time- np.arange (, 10.0, 0.02) ci ons initial_angle 45.0 thetad = np , radians (initial-angle) x0 np.radians (0.0) In [5]: | # find the solutions to the nonlinear problem theta 1 = ode i nt(equations, [theta0, x0], time) In [6]:find the solutions to the linear problem w -np.sqrt (g/1) theta2theta0 cos (w*t) for t in timel In [7]: plot the resuits plot_results (time, thetal, theta2) Pendulum Motion: (Initial Angle 45.0 degrees) 0.8 0.6 04 02

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_2

Step: 3

blur-text-image_3

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Discuss in detail the manufacturing planning and control process.

Answered: 1 week ago

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago