Lubnow_Brian_HW_12

Lubnow_Brian_HW_12 - 12R-CF 11/14/2011 ENGE1114-HW 12...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
12R-CF 11/14/2011 ENGE1114-HW 12 Lubnow, Brian 1/5 PROBLEM STATEMENT: Prepare a Matlab program for an algorithm to calculate the resultant of several forces DIAGRAM: SOLUTION: % Prepared by Brian Lubnow on 11/13/2011 %This program is designed to calculate the resultant of a concurrent force %system based on several forces input by a user. k=0; sumx=0; sumy=0; n=input( 'Enter the number of forces to be added: ' ); units=input( 'Enter the units for the force magnitude: ' , 's' ); fprintf( 'Magnitudes must be greater than zero. Direction is measured counter clockwise positive from the +x axis and must be between -180 and 180 deg\n' ) for k=1:1:n fprintf( 'For force #%.0f, ' ,k) F=input( 'Enter the magnitude: ' ); th=input( 'Enter the direction in degrees: ' ); Fx=F*cosd(th); Fy=F*sind(th); sumx=Fx+sumx; sumy=Fy+sumy; anglerad=atan(sumy/sumx); angle=(anglerad*360)/(2*pi); r1=sumx^2 + sumy^2; r=r1^.5; end fprintf( 'The resultant is %.2f %s @ %.2f deg\n' ,r,units,angle)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12R-CF 11/14/2011 ENGE1114-HW 12 Lubnow, Brian 2/5 RESULTS Enter the number of forces to be added: 3 Enter the units for the force magnitude: N Magnitudes must be greater than zero. Direction is measured counter
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/05/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Page1 / 5

Lubnow_Brian_HW_12 - 12R-CF 11/14/2011 ENGE1114-HW 12...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online