Obtain the cross products using matlab cross function

Assignment Help MATLAB Programming
Reference no: EM13136450

Consider the planar linkage shown below. The crank (link with length R) will turn counter-clockwise with constant angular velocity. The slider will experience a force of 100 N directed to the left. Your task is to write a program that calculates the required input torque and the magnitude of the pin reaction forces for two revolutions of the input link. You will then use your program to determine how changing the dimension H changes the average magnitude of the pin reaction forces at pins A, B and C (refer to the free-body diagram for the location of these pins).

866_Newtons method.png

The first task is to determine the coordinates Φ, s given θ. The constraint equations that must be satisfied are:

2472_Newtons method1.png

You are required to solve these equations using Newton's method. The next task is to solve for the time derivatives of Φ, given θ(constant). Equations (1) and (2) may be differentiated to obtain the following linear systems of equation in the unknowns. You may use the MATLAB "\" operator to solve these.

540_Newtons method2.png

897_Newtons method3.png

The next step is to draw the free-body diagrams and write the corresponding dynamic equations. Following is the free-body diagram. Note that we are neglecting friction on the slider.

1220_Newtons method4.png

The resulting dynamics equations may be cast in matrix form as

127_Newtons method5.png

where m1 = 10 kg, m2 = 25 kg, m3 = 10 kg and I2 = m2 L2/12

1344_Newtons method6.png

929_Newtons method7.png

You may use the MATLAB cross function to obtain the above cross products. Note that the accelerations are known functions of the derivatives of the three coordinates.

Turn in a brief report containing the following:

(i) title page
(ii) introduction and objectives
(iii) program design (choices for functions)
(iv) results including plots (labeled) of simulation results for the base case

105_Newtons method8.png

(v) include a plot displaying the average value of the magnitude of the pin reaction forces over the complete cycle vs. H for the range -0.7≤H≤0.7
(vi) discussion of results including conclusion for part (v)

Code:

m.file for kinemt
function [x,v,a] = kinemt(R,L,H,theta,xo,omega,alpha)
phi = xo(1);
s = xo(2);
% constraint equations
f(1) = R*cos(theta)+L*cos(phi)-s;
f(2) = R*sin(theta)+L*sin(phi)-H;
while f*f'>1.0e-8
Jac = [-L*sin(phi) -1;
L*cos(phi) 0];
dx = -Jac\f';
phi = phi+dx(1);
s = s+dx(2);
f(1) = R*cos(theta)+L*cos(phi)-s;
f(2) = R*sin(theta)+L*sin(phi)-H;
end
x = [phi,s]';
Jac = [-L*sin(phi) -1;
L*cos(phi) 0];
rhsv = [R*sin(theta)*omega -R*cos(theta)*omega]';
v = Jac\rhsv;
rhsa = [R*cos(theta)*omega^2+L*cos(phi)*v(1)^2;
R*sin(theta)*omega^2+L*sin(phi)*v(1)^2];
a = Jac\rhsa;
m.file for loader
function [system, rhs] = loader(R,L,H,theta,x,omega,alpha,v,a,PoA);
m1 = 10;
m2 = m1*L/R;
m3 = m1;
I2 = m2*L^2/12;
g = 10;
R1 = 0.5*R*[cos(theta) sin(theta) 0]';
omega1 = [0 0 omega]';
temp1 = cross(omega1, R1);
a1 = cross(omega1, temp1);
R2 = 0.5*L*[cos(x(1)) sin(x(1)) 0]';
omega2 = [0 0 v(1)]';
alpha2 = [0 0 a(1)]';
temp2 = cross(omega2,R2);
a2 = cross(omega2,temp2)+cross(alpha2,R2)+2*a1;
a3 = [a(2) 0 0]';
system = zeros(7);
rhs = zeros(7,1);
system(1,1) = 1;
system(1,3) = 1;
rhs(1) = m1*a1(1);
system(2,2) = 1;
system(2,4) = 1;
rhs(2) = m1*(a1(2)+g);
system(3,1) = 0.5*R*sin(theta);
system(3,2) = -0.5*R*cos(theta);
system(3,3) = -system(3,1);
system(3,4) = -system(3,2);
system(3,7) = 1;
system(4,3) = -1;
system(4,5) = 1;
rhs(4) = m2*a2(1);
system(5,4) = -1;
system(5,6) = 1;
rhs(5) = m2*(a2(2)+g);
system(6,3) = -0.5*L*sin(x(1));
system(6,4) = 0.5*L*cos(x(1));
system(6,5) = system(6,3);
system(6,6) = system(6,4);
rhs(6) = I2*a(1);
system(7,5) = -1;
rhs(7) = PoA+m3*a3(1);
main m.file for project
R = 0.5;
L = 1.25;
H = 0.25;
omega = 25;
alpha = 0;
PoA = 1000;
index = 0;
for H = -0.7:0.05:0.7
H
for k = 1:721
theta(k) = (k-1)*2*pi/360;
if k == 1
xo = [0 L+R]';
else
xo = [phi(k-1) s(k-1)]';
end
[x,v,a] = kinemt(R,L,H,theta(k),xo,omega,alpha);
phi(k) = x(1);
s(k) = x(2);
phid(k) = v(1);
sd(k) = v(2);
phidd(k) = a(1);
sdd(k) = a(2);
[system,rhs] = loader(R,L,H,theta(k),x,omega,alpha,v,a,PoA);
forces = system\rhs;
torq(k) = forces(7);
pin1(k) = sqrt(forces(1)^2+forces(2)^2);
pin2(k) = sqrt(forces(3)^2+forces(4)^2);
pin3(k) = sqrt(forces(5)^2+forces(6)^2);
end
index = index+1;
HH(index) = H
p1m(index) = max(abs(pin1));
p2m(index) = max(abs(pin2));
p3m(index) = max(abs(pin3));
p1a(index) = max(abs(pin1));
p2a(index) = max(abs(pin2));
p3a(index) = max(abs(pin3));
end
plot(HH,p1m,'r',HH,p2m,'g',HH,p3m,'b')
pause
plot(HH,p1a,'r',HH,p2a,'g',HH,p3a,'b')
pause
subplot(211)
plot(theta,phi)
subplot(212)

Reference no: EM13136450

Questions Cloud

Two contending grand theories : There are two contending grand theories - realism and liberalism - that attempt to explain why states act as they do in our global system. Compare and contrast the major elements of these two theories.
Provide descriptive statistic used to estimate women : Abnormalities that might lead to cancer. Provide a descriptive statistic that could be used to estimate the number of women out of 1000 in this population.
Contending theories of causes of cold war : Discuss contending theories of causes of Cold War. What are they? Which theory do you find most persuasive, and why? Describe the long-cycle theory and discuss the possible implications the peaceful end of the Cold War might have on this theory.
How long does it take for cobalt-60 to decay : Cobalt-60 is commonly used as a source of B-particles. How long does it take for 87.5% of a sample of cobalt-60 to decay, given that the half-life is 5.36 years?
Obtain the cross products using matlab cross function : Use MATLAB cross function to obtain the above cross products. Note that the accelerations are known functions of the derivatives of the three coordinates.
How much are total overhead costs at this flexible budget : The actual activity level was 110000 direct labor hours so Caldwell prepared a flexible budget at 110,000 labor hours. How much are total overhead costs at this flexible budget level of activity?
Present value of cash inflows for project : Using the net present value method, the present value of cash inflows for Project A is $44,000 and the present value of cash inflows of Project B is $24,000. If Project A and Project B require initial investments of $40,000 and $20,000, respective..
Draw the normal curve model for auto fuel economy : Draw the normal curve model for auto fuel economy, following the 68-95-99.7 rule. Clearly label the X-axis with the mpg for the appropriate points.
Americanization-conservatives-liberals and government : Are we doing enough to "Americanize" children and immigrants to America? Given that political socialization is the key to sustaining important political virtues and attitudes, should we be doing more to reinforce traditional American political val..

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Develop a well-structured function

Develop a well-structured function to compute v as a function of t. Then use this function to generate a table of v versus t for t = -5 to 50 at increments of 0.5.

  Parking in garage using matlab

In matlab: parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour.

  Compare with the true value

compare with the true value of 6.737947 x 10 -3  . Use 20 terms to evaluate each series and compute true and approximate relative errors as terms are added.

  Create a matlab program

Create a MATLAB program that will use MATLAB's fzero function to determine d for the following parameters: R = 0.5 m and in steps of 0.1. Create a table consisting of S and d .

  Implement the finite difference method

Write a computer program to implement the finite difference method. The program can be in any computer language that is available within the school. Set up the code to find the potential for a parallel plate capacitor in the box shown below, all dime..

  Write the command and assign it to variable

Write the command and assign it to variable , Write a function named function_test

  Write a program to compute a

Write a program to compute A. Test it with P = $55,000 and interest rate of 6.6% (i = 0.066). Compute results for n = 1, 2, 3, 4, and 5 and display the results as a table with headings and columns for n and A

  Determine the stability status for the digital system

Sketch the z-plane pole-zero plot and determine the stability status for the following digital system.

  Linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM.

  Boundary conditions for the finite element model

The computer program or the finite element model for one value of a and the excel file for finite element results processing;Boundary conditions for the finite element model

  Write project report and provide cross-synthesis

Write project report and provide Cross-synthesis.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd