{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

BME Cheat Sheet Test 1

# BME Cheat Sheet Test 1 - Q=D(C*t)=D(int(C(t)dt,t,a,b C*t is...

This preview shows pages 1–2. Sign up to view the full content.

Q=D/(C*t)=D/(int(C(t)dt,t,a,b)) /// C*t is area under curve; alternatively C=D/V where V=Q*T /// note Q is same as R Rectangular Approx: R(f;P) = h * SUM[f(x i ),1,n-1] /// Trap Approx: T(f;P) = h/2*(f(x 1 )+f(x n ))+h*SUM[f(x i ),2,n-1] /// Simpson: S(f;P) = h/3 * [f(x 1 ) + 4f(x 2 ) + 2f(x 3 ) + 4f(x4) + 2f(x 5 ) + …2(f(x n-2 ) + 4f(x n-1 ) + f(x n )] /// note n must be odd, if n is even do first or last step w/ trapezoidal rule Cubic Spline: for S1: [a,b] and S2: [b,c] /// S 1 (x)=…, S 1 (x)=…, S 2 (x)=…, S 2 (x)=…, S 1 (b)=S 2 (b), S 1 (b)=S 2 (b), S 1 (a)=0, S 2 (c)=0 Euler’s: x(t+h) = x(t) + h*f[x(t),t] RK2: k 1 =h*f[x(t),t] /// k 2 =h*f[x(t)+k 1 /2, t+h/2] /// x(t+h)=x(t)+k 2 Euler’s for n diff eqs: x i (t+h) = x i (t) + h*f i [x 1 (t),…,x n (t),t)] …where x i (0), i=1,…,n RK2 for n diffeq: k1 i = h*f[(x 1 (t),x 2 (t),…,x n (t),t] /// k2 i =h*f i [x 1 (t)+k1 1 /2,…x n (t) +k1 n /2,t+h/2) /// x i (t+h)=x i (t)+k2 i Matlab Approx’s: function calc_cardiac_output(filename) data = load(filename); % pull out time and dye vectors from data file t = data(:,1); dye = data(:,2); h = t(2)-t(1); % sampling interval % calculate area under curve R = h*sum( dye(1:end-1) ); % rectangular T = h*( (dye(1)+dye(end))/2 + sum(dye(2:end-1)) ); % trapezoidal S = h/3*( dye(1)+dye(end)+4*sum(dye(2:2:end-1))+2*sum(dye(3:2:end-2)) ); % simpson's Z = trapz(t,dye); % matlab built-in trapezoidal D = input('Enter amount of dye injected (mg): '); % area is in mg*s/L so D/area will give us L/s, multiply by 60 to get L/min Q_R = D/R*60; Q_T = D/T*60; Q_S = D/S*60; Q_Z = D/Z*60; % print results disp(sprintf('Area approximations (mg*s/L):\nRectangular = %3.3f\tTrapezoidal = %3.3f\tSimspon''s rule = %3.3f\ttrapz = %3.3f\n',R,T,S,Z)) disp(sprintf('Cardiac output estimates (L/min):\nRectangular = %1.4f\tTrapezoidal = %1.4f\tSimspon''s rule = %1.4f\t\ttrapz = %1.4f\n',Q_R,Q_T,Q_S,Q_Z)) % plot gh = figure; plot(t,dye,'ko') title(['Dye concentration (', filename, ')']) xlabel('Time (s)') ylabel('Concentration (mg/L)') axis([0 32 0 34]) % change font sizes for readable saved figures set(findall(gh,'Type','text'),'FontSize',14) set(findall(gh,'Type','axes'),'FontSize',14) % save figure for report print('-dmeta',[filename, '.emf']) Matlab Recirc function recirc_correction data = load('dyerecirc.dat');

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern