{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lubnow_Brian_HW_12

# Lubnow_Brian_HW_12 - 12R-CF ENGE1114-HW 12 Lubnow Brian 1/5...

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

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)

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Lubnow_Brian_HW_12 - 12R-CF ENGE1114-HW 12 Lubnow Brian 1/5...

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

View Full Document
Ask a homework question - tutors are online