logo

Correcting Heart Rate Errors

This document presents a proposal for a project to be carried on in pursuant of a Bachelor’s Degree in the field of Mechanical Engineering.

4 Pages1527 Words378 Views
   

Added on  2023-04-21

About This Document

This document provides a solution for correcting errors that occur when reading the heart rates of patients in hospitals. It discusses the harmonic equation for correcting heart parameters and simulates the equipment system. It also covers methods for adjusting errors in patients' heart rates and correcting false pulse readings. The document includes code snippets and plots to illustrate the concepts.

Correcting Heart Rate Errors

This document presents a proposal for a project to be carried on in pursuant of a Bachelor’s Degree in the field of Mechanical Engineering.

   Added on 2023-04-21

ShareRelated Documents
%% this was developed to correct the errors that occur when reading the heart
rates
... of poeple in hospitals when they make moves when the measurements are
taking place in the hospital
clear all;close all;clc
%% harmonic equation for correctin heart parameters
m1=10000; % the mass of the heart of patient in grams
F=0.0001; % Initial value of force from the movemen
k=72; % the number of heart beats of a normal health person
c=3965; % the constant of the harmonic equation
%% Simulation
% sampling time interval
Ts=0.05;
% time vector
t=(0:2499)*Ts;
% number of iteration
N=2500;
%expect feed voltage in the heart measuring system
u=[ones(1,50),-ones(1,50)];
u=repmat(u,1,N/100);
% the storage matrix for the vector
u(1:10)=zeros(1,10);
% signal from system integrity test
CBIT2_outputvalue=0.003*randn(1,N);
% THE general solution for the simple harmonic equation
gensol=[25*ones(1,500),25+50*sin(2*pi*0.01*(t(501:1500)-
t(500))).^2,25+10*sin(2*pi*0.01*(t(1501:end)-t(1500))).^2];
% equipment parameters:
b1=Ts/m1/F; % time invariant parameter b1
R2=k*exp(c*(1./(gensol+273)-1/289)); % time-varying resistance R2
a1=-1+Ts*(m1+R2)./m1./R2/F; % time-varying parameter a1
% initalise output voltage for the equipment
y=zeros(1,N);
% simulation of equipment system when there is no movements from the
% patient without errors
for k=2:N
y(k)=-a1(k)*y(k-1)+b1*u(k-1)+CBIT2_outputvalue(k);
end
%% Plot data of the system machine with no errors
figure;
plot(1:N,u,'LineWidth',2,'Color','blue');hold on;
plot(1:N,y,'LineWidth',2,'Color','red');
title('heart beats with no errors')
xlabel('Time')
ylabel('Voltage [V]')
legend('input','output')
Correcting Heart Rate Errors_1
%%
figure;
subplot(211)
plot(1:N,gensol,'LineWidth',2,'Color','blue');
title('the machine response without errors ')
ylabel('V');
xlabel('Time');
subplot(212)
plot(1:N,a1,'LineWidth',2,'Color','blue');
title('error monitoring using equipment')
xlabel('Time')
ylabel('volt')
figure;
plot(a1,gensol,'.r');
title('system error monitoring time');
xlabel('time');
ylabel('the structure covered');
grid on;
%% adjusting the errors in the patients hear rate
disp('the adjumnets for errors when the patient moves')
% (CONTINOUES BUILT IN TEST)
% storage vector for poossible errors
theta_test=zeros(2,N);
act_time=eye(2)*10e7;
% loop for establishing heart rate errors dur tp movements
for k=5:N
% test vector for the errors ddue to the either movement or emotional
emotional_resp=[-y(k-1) u(k-1)]'; % possible emotional reponse due to fear
or excite
% calculating errors in reading
error_emotional=act_time*emotional_resp*(1+emotional_resp'*act_time*emotional_
resp)^(-1);
theta_test(:,k)=theta_test(:,k-1)+error_emotional*(y(k)-
emotional_resp'*theta_test(:,k-1));
act_time=act_time-error_emotional*emotional_resp'*act_time;
d=randn(4,2500);
error=d;
end
% estimating the output deviations from the normal heart rate
CBIT1_outputvalue = mean(abs(theta_test(1,:)'-a1'));
CBIT2_outputvalue = mean(abs(theta_test(2,:)'-b1'));
% outputing the error and the margine of the error in the window
disp('error message ')
disp(['HEART RATE ERROR',num2str(CBIT1_outputvalue),', DUE TO PATIENTS
MOVEMENT ',num2str(CBIT2_outputvalue)])
disp('---------------------------------------------------------------')
figure;
plot(1:N,gensol,'LineWidth',2,'Color','blue');
title('THE HEART RATE WITH ERRORS');
xlabel('duration');
Correcting Heart Rate Errors_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Simulation of a Harmonic Equation with Built-in Tests
|9
|1284
|84