Question:
A drug is encapsulated in a polymerand then released slowly into the bloodstream of patients. 100๐œ‡๐‘” of a drug in a controlled release capsule is injected into a patient. The drug is released at a rate of 8e^(-0.1t^2) ๐œ‡๐‘”/โ„Ž , where t is hours after injection. Use Matlab toolbox to calculate what fraction of the drug remains in the capsule after 24 h?
I was thinking of using the ode45 solver to solve for the amount of drug remaining in the capsule when t = 24 as shown:
Function File:
function f=Assignment2Q3(D,t)
f=8*exp(-0.1*(t^2));
end
Command Window:
[D,t]=ode45('Assignment2Q3',[0:24],100);
However I have run into 2 problems.
Firstly, the solver does not seem to be working as intended, as I am getting values of D=100 (D is the variable im defining for the amount of drug left in the capsule) for every value from t=0 to t=24.
Next, I do not know how to code the 2nd part of the function that would return me the fraction of the drug in the capsule after 24h after obtaining the value for D when t=24.
A step by step method that details what is being done at each step would be appreciated, as I am very new to MATLAB. Thank you!

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

David Hill
David Hill 2022๋…„ 10์›” 20์ผ

0 ๊ฐœ ์ถ”์ฒœ

Isn't just an integration of the rate?
f=@(t)8*exp(-.1*t.^2);
FractionRemaing=(100-integral(f,0,24))/100
FractionRemaing = 0.7758

๋Œ“๊ธ€ ์ˆ˜: 1

Gavin Leong
Gavin Leong 2022๋…„ 10์›” 20์ผ
yep, that pretty much summarizes it. Thanks a lot for your help!

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ Ordinary Differential Equations์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์งˆ๋ฌธ:

2022๋…„ 10์›” 20์ผ

๋Œ“๊ธ€:

2022๋…„ 10์›” 20์ผ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by