0% found this document useful (0 votes)
3 views

Assignment 1 Questions

Numerical methods for analysis

Uploaded by

danielnavratil00
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment 1 Questions

Numerical methods for analysis

Uploaded by

danielnavratil00
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

APSC 256 Numerical Methods for Analysis – Assignment 1

Submit your work in Canvas as a single PDF file, 1 mark in total


The following assignment requires that you have installed MATLAB on your personal computer. MATLAB is freely
available to UBC students, and you can install it by following the instructions in this link:
https://ubc.service-now.com/kb_view_customer.do?sysparm_article=KB0015540.

1. (0.4 marks) The following equation can be used to compute values of the variable y as a function of the
variable x:
y = be−ax sin(bx)(0.012x4 − 0.15x3 + 0.075x2 + 2.5x),
where a and b are parameters. Use the following steps to define and plot this function.
Step 1: Get familiar with the command window.
Step 2: Define the scalars a = 3 and b = 4.
Step 3: Define the vector x with values from 0 to /2 in increments of x = /40.
Step 4: Use the above equation to define the vector y in MATLAB using element-by-element multiplication.
Step 5. Compute the vector z = y2 where each element of z holds the square of each element of y.
Step 6: Generate a labeled plot of y and z versus x.
Step 7: Include on the plot a y-axis label, x-axis label, and legend (using help as needed to see how to do this).
In your submission, show your MATLAB script and an image of the generated plot.

2. (0.6 marks) You are a crime scene investigator. You have a homicide victim that was discovered with a body
temperature of 31°C. You wish to find the time that went by between the homicide and the body's discovery, and
you will do so using Newton's law of cooling. According to this law the temperature T(t) as a function of time t
follows
dT (t)
= −k(T − Ta ) ,
dt
where k = 0.12 (hour)–1 is a proportionality constant, as quantified here for a body, Ta = 10°C is the constant
ambient temperature of that room, and the victim's body temperature at the time of death was 37°C.
Find a numerical solution of the above equation using Euler’s method seen in Bungee Jumper Problem in Lecture
1 PPT or Section 1.1 of Module 1.0 PDF notes or Section 1.1 in your textbook. Use a time step of t = 0.5 hours
and plot in MATLAB (with labelled axes) the body's temperature T(t) as a function of time t. Then, use this plot to
estimate the time that went by between the homicide and the body's discovery. Follow the analytical procedures
and MATLAB scripts of the examples in Section 1.1 of Module 1.0 to help with this.
In your submission, show your algebraic work, your MATLAB script, and an image of the generated plot.

You might also like