Produce a report that contains written descriptions, analysis and mathematics that shows
how calculus can be used to solve an engineering problem. The tasks are to:
Use thinking methods to analyse the given engineering problem, e.g. break the
problem down into a series of manageable elements, and produce a specification
• Prepare a valid proposal for solving the problem and present it
• Produce mathematical models for the identified elements of the problem
• Apply calculus methods to produce answers for each of the elements
• Bring the elements together in a formal presentation
Fig: 1
Fig: 2
Problem 1: Matrix (Multiplication) Reloaded (MATLAB) Develop, debug, and test a function to multiply two matrices. That is, [X] = [Y][Z], where [Y] is m by n and [Z] is n by p. Test the program using the following matrices:
1. Using linear stability analysis, identify any restrictions on the step size for a stable solution. (a) Consider a lincar first order differential equation: -10y; y(0) = 10. (1) i. Clearly identifying your notation for discrete points, obtain a finite-difference ap- proximation for the above equation using Forward Euler scheme. Use At as your time-step for a uniformly spaced grid in time. ii. Obtain the amplification factor for the above finite difference approximation. iii. Identify if the above scheme is unconditionally unstable, conditionally stable, or unconditionally stable. If conditionally stable, obtain any time-step restrictions for which the scheme will produce stable result. Show all steps. (b) Consider a linear first order differential equation: dy dt =(-2+2i)y; y(0)=1; i =√1 (2) Repeat parts (i) (iii) above; i,e. find the amplification factor for the Forward Euler, and any restrictions on the step sizes for the Forward Euler method.
Problem 4: Spring back into PHYS 2 Three masses are suspended vertically by a series of identical springs where mass 1 is at the top and mass 3 is at the bottom. If g = 9.81 m/s², m₁ = 4 kg, m₂ = 3.25 kg, m3 = = 2 kg, and the k's 15 kg/s², solve for the displacements of a.
Question 1: The largest hydroelectric plant in the UK is found in Northumberland, located at the Kielder reservoir. During its operation, the minimum flowrate discharge of water runs at Q=1.32 m³/s (cumec), however throughout the year, as the reservoir level increases, the flow rate (Q) must be increased to different levels. One of the standard increases, is to change the flow rate from 3.5 m³/s to 7 m/s. Figure 1 shows a change in the flow rate ejection for the hydroelectric dam over a 210s period, represented in cm³/s for this 3.5 to 7 cumec flow rate change. Flow rate(t)= (-3.19892 10³) (t) + (2.77042 105) () + (-0.00928) (+³)+(1.49974) (t*) + (-1.18729= 10²) (³) + (4.25940 10³) (²) + (-5.42866 104) (t) + (3.50829 10°) (Egn. 1) From this derived flow rate information using equation 1, numerical integration can be used to calculate the area under the curve and therefore calculate the volume of water that is discharged through the hydroelectric plant over the timeframe. Use the composite Trapezoidal rule numerical method of numerical integration taught during the module to determine the volume of water discharged during the 210 seconds timeframe represented in Figure 1 and Equation 1. You must obtain an approximation of the volume in m³ (SI units), with a relative error of less than 0.00002%, when the analytical value is NOT known. During the numerical integration calculations, if the relative error is not reached during a loop, double the number of separations used over the timespan in the calculations for the following calculation cycle. (i) In the command window, display the integral value calculated for volume, the number of sections used in the numerical integration, and the relative error produced for each looped calculation using 'fprintf" and associated commands. Produce a single figure with two subplots, (1) showing the flow rate (m³/s) vs. time (t) of the flow rate equation in one plot at a suitable accuracy, and (2) a cumulative volume (m³) graph of the quantity of ejected water over time (s) in the second subplot. Produce a figure showing the total volume calculated against the number of separations used in each numerical integration calculation; use a logarithmic x-axis scale on the resulting plot.
Problem 1: Matrix (Multiplication) Reloaded (MATLAB) Develop, debug, and test a function to multiply two matrices. That is, [X] = [Y][Z], where [Y] is m by n and [Z] is n by p. Test the program using the following matrices:
Problem 3: GE with partial pivoting (MATLAB) 1. Develop, debug and test a program in MATLAB to solve a system of equations using Gauss elimination with partial pivoting. Base the program on pseudocode included below in Figure 1. Let the first line of the function be: function x = GaussPivot (A,b). 2. Test the program using the following system of equations, 4x1+x2-3 = -2, 5x1 + x2 + 2x3 = 4, 6x₁ + x₂ + x3 = 6. (5) 3. Modify the function so that it computes and returns the determinant (with the correct sign), and detects whether the system is singular based on a near-zero determinant. Define "near-zero" as being when the absolute value of the determinant is below a tolerance. When this occurs, design the function so that an error message is displayed and the function terminates. Let the first line of the new function be: function [x, D] = GaussPivotNew (A, b, tol).
3. A chemical compound decays over time when exposed to air, at a rate proportional to its concentration to the power of 3/2. At the same time, the compound is produced by another process. The differential equation for the instantaneous concentration is, where C(t) is the instantaneous concentration, Cinitial = 2000 is the initial concentration at t = 0. (a) First clearly write down your finite difference approximation for a general time, using the Forward Euler (Forward Difference) method. (b) Solve the differential equation (by writing a computer program) to find the concentration as a function of time from t = 0 until t = 0.5 s, using the Forward Euler method. Use a step size of h = 0.002 s and plot C(t) versus t. Provide your computer program and clearly indicate your algorithm with sufficient comments on the program. (c) How will you verify that your predicted answer is a reasonable estimate using this particu- lar numerical scheme? Accordingly, verify your answer and show proof of your verification study. (d) Now solve the problem using Backward Difference (Backward Euler) method. For that, write down the finite-difference approximation and then write a computer program to solve that finite-difference approximation. Note that, you will get an implicit relation and this would have to be solved iteratively. Provide your computer program and clearly indicate your algorithm with sufficient comments on the program. Use the same step size as above and plot C(t) versus t. (e) Do the Backward and Forward Euler schemes provide similar solutions for the step size chosen? Is one more accurate than the other? Why or why not?
Problem 2: Gauss elimination (Hand Write) 1. Solve by Gaussian elimination. Implement partial pivoting if necessary. Show all steps of the computation. 2. Substitute your results into the original equations to check your answers.
2. Consider the equation for the domain (a) Obtain an analytical solution to the above problem, i.e. Yexact (2). Box your answer. (b) Goal is to also solve the differential equation using a Forward Euler scheme (i.e. obtain YFE (2₂) at some discrete , locations). i. Using uniform grid spacing Ar between discrete points, first obtain a general finite- difference approximation (i.e. the equation is written for a general point z;, where j can be 0,1,2,3...etc.) using the Forward Euler scheme. Box your answer. ii. Rewriting the above equation as Conduct linear stability analysis to identify the maximum possible step size for a stable solution over the domain 0≤x≤ 10. Note that you will have to compare the allowable step sizes at different a locations, and choose the most restrictive one over - the entire domain i.e. use different values of z between 0 and 10, and see which one gives the most restrictive step size. iii. Write a Matlab program to solve the differential equation over the region 0 < r ≤ 10. Use three different step sizes Az - 0.1, 0.5, 1.0 and compare your numerical solution YFE(T;) to the exact solution by plotting them on the same graph [i.e. For each time-step, plot yexact versus z and ypg versus z on one plot. You will thus have three different figures for each Ar. Clearly label your plots, clearly identify exact and numerical solution on each plot. Use axis range of [0, 8] for the y axis and [0, 10] for the x-axis. Note that the exact solution should be plotted at finer intervals to obtain a smooth curve. Provide your matlab code and graphs.
Problem 2: Gauss elimination (Hand Write) 1. Solve by Gaussian elimination. Implement partial pivoting if necessary. Show all steps of the computation. 2. Substitute your results into the original equations to check your answers.