Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this one, I ONLY NEED HELP WITH PART H-J. PARTS A-G I have completed and am attaching the solution below. PARTS

Please help me with this one, I ONLY NEED HELP WITH PART H-J. PARTS A-G I have completed and am attaching the solution below. PARTS H-J have to be a continuation to it. I have written the program in SCILAB which is the free version of MATLAB. ALSO PLEASE ATTACH SCREENSHOTS OF THE EXECUTED SOLUTION IN THE ANSWER. TYPE IN THE CODE PLEASE SO I CAN COPY INSTEAD OF A SCREENSHOT

image text in transcribed

File name: LabAssn2Prob6_Jump_start.sce

//This program uses Richardson numerical method to compute the velocity of

//a slider-crank mechanism from its given displacement data

//It is deliberately written for VERY beginners and does not use the full

//potential of Scilab

//Revision number: Original Date: 03/06/2015

//Written by Dr Kabengela

//------------------------------------------------

//Variables definition

//omega_rpm //angular velocity in rpm

//omega_dps //angular velocity in degree pre second

/ //total number of angle values

//anglesD //matrix of angles in degree

//displ // displacements matrix

//t //time

//------------------------------------------------

//Setting environment

clc // clear the commamd window

clear // erase variables from memory

xdel(winsid()) //close all open windows

format("v",6) //set format to six digits including sign and decimal point

//-------------------------------------------------

//initializing variables

disp(" THIS ELEMENTARY PROGRAM COMPUTE AND DISPLAY THE VELOCITY OF A SLIDER-CRANK")

disp(" ==========================================================================")

omega_rpm = input(" Enter angular velocity in rpm: ");

n = input(" Enter the total number of angle values, in degree, to be processed: ")

anglesD = zeros(n,0); //initializing the matrix with zeros

displ = zeros(n,0);

disp("-------------------------------------")

for index = 1:n

anglesD(index) = input(" Enter the value of angle #" + string(index) + ": ");

displ(index) = input(" Enter the value of corresponding displacement: ");

disp("-------------------------------------");

end

//-------------------------------

//Computing

omega_dps = omega_rpm * 360 / 60;

t = anglesD / omega_dps;

//-------------------------------

//Displaying

scf(0) //open the graphic window number 0 and set it current

clf //clear window

plot(t,displ)

title("Displacement");

xlabel("Time t(s)")

ylabel("d(mm)")

set(gca(),"grid",[1,1]) // add grid

//----------------------------------

//exporting to pdf file

xs2pdf(0,'Displacement');

Problem 6. This problem is similar to problem 5, except that it uses a user-written Scilab, or any programming language, code to fulfill the same tasks. Piston displacement and crank angle (in degree) are still obtained from Problem 3 of Lab assignment 01. The crankshaft, as in the previous problem, rotates at a constant angular speed (omega) of 1750 rpm in the counterclockwise direction. You are asked to write a code that does the following a. b. c. d. e. f. g. Asks the user to enter the value of the angular speed of the crank in rpm Asks the user the total number of crank angle values (data points), in degree, to be processed Accepts and store each value of the crank angle and the corresponding piston displacement Converts the value of the angular speed in degree per second Calculates and store the time t for each recorded value of the piston angle Plots the displacement curve relative to the time, including title and axes labels exports it to a PDF file (you can also export it manually from the graphic window after the code executes) Uses Richardson numerical differentiation method to compute and store the velocity of the piston from the piston displacement and time values h. Page 8 i. Plots the velocity curve, including title and axes labels, in a separate window J Exports it to a PDF file (you can exportit maally from the graphic window after the code executes) Problem 6. This problem is similar to problem 5, except that it uses a user-written Scilab, or any programming language, code to fulfill the same tasks. Piston displacement and crank angle (in degree) are still obtained from Problem 3 of Lab assignment 01. The crankshaft, as in the previous problem, rotates at a constant angular speed (omega) of 1750 rpm in the counterclockwise direction. You are asked to write a code that does the following a. b. c. d. e. f. g. Asks the user to enter the value of the angular speed of the crank in rpm Asks the user the total number of crank angle values (data points), in degree, to be processed Accepts and store each value of the crank angle and the corresponding piston displacement Converts the value of the angular speed in degree per second Calculates and store the time t for each recorded value of the piston angle Plots the displacement curve relative to the time, including title and axes labels exports it to a PDF file (you can also export it manually from the graphic window after the code executes) Uses Richardson numerical differentiation method to compute and store the velocity of the piston from the piston displacement and time values h. Page 8 i. Plots the velocity curve, including title and axes labels, in a separate window J Exports it to a PDF file (you can exportit maally from the graphic window after the code executes)

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions