Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Numerical Methods in Biomed Eng: ECG Analysis & Oxygen Transport Model Homework, Study notes of Numerical Methods in Engineering

Instructions and questions for homework 1 in the numerical methods in biomedical engineering course. The homework covers various topics including loading data into matlab, plotting ecg recordings, calculating pi using leibniz's series, and modeling oxygen transport in muscle. Students are required to use functions such as load, size, plot, subplot, xlabel, ylabel, hold on, find, diff, mean, and others.

Typology: Study notes

2019/2020

Uploaded on 03/29/2020

jennaxo
jennaxo 🇺🇸

3 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
125:305 Numerical Methods in Biomedical Engineering
9/10/19 Homework 1 - Due in class on 9/17/19 - Late submissions will not be graded
You are free to discuss the questions with other students, but everyone must submit their own work The homework
assignments are not group projects
Question 1: [8 points]
The goal of this question is to refresh some of your Matlab skills. You will need to remember how to use variable names,
and how to index the rows and columns of vectors and arrays in Matlab. You will also need to use the functions:
load, size, plot, subplot, xlabel, ylabel, hold on, find, diff, mean.
Since 1975, MIT and the Beth Israel Deaconess medical center in Boston have developed a database of ECG recordings
from patients at the hospital. Researchers can access and use this data for their own projects, such as developing new
instrumentation for detection of arrhythmia, or developing new algorithms to analyze ECG signals.
There is a data file in the Canvas > Files > Homework folder (ECG_data_file.mat) which contains ECG measurements (in
millivolts, mV) from 4 patients at the Beth Israel Deaconess medical center. Copy this file into your Matlab current
folder.
a) Load this data into your Matlab workspace. You will have a variable named “ECG_data” which contains the data
points. What is the size of this variable (i.e. how many rows and columns are there)?
(Hint: use load(‘ECG_data_file.mat’));
b) Each ECG recording was made at 90 samples per second. (I.e. each individual data point was measured 1/90 sec
apart). Create a vector of time points matching the length of the ECG data. Plot this vector against the ECG
recording for the first patient only. (Check that the size of the vectors match in the Matlab Workspace). Don’t
forget to label the axes.
c) Use Matlab’s subplot function to create a figure containing the ECG recordings for all four patients, each in their
own separate axes. Use a different color for each recording.
d) Extract the ECG signal for the third patient from the “ECG_data” variable into a new variable and plot the signal
versus time in a new figure window. Use Matlab to plot red circles on top of each of the six peaks in this ECG signal.
(Hint: Look at the plot and determine a threshold voltage level that identifies the peaks. Then use Matlabs find
function to identify the time points where the peaks occur. Then use this information to add red circles to the plot).
e) Using the information you generated in (d), determine patient 3s heart rate (in beats per minute). (Hint: Use
Matlabs diff function).
pf3
pf4

Partial preview of the text

Download Numerical Methods in Biomed Eng: ECG Analysis & Oxygen Transport Model Homework and more Study notes Numerical Methods in Engineering in PDF only on Docsity!

125:305 Numerical Methods in Biomedical Engineering

9/10/19 Homework 1 - Due in class on 9/17/19 - Late submissions will not be graded

You are free to discuss the questions with other students, but everyone must submit their own work – The homework assignments are not group projects

Question 1: [ 8 points]

The goal of this question is to refresh some of your Matlab skills. You will need to remember how to use variable names, and how to index the rows and columns of vectors and arrays in Matlab. You will also need to use the functions: load, size, plot, subplot, xlabel, ylabel, hold on, find, diff, mean.

Since 1975, MIT and the Beth Israel Deaconess medical center in Boston have developed a database of ECG recordings from patients at the hospital. Researchers can access and use this data for their own projects, such as developing new instrumentation for detection of arrhythmia, or developing new algorithms to analyze ECG signals.

There is a data file in the Canvas > Files > Homework folder ( ECG_data_file.mat ) which contains ECG measurements (in millivolts, mV) from 4 patients at the Beth Israel Deaconess medical center. Copy this file into your Matlab current folder.

a) Load this data into your Matlab workspace. You will have a variable named “ECG_data” which contains the data points. What is the size of this variable (i.e. how many rows and columns are there)?

(Hint: use load(‘ECG_data_file.mat’));

b) Each ECG recording was made at 90 samples per second. (I.e. each individual data point was measured 1/90 sec apart). Create a vector of time points matching the length of the ECG data. Plot this vector against the ECG recording for the first patient only. (Check that the size of the vectors match in the Matlab Workspace). Don’t forget to label the axes.

c) Use Matlab’s subplot function to create a figure containing the ECG recordings for all four patients , each in their own separate axes. Use a different color for each recording.

d) Extract the ECG signal for the third patient from the “ECG_data” variable into a new variable and plot the signal versus time in a new figure window. Use Matlab to plot red circles on top of each of the six peaks in this ECG signal. (Hint: Look at the plot and determine a threshold voltage level that identifies the peaks. Then use Matlab’s find function to identify the time points where the peaks occur. Then use this information to add red circles to the plot).

e) Using the information you generated in (d), determine patient 3’s heart rate (in beats per minute). (Hint: Use Matlab’s diff function).

Question 2 : [ 8 points]

Around the year 1676, the mathematician Gottfried Leibniz published an infinite series expansion for pi:

𝜋 = 4 (1 −

a) Write a Matlab script to calculate pi using Leibniz’s series, adding terms until the approximate relative error is below 1% (0.01). How many terms are required and what is the estimated value for pi when this error level is reached?

b) Generate a plot showing the estimated values for pi generated by Leibniz’s series, as a function of the number of terms used. Include in your plot a horizontal line showing the true value of pi.

c) Generate a plot of the approximate relative error as a function of the number of terms used. Include in your plot a horizontal line showing the stopping error (1%).

d) How long does it take for your script to run?

Question 3 : [9 points]

In the Transport Phenomena class, you will learn about models for transport in biological tissues. A simple model for oxygen transport in muscle considers a region of tissue of length L in between two capillaries which carry arterial (oxgyenated) blood at a concentration N 0. Oxygen carried by the red blood cells diffuses through the capillary walls and into the muscle, where it is consumed at a rate given by  [M/s].

Analysis of this model using mass balance principles leads to a differential equation for the concentration of oxygen as a function of position and time within the muscle, N ( x , t ). The first term on the right hand side represents the increase in oxygen concentration in the muscle due to diffusion from the capillaries, while the second term represents loss of O 2 due to consumption:

2

2

x

D N

t

N

Under steady-state conditions (where the two terms on the right hand side perfectly balance each other out, we can set  N / t = 0 and solve the resulting equation for N ( x ). But if we want to model the time-dependent situation where the

Question 4: [ 5 points]

The forces acting on an extended arm whilst holding a dumbbell are shown in the diagram below. Point O represents the axis of rotation of the shoulder joint, a is the distance from O to where the deltoid muscle is attached to the humerus, b is the distance to the center of gravity of the arm, c is the distance to the center of gravity of the dumbbell

with weight Wd. Fm is the force on the deltoid muscle, which makes an angle  with the horizontal. Fj is the reaction

force and  its angle at the shoulder joint. Fa is the force due to the weight of the arm.

a) Evaluate the horizontal, vertical, and rotational forces (moments) in the free body diagram and set up a matrix

equation that describes this system in the steady state. ( Fx = 0,  Fy = 0,  = 0, and remember that torque,  =

force x distance). (You can submit this part hand-written on paper or as commented lines within Matlab).

b) Write a Matlab script to find Fm , Fj , and Fa when a = 0.15 m, b = 0.30 m, c = 0.60 m,  = 15,  = 10, and the

dumbbell has a weight of Wd = 60 N. (Remember to enter angles in radians , i.e. 2 = 360).

c) Generate a plot of the force acting on the deltoid muscle ( Fm ) as the dumbell weight ( Wd ) ranges from 50 to 70 N (i.e. 5.1 kg to 7.1 kg).