Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP WITH THE QUESTION 2.. in brackets where it is written see part i, ii,,,,, these are just instructions. I am sharing the function

NEED HELP WITH THE QUESTION 2.. in brackets where it is written see part i, ii,,,,, these are just instructions. I am sharing the function code used... but I need the codes for all part if anyone can solve..

x_rectangle can be x_1,x_3 as these are associated with two rectangles in region 1 &3, while region 2 is x_trapezoid which can be replaced with x_2. Similarly, area_1,area_2,area_3 and like this y also.

Thankuimage text in transcribedimage text in transcribedimage text in transcribed

2. From previous examples we are able to determine the center of mass (CM) of a three-section column for a given set of dimensions. However we can create a function to input ANY other value for these dimensions and determine the CM for a given configuration. (i) Create a function three_col that inputs wi, hi, h2, h3, w3 and outputs areacol, xCol, ycol. Save this function in lib/ folder. W3 Figure 2: General cross-section of a bridge column (ii) Within this function determine area, x and y coods of each section using the geo_rectangle(width, height) and geo_trapezoid(width, height) functions (see part 1b, 1ci) (iii) Then determine the total area, x and y cood of the entire column using geo_column (see part 1cii) (iv) Witin HW2 script, run geo_column three times, each with a different set of heights and widths (see HW guide) (v) Using fprintf, print area, x and y coordinates of three other sets of columns with dimensions in the table format: column width=10, precision=3, alignment=left. Do not print from the function! area x_center Col1 areaCol1 xCol1 Col2 areaCol2 xCol2 Col3 areaCol3 xCol3 y_center yCol1 yCol2 Col3 function [area_rectangle, x_rectangle, y_rectangle] = geo_rectangle (height,width) GEO_RECT Computes geometric properties of a rectangle area_rectangle = height*width; Y_rectangle = height/2; x_rectangle = width/2; end function [area_trapezoid, x_trapezoid, y_trapezoid] = geo_trapezoid(w3, w1, h2) & GEO_trapezoid Computes geometric properties of a trapezoid area_trapezoid = h2* (w3+wl)/2; c = (wl - W3)/2; x_trapezoid = (2*w3*c+w3^2+c*wl+w3w1+w1^2)/(3* (W3+w1)); y_trapezoid = h2* (2*w3+wl)/(3* (w3+wl)); end function [areacol, Col,....] = geo_column (x1,x2,x3, ....) % This function calculates geometrical properties like total area and % centroid coordinates end function (%output variables] = three_col (% input variables). function call for geo_rectangle, geo_trapezoid to get areas and x1, yl.... of function call for geocolumn to get centroid and total area. end 2. From previous examples we are able to determine the center of mass (CM) of a three-section column for a given set of dimensions. However we can create a function to input ANY other value for these dimensions and determine the CM for a given configuration. (i) Create a function three_col that inputs wi, hi, h2, h3, w3 and outputs areacol, xCol, ycol. Save this function in lib/ folder. W3 Figure 2: General cross-section of a bridge column (ii) Within this function determine area, x and y coods of each section using the geo_rectangle(width, height) and geo_trapezoid(width, height) functions (see part 1b, 1ci) (iii) Then determine the total area, x and y cood of the entire column using geo_column (see part 1cii) (iv) Witin HW2 script, run geo_column three times, each with a different set of heights and widths (see HW guide) (v) Using fprintf, print area, x and y coordinates of three other sets of columns with dimensions in the table format: column width=10, precision=3, alignment=left. Do not print from the function! area x_center Col1 areaCol1 xCol1 Col2 areaCol2 xCol2 Col3 areaCol3 xCol3 y_center yCol1 yCol2 Col3 function [area_rectangle, x_rectangle, y_rectangle] = geo_rectangle (height,width) GEO_RECT Computes geometric properties of a rectangle area_rectangle = height*width; Y_rectangle = height/2; x_rectangle = width/2; end function [area_trapezoid, x_trapezoid, y_trapezoid] = geo_trapezoid(w3, w1, h2) & GEO_trapezoid Computes geometric properties of a trapezoid area_trapezoid = h2* (w3+wl)/2; c = (wl - W3)/2; x_trapezoid = (2*w3*c+w3^2+c*wl+w3w1+w1^2)/(3* (W3+w1)); y_trapezoid = h2* (2*w3+wl)/(3* (w3+wl)); end function [areacol, Col,....] = geo_column (x1,x2,x3, ....) % This function calculates geometrical properties like total area and % centroid coordinates end function (%output variables] = three_col (% input variables). function call for geo_rectangle, geo_trapezoid to get areas and x1, yl.... of function call for geocolumn to get centroid and total area. end

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_2

Step: 3

blur-text-image_3

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions