Question: Machine Elements: Matlab Programming Assignment 3 Matlab functions you need: function [sigrrvec,sigttvec]=pstress(P,a,b,r) %function 1: stresses due to pressure sigrrvec=-P*(b^2)*((a^2)-(r^2))/((r^2)*((a^2)-(b^2))); %Stress due to pressure in radial
Machine Elements: Matlab Programming Assignment
![Machine Elements: Matlab Programming Assignment 3 Matlab functions you need: function [sigrrvec,sigttvec]=pstress(P,a,b,r)](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f452065c64b_81366f45205b42e4.jpg)
3 Matlab functions you need:
function [sigrrvec,sigttvec]=pstress(P,a,b,r) %function 1: stresses due to pressure sigrrvec=-P*(b^2)*((a^2)-(r^2))/((r^2)*((a^2)-(b^2))); %Stress due to pressure in radial direction sigttvec=P*(b^2)*((a^2)+(r^2))/((r^2)*((a^2)-(b^2))); %Stress due to pressure in tangential direction end
function [sigzz1vec sigzz2vec]=mstress(M1,M2,x,y,I) %function 2:stresses due to bending moments sigzz1vec=(M1*x/I); sigzz2vec=(M2*y/I); end
function sigtzvec=tstress(T,r,J) %function 3: stress due to T sigtzvec=(T*r/J); end
Plots Source Code:
figure axes(FontSize,18) title(stresses due to torque or internal pressure) hold on xlabel(r position (in)) yyaxis left plot(rvec,sigtzvec,g) ylabel(sigtz (ksi)) yyaxis right plot(rvec,sigrrvec,k-,rvec,sigttvec,b-.) ylabel(sigrr or sigtt (ksi)) legend(sigtz,sigrr,sigtt) set(legend,Location,North,FontSize,18); hold off
figure axes(FontSize,18) title(stresses due to bending) hold on xlabel(x or y position (in)) yyaxis left plot(xvec,sigzz1vec) ylabel(sigzz1 (ksi)) yyaxis right plot(xvec,sigzz2vec) ylabel(sigzz2 (ksi)) legend(sigzz1,sigzz2) set(legend,Location,North,FontSize,18); hold off
A circular cylinder with inner radius b and outer radius a is subjected to four loads: an internal pressure P, a torque T (directed along the cylinder axis), a bending moment M1 (with the y axis the neutral axis), and a bending moment M2 (with the r axis the neutral axis). The stresses due to these loads are Write a Matlab program which computes and plots the stresses as a function of the coordinates r, r, y. You must use the source code on the page which follows to prepare the plots, where the Malab variables are defined orr values. sigttvec is a vector of values. sigzzl vec is a vector of axial stresses due to Mi, sigzz2vec is a vector of axial stresses due to M2, sigtzvec is vector of shear stresses due to T, rvec is a vector of r values, and xvec is a vector of r values (note that x and y vary over the same range). Assume the following parameter values: by: sigrrvec is a vector of a= 6.0 in, b= 3.0 in P= 10.0 ksi. T= 2.0106 in-lbf M=-105 in-lbf Me= 100 in-lbf
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
