Question: Please use the code to do the graph on MATLAB constant functionm drug absorption.mx % This file is function file, to define ODE equations and
constant functionm drug absorption.mx % This file is function file, to define ODE equations and initial condition function dx-constant-function(, x) % t is time, x: concentration dx-zeros (3,1) 8 dx is a vector, it has one colume, three rows, since we have 3 ODE equations, we need three rows need ODE equations, k0-0.01: drug absorption coefficient k1-0.035; % drug elimination rate coefficient AO-1; % Initial drug concentration dx ( 1 ) =-k0 * x(1); % from equation : da/dt=-kd'A dx(2)-ko-x(1)-k1% (2); % from equation: dB/dt-ko-A-kl*S -dx (3)-k11x(2); % from equation: dE/dt eklg "constant-functionm dug-absorption.m xF1 clear all close al1 Sode45 is a versatile ODE solver and is the first solver you should try for most probloms t,yl-ode 45 (odefun, tapan,yo), where tapan-tto te integrates the system of differential equations yof(t,y) Eom t0 to tE with initial conditionsy Each rou in the solution azray y oorreaponds to a value returned in oolumn veotor t. [t,x]-ode45 (econatant function, [0,1001.1,0.01) plot (t,x,1)b' -hold on -plot (t,x,2). -xlabel ('time' plot (t,x(:,3),'g'); ylabel ('Concentration') title('Drug Absorption' legend('Amount of drug (A)"Amount of drug in the body (B) 'Amout of drug metabolized (E)')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
