Search for question
Question

Assignment 1 (10 marks) There are two questions in this assignment: Question 1 is an LP problem, Question 2 is an NLP problem. Hint: First establish the mathematical model based on the lecture slides. Then get start with MATLAB. Get familiar with the MATLAB program codes provided, L1_ex1_1_simple.m and L1_ex1_3_simple.m or L1_ex1_1_standard.m and L1_ex1_3_standard.m. The simple version of these two codes do not include how to plot the feasible areas and are therefore more suitable for students who are not very familiar with MATLAB. Try to understand the functions in the programs by using MATLAB online help and reading the necessary document. Then obtain the graphical solutions to the following two questions by making necessary changes to the codes. Please go to the tutorial classes to know more about MATLAB, the modelling, and the detailed requirements. You must complete the MATLAB quiz in Week 0 before submitting Assignment 1, otherwise your assignment will be marked as a 0. Question 1: The local bookstore must determine how many of each of the four new books on photonics it must order to satisfy the new interest generated in the discipline. Book 1 costs $50, will provide a profit of $10, and requires 3 inches of shelf space. Book 2 costs $70, will provide a profit of $12, and requires 8 inches of shelf space. Book 3 costs $80, will provide a profit of $8, and requires 2 inch of shelf space. Book 4 costs $65, will provide a profit of $15, and requires 2 inches of shelf space. Find the number of each type that must be ordered to maximize profit. Total shelf space is 620 inches. Total amount available for ordering is $9500. It has been decided to order at least 20 Book 3. (1) Establish the model of the optimisation problem. State clearly in words what the decision variables are, what the objective function and the equation/inequality constraints represent. (2) Suppose the number of Book 3 is half the number of Book 1, and the number of Book 4 is fixed as 13, establish the model of the new optimisation problem. (3) For the model established in step (2), obtain the graphical solution using MATLAB. (4) Change one of the parameters to cause the optimal solution (optimal design variables) changes and solve the problem again. 1 Question 2: Determine the objective function for building a minimum-cost cylindrical tank of volume 60m3 and the height should be at least 2m longer than the radius, it should be noted that the cylindrical tank does not have a lid. If the circular ends cost $12 per m2 , the cylindrical wall costs $5 per m2 , the reinforcement cost for the base is $20 per m2, and it costs $30 per m2 for the protecting material over the whole surface (double sides). Additionally, the base requires an extra 10% of its total cost for transportation and installation fees. (1) Establish the mathematical model of the optimisation problem. State clearly in words what the decision variables are, what the objective function and the equation/inequality constraints represent. (2) Draw the graphs and find the optimal solution (graphical solution). (3) Change one of the parameters to cause the optimal solution (optimal design variables) changes and solve the problem again. (4) If this tank needs a lid, rebuild the mathematical model and solve the problem again. 2 Assignment 1 Submission Guide · Attempt two questions: one linear programming problem (questions 1) and one non- linear programming problem (questions 2). · Write a short report in PDF document format. Submit the written code separately (MATLAB scripts) for each question you have attempted along with the report. Make sure to name the files with the question number and name the MATLAB script (.m extension file) with your student ID. Submit the files to Canvas TurnItIn using the multiple file upload option. For example, the three files could be: Assignment_1_DOM_13123456.PDF, Qestion_1_DOM_13123456.m and Qestion_2_DOM_13123456.m . File Upload Text Entry Upload a file, or choose a file you've already uploaded. File: Choose file No file chosen PDF report + Add Another File MATLAB scripts (.m file) Click here to find a file you've already uploaded Comments ... Cancel Submit Assignment . No marks will be given if you do not upload the MATLAB scripts along with the report. · The assignment is worth 10 marks, each question is worth 5 marks. · For question1: o For sub-question (1), write the model of the optimisation problem (0.5 marks), describe the decision variables, objective function, and equality/inequality constraints (1 mark) o Solve sub-question (2) (0.5 marks) o For sub-question (3), find the optimal solution by the code of MATLAB and give an image of the graphical solution (2 marks) 3 o For sub-question (4), find the optimal solution and write the values of the design variables, objective function, and equality/inequality constraints (0.5 marks). Given the corresponding code and the image of the graphical solution (0.5 marks) · For question 2: o For sub-question (1), write the model of the optimisation problem (0.5 marks), describe the decision variables, objective function, and equality/inequality constraints (1 mark) o Solve sub-question (2), find the optimal solution by the code of MATLAB and give an image of the graphical solution (1.5 marks) o For sub-question (3), find the optimal solution and write the values of the design variables, objective function, and equality/inequality constraints (0.5 marks). Given the corresponding code and the image of the graphical solution (0.5 marks) o If this tank needs a lid, rebuild the mathematical model (0.5 marks) and solve the problem again (0.5 marks). · Include the code with proper comments in line to explain each code line that you have written to solve each question and attach it with the report. . For clarity, we might ask you to explain what you have written and how the code works. No mark will be given if you cannot explain the results and the code. . Any suspicious plagiarism will be reported to the university for further investigation. And the mark will not be given until the investigation is finished. . As stated in the subject outline, "Work submitted late without an approved extension is subject to a late penalty of 10 per cent of the total available marks deducted per calendar day that the assessment is overdue (e.g. if an assignment is out of 40 marks, and is submitted (up to) 24 hours after the deadline without an extension, the student will have four marks deducted from their awarded mark). Work submitted after five calendar days is not accepted and a mark of zero is awarded". 4


Most Viewed Questions Of Matlab And Simulation

ASSIGNMENT: MATLAB Using Matlab software, do the analysis on the system in Figure 1. 1. If P-Controller, G₁ = K, Obtain the Value of K for damping ratio, & = 0.707? Calculate the maximum overshoot. What is the natural frequency of the system? Plot the time response of this system if it is excited with a step input signal. 2. If I-Controller, Gc= is used, what is the value of K; for damping ratio, { = 0.707? Calculate the maximum overshoot. What is the natural frequency of the system? Plot the time response of this system if it is excited with a step input signal. 3. If PI-Controller, G₁ = K(s+K) is used, what is the value of K and K, for damping ratio, { = 0.707? Calculate the maximum overshoot. What is the natural frequency of the system? Plot the time response of this system if it is excited with a step input signal. 4. Superimpose all the three output responses obtained above and make comparison. Discuss the effect of K; on the root locus and the transient response. U(s) + Gc Figure 1 1 (s + 1)(s + 2)(S + 4) Y(s)


Problem 1. (25 pts) Use the AE5031_HMW1_1.m code to solve the ODE df/dt = -f, f(0) = 1. a) [5 pts] Find the exact solution. b) [10 pts] Use the code for various timesteps 4t and calculate the error= | Exact- Numerical/Exact as a function of the Dt at time time t = 1. c) [10 pts] Plot the error versus the At on a logarithmic scale to confirm that the error decreases proportionally to the 4t (1st order accuracy)


Question 1 20 pts For cruise control, the longitudinal motion of a vehicle on a flat road can be modeled by the first-order nonlinear differential equation mvu - Kv - Kav², where m is the vehicle's mass, v is its speed, u is the tractive force generated by the engine, is the viscous friction force, and is the aerodynamic drag. Suppose m = 4500 lbs, Kf = 2.5N/(m/s), and K = 0.8N/(m/s)². (3+7 + 10 = 20 pts) 1. Define equilibrium values for all variables of interest for the desired equilibrium point where the equilibrium speed is ū=65 mph. 2. Linearize the system around this equilibrium point, defining all variables in the equation clearly, and specify the linearized transfer function (numerical values). 3. Suppose that the custom is at/n3. Suppose that the system is at equilibrium (at 65mph), and the road grade suddenly increases to 3% (see Elevation Grade Calculator (omnicalculator.com) if you need help with this term). The equations will now change to mi = u - K₁v-K₁v² - mgsin(0), and the speed will drop. Can you use linearization to design a control law of the form u=ū+ Au, Au=-kAv, Av=v- i , where k is the gain of the controller that you will choose by "experimentation" (too small a gain and it won't have much effect, too large a gain might cause the throttle to saturate in a real-world scenario) to bring the car speed back (close) to the equilibrium value of 65mph ? If so, show me a simulation for 10 min of the system where the grade abruptly changes from 0 to 3% at 5mins, and then drops back to zero at 7mins. Include 2 subplots, one where there is no feedback control. I.e.. Ava - SO/nequilibrium value of 65mph ? If so, show me a simulation for 10 min of the system where the grade abruptly changes from 0 to 3% at 5mins, and then drops back to zero at 7mins. Include 2 subplots, one where there is no feedback control, i.e., Au = 0, so that u =ū, and a second subplot where you have designed the above controller for an appropriately chosen gain k. Are you able to make the error converge to zero? Why do you think the above controller is unable to do so ? Later on in the course, we will see how to use integral control to make the "steady-state error" (i.e, the error as t → ∞o) zero. Upload Choose a File


3. Go to the [File] menu and move down to [New] and select [M-file]. An M- file is just a text file that contains MATLAB commands. Type in the commands given below, which create a function called GetLine, for returning the equation of a line that connects two input points. function [y,A,B) GetLine (x1, y1, x2, y2); function [y, A, B] = GetLine (x1, y1, x2, y2); If only one set of coordinates is entered, assume the second point is the origin at (0,0). if (nargin=-2) x2 = 0; y2 = 0; end m = (y2-yl)/(x2-x1);&m=slope of line by-axis intercept This function takes two sets of points: (x1, y1) and (x2, y2) and returns the equation of the line connecting them in the variable y. A and B are optional parameters that represent the smallest and largest x coordinates of the points entered. by2m*x2; syms x; y = m*x + b; A B return W- min (x1, x2); max (x1, x2); After you have typed in the commands, save this file as GetLine.m in the directory you created called mymatlab. When calling this function, notice that it returns three variables. If only one variable is given to hold the return value, only the formula of the line is returned. For example: » w = GetLine (2, 5, 1,7) A- -2*x+9 But if the lower and upper limits are needed, then call the functions using: » [w, A, B] = GetLine (2, 5, 1,7) -2*x+9 B = Define x as symbolic y the equation of line 1 A smallest x coordinate B = largest x coordinate 2


2. Start running MATLAB at your computer. The first window that MATLAB loads up is the command window, which is blank except for the prompt »>. Change the current working directory to the mymatlab directory, i.e. type: >> cd c:\temp\mymatlab


The simple all-revolute 4-bar linkage shown below has an input angle of 60 degrees. Write a MATLAB.m file that performs the Newton-Raphson's method to solve for 3 and 4. Submit your code and your answer for full credit. 90'0 2 0.15 m 0.18 m 3 4 0₂ 3 0.08 m Ө.


Throughout the next several weeks you will be developing a computer program to perform a complete analysis of a four-bar linkage. This current assignment only requires the position analysis. Velocity, acceleration, and force analyses will be added in the future. You may use any programming language. I suggest that you will want a procedural language (eg, Matlab, C++, Fortran). Input the rigid dimensions of a four-bar linkage. Your program should be flexible enough to readily accept any dimensions, ie, it should not be hard-wired for only one specific set of dimensions. Perform a position analysis of the linkage for the complete range of motion of the input link. Allow for choice of form of assembly. Inputs: R₁, R₂, R3, R4. Bp. p.Open or crossed, increment of 2 Outputs: 3, 4, and the absolute position of P, all tabulated for the entire range of 2 (b) (c) Rp (d) R₂ Homework 4 ME 3313 Fall 2023 Assigned: 9/5/2023 Bp Y answers. Program listing: P 0₂ 03 R₁ Each programming submission should include the following, submitted as a scanned image or pdf file: (a) R4 04 X Cover memo: This memo should briefly summarize what follows. Describe any known bugs or incorrect This is a text document of the program code, not the MATLAB executable. The program must be documented. Make it easy to understand what is going on. Sample run: Show a sample run with the output of the program using the following data: R₁ = 0.6 m; R₂= 0.2 m; R3 = 0.3 m; R4= 0.4 m; Bp = 0.2 m; p= 35° Verification of answers: It is important to verify your answers. In addition to the penalty for incorrect answers, you can lose another 10% for not knowing that your answers are incorrect. There is no excuse for not checking the validity of your numbers. Don't skip or skimp this part of the assignment. Include documentation that shows your verification. You will want to spot check the results for at least one position, including open and crossed configuration. You will also want to confirm that your range of motion is correct.


Problem #1: Finite element beam problem L=1m Radius of the beam r=2 cm, and elastic modulus E = 200 GPa. Assume the beam is undergoing a small linearly elastic deformation. 8 a) Using MATLAB, analytically compute the deflection at the free end of the beam using the following equation: P = 100 N Px² 6EI (3L - x) b) Using the finite element method (FEM) with five beam elements of equal length: Generate the individual stiffness matrices K₂ for each element of the beam and assemble them into the global stiffness matrix Kg. Print each of the individual matrices and the global stiffness matrix. Calculate and print the displacements and rotations (in degree) for each node of the beam. Calculate and print the reaction forces and moments at each node of the beam. c) On the same figure, plot the vertical deflection throughout the beam for both analytical and FEM solution. Include title, axis labels, legends, and grid. Compare and discuss the two solutions. d) Discuss how you would increase the bending stiffness of the beam when the cross-sectional area and material must be kept the same. e) Perform Model (Frequency) Analysis of the beam in Solidworks. Take screen shot of the first three modal shapes along with their frequencies (make sure the values are readable). f) Validate the 1st natural frequency from part (e) using analytical modal analysis for cantilever beam


Problem 4. (10 pts) Determine the approximate forward difference representation for which is of the 0 (Ax), given evenly spaced grid points as shown in Figure below by means of: a) Taylor series expansion b) Forward difference operators X₂ f₁+2 X1+2 AX-XX X1+5 X


Problem 3. (15 pts) Consider the advection equation du + c(x)=0 with c(x) = x - 1/2 a) [10 pts] Find and sketch the characteristic for the computational domain 0 < x < 1 and 0 < t < 1 b) [5pts] Find the correct number of initial and/ or boundary conditions to specify at x = 0,1 and t = 0,1