Description

matlab code

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Related Documents

Share

Transcript

UoB number: .. Computer User Name: ..
Computer Applications of Numerical Methods, ENG4037M
***
Example Assessment
***
READ ME FIRST
: Save your files in your exams directory W:\ENG4037M\Assessment1\username
ANSWER ALL THREE QUESTIONS DO NOT OPEN THE FILE AFTER THE ASSESSMENT AS THIS WILL VOID ITS CONTENTS
Write your answers, as requested, on this sheet. Leave your solution files numbered by question number and section in your exam directory. Examples are:
q1a.m
(for a matlab solution to question 1 part a.)
q1b.m
(for a matlab solution to question 1 part b.)
q3a.xlsx
(for a spreadsheet solution to question 3, part a). This Assessment is OPEN BOOK, however all forms of communication are expressly forbidden Marks are awarded for: accuracy of program or spreadsheet, annotation of program or spreadsheet, explicit calculation and output of required answers by the program or spreadsheet, clearly indicated answers in a spreadsheet (Highlight answers in RED) accuracy and clarity of answers given in this booklet.
This page will not be with an exam. The following gives a gauge of how marks are awarded
Answers on script as requested 20% Program/spreadsheet accuracy 30% Calculation method (where relevant). Automatic methods better than graphical or ‘trial and error’ 20% (e.g finding time/distance/highest/lowest/fastest etc by algorithmic means rather than finding point on a plot, or ‘trial and error’ methods Annotations 20% (comments in matlab program, labelled and highlighted matrices & vectors in Excel) Clearly visible answers 10% (highlight solution vales in RED in Excel, output answers to screen in Matlab)
Hints:
save your work periodically – this helps in case something goes wrong (eg a program ‘lock up’ If a minor disaster happens with file naming, you will get all marks provided the relevant work is there somewhere in your directory.
Note:
In Excel the error which can lock-up a spreadsheet
“ You cannot change part of an array”
can be escaped by pressing
“Esc”
Then, if appropriate, delete the faulty array/vector and redo it
Question 1
a. A steel ball of 10 kg mass is fired from a cannon at 800m/s at an angle of 30 degrees to the horizontal. Air resistance is equal to
23
104
V
−
×
Newtons, where
V
is velocity. Write and submit an annotated time stepping simulation in Matlab, called
q1a.m
, to plot its flight in (x,y) coordinates. Take acceleration due to gravity to be 9.81 m/s
2
. How far will the ball travel before hitting the ground, and how long will it take?
Give the answers to 3 significant figures accuracy and show through time step reduction that the answers are accurate to 3 significant figures. [60%] Fill in the following answers: Distance travelled = metres ; Time of flight = seconds Evidence for 3 significant figure accuracy: b. A target is 800m horizontally from the cannon’s mouth, and is 200m vertically higher. Copy your previous program to
q1b.m
and add to it to calculate the closest approach of the steel ball from the target. Find the two distinct angles that the cannon must be fired at to hit the target (a separation of ball and target of 1 metre or less can be regarded as a ‘hit’). [40%]
Question 2
a. Table Q2 contains experimentally determined spark advance angles for an engine at certain load values and engine speeds.
Table Q2 Assuming that the spark advance angle varies quadratically with RPM and quadratically with load, write down the polynomial terms that will be required to fit this data. [10%] Polynomial terms required: (you may substitute x=RPM and y=Load , if wished) b. Create either an annotated Matlab program q2b.m or an annotated Excel spreadsheet q2b.xlsx to determine the best coefficients to the required polynomial using the least squares approach. [50%] c. modify your program or spreadsheet to calculate the
2
R
value for your fit (and save it as q2c.m or q2c.xlsx as appropriate). [20%] d. Calculate the interpolated spark advance angles at a) 3700RPM and Load = 3.5 and b) 3000RPM and Load = 3. Compare your value for case b) with the value from the table and comment upon it. [20%] a) interpolated value at 3700RPM, Load=3.5 = degrees (3 sig figs) b) interpolated value at 3000RPM, Load=3 = degrees (3 sig figs) Comment on answer for b) :

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks