Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I NEED TO USE MATLAB FORMAT FOR THIS QUESTION Use these equations to calculate the values needed: = ( + )/2 Where is the spring

I NEED TO USE MATLAB FORMAT FOR THIS QUESTION

Use these equations to calculate the values needed: = ( + )/2 Where is the spring wire length, is the number of coils in the spring, is the outer diameter of the spring, and is the inner diameter of the spring. = ( )2 Where is spring mass and is the spring metal density. All springs in the system will be made with the same high-carbon steel. The steel, oil tempered ASTM A 229, has a density of 7.861 g/cm3. Program must work within a larger program structure so you must write it as a function based on what you know about the spring project and the other parts of the larger program. You know the following information: Your function will require two inputs: one input is the inner and outer diameters of the spring, the other input is the number of coils in the spring. The diameters and number of coils must meet certain criteria: o The diameter input variable must be a 2-element vector and the number of coils input must be a scalar. o The first element of the diameter vector must be the inner diameter (i.e., the smaller diameter). The inner diameter cannot be greater than 95% of the outer diameter. o Both elements within the diameter vectors must be lengths between 2.5 cm and 30 cm, inclusive. o The spring must have at least 4 coils. Your function must return two output arguments: wire length (scalar) and spring mass (scalar)

Function must follow flow chart

image text in transcribed

Once you have your function working, run it with the following test cases:

Test Case: Number of Coils :Diameters (cm) 1 :11: [9 13]

2: 5: [.5 2]

3: 2: [15.25 20.5]

4: 13: [4 5.5 6.4]

5:11: [13.5 15.5]

6: 9: [5 6.5]

7: 15: [0.5 2]

For each test case, paste your function call and printed display into the RESULTS section of your script as comments. Must include the function call for each test case with the results.

Get diameter vector from input arguments Define the spring metal density

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions