Engineering and Computing:
1. System of linear equations
Consider the following system of linear equations:
4×2 + 2×1 – 35 +4×3 – x4 = 2
6×3 + 8×2 – 40= 0
7×1 + 5×2 + 6×4 + 3×3 = 39
–x1 + 4×2 – 9×3 + 7×4 = -54
Use MATLAB to find the values (if any) of x1, x2, x3 and x4 which satisfy this set of linear equations.
Study Group University of Lincoln
2. Question 2:
Dribblefire Jets make two types of jet, the two-engined DFII and the four-engined DFIV. The engines are terrible and fail with probability 0.5 on a standard flight (independently of each other). The manufacturer claims that the planes can fly if at least half of their engines are working—that is, the DFII will crash only if both engines fail while the DFIV will crash if all four, or if any three, engines fail.
You have been commissioned by the Federal Aviation Agency to ascertain which of the two models is less likely to crash. Since parachutes are expensive, the cheapest (and safest!) way to do this is to simulate a large number of flights of each model. For example, two calls of Math.random can represent one standard DFII flight: If both random numbers are less than 0.5, that flight crashes; otherwise, it doesn’t. Write a solution which simulates a large number of flights of both models and estimates the probability of a crash in each case. If you can run enough simulations, you may get a surprising result. (Incidentally, the probability of n engines failing on a given flight is given by the binomial distribution, but you do not need to use this fact in the simulation.)
1. Create a function which generates two vectors with n random numbers in the range 0-1, and write them into a file. This function should have the following definition:
function generateDFIIExperiment(filename, n)
% filename: the name for saving the generated numbers % n: the number of random numbes in this experiment.
2. Create a function which generates four vectors with n random numbers in the range 0-1 and write them into a file. This function should have the following definition:
function generateDFIVExperiment(filename, n)
% filename: the name for saving the generated numbers % n: the number of random numbes in this experiment.
3. Create a function which load two experiment files (one for each jet type), and check for each jet if it can fly as mentioned in the question. Then display a graph of the engine flying case for each experiment.
function checkFly(DFIIfile, DFIVfile) %DFIIfile: file name of the DFII experiment %DFIVfile: file name of the DFIV experiment
4. Call these methods with different n vales (10,100, 1000, 10000…) (4 marks)
5. Explain which of the two models (DFII and DFIV) is less likely to crash
6. Write a report about your experiments and analyze the results.