Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Preview File Edit View Go Tools Window Help 4 L2 Wed Mar 3 9:27 CMPSC_200_Project_6_Spring_2021.pdf Page 1 of 2 Q Q Search CMPSC_200_Project_6_... Project 6
Preview File Edit View Go Tools Window Help 4 L2 Wed Mar 3 9:27 CMPSC_200_Project_6_Spring_2021.pdf Page 1 of 2 Q Q Search CMPSC_200_Project_6_... Project 6 Due: March 4, 2021 Shot 19.09.56 Objective Using Matlab functions to find manufacturing costs. Project A fenced enclosure consists of a rectangle of length L and width 2R with a semi circle of radius R as shown in the figure. The enclosure to be built to have an area A m. The cost of the fence is curved per meter for the curved portion and Cstraight per meter for the straight sides. Your program shall have the user enter the area of the enclosure, the cost for a curved piece, and the cost for a straight piece. The program will then calculate the optimal dimensions of the enclosure based upon the minimum cost and the cost to construct it. The program must be written using top-down design. You will need your driver function, a printSplashScreen function, a single wrapper function in which the user will enter the area and the unit costs, an anonymous function that returns the cost of the enclosure, and a function that prints the results. The output must include the area of the enclosure, the length and radius, the cost of the straight lengths, the cost for the curved length, and the total cost of the enclosure. R 2 2R Preview File Edit View Go Tools Window Help 0 L2 Wed Mar 3 9:27 CMPSC_200_Project_6_Spring_2021.pdf Page 1 of 2 a Q Search CMPSC_200_Project_6_... Description The area of the enclosure as a function of L and R is Shot 19.09.56 A(L, R) = 2RL + TR 2 C(L, R) = straight (2R+2L) + Carwa TR An issue is that the cost is a multivariate function. Minimization requires a single variable function. Thus we will solve the area equation for L and use that in the cost function. een Shot 3.09.27:15 2 A(RL) = 2RL + 2RL RA 2 TR2 A- 2 1 TR2 A- 2R 2 L(RA) Preview File Edit View Go Tools Window Help 4 L2 Wed Mar 3 9:27 CMPSC_200_Project_6_Spring_2021.pdf Page 2 of 2 Q Q Search CMPSC_200_Project_6_.... ZR 2R AR 4 Shot 19.09.56 This can be used to calculate a new cost function C(L, R) Csiraigh (2R+2L) + CarR AR Corsight 2R+2 2R CR; 4) + Curve TR CPR" (4R? + 2A TR) + Curves IR Ben Shot 3. 09.27.15 Program In your program you will have print the splash screen. This will be followed by a calling a function to have the user enter only the Area. You will then write an anonymous function for the cost. In this cost function, A is a parameter, not a variable since it is set by the user. Thus the cost function is determined by R alone. . You will then pass the cost function to fminbnd and use the return value as the radius at which the cost is minimized. You can then pass Rmin to the cost func- tion to calculate the minimum cost. You will also write a function that calculated L from the radius and the area. Area, Radius, Length, and Cost will be passed to a print_results function that print the results of the analysis. Your program must be well documented with comments including the intro- ductory comments consisting of your name, the date, and a description of the program Submission Upload your script file (the file that ends with .m) to Canvas by 11:59 PM on Thursday, March 4, 2021. 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started