Numerically integrate a time dependent differential equation

2 Ansichten (letzte 30 Tage)
Alireza Mofidi
Alireza Mofidi am 1 Dez. 2022
Kommentiert: Torsten am 2 Dez. 2022
Hi - I need to numerically integrate this equation: dCDF/dt=1/tr where tr = t0 * exp(bP/Tc). t0, b, and P are constants and Tc is defined as: Tc= {Te^4+K * [307.59-190.96 (ln⁡〖t/24〗 )^0.24 ]}^(1/4) where Te, K are constants and t is changing between 1 to 300 days. The initial condition is CDF = 0 at t=ti. I want to integrate the dCDF/dt=1/tr in the forward time direction starting from t=ti until the CDF approach a finite value of 0.05. I appreciate your help.
  3 Kommentare
Alireza Mofidi
Alireza Mofidi am 1 Dez. 2022
In this empricial fit 307.59-190.96 〖(lnt)〗^0.24 which used in Tc equation the t is in days but in the final form equation for CDF the t is expressed in hours rather than days.
Torsten
Torsten am 1 Dez. 2022
Then my answer below should be correct.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Torsten
Torsten am 1 Dez. 2022
bP = 1;
Te = 1;
K = 1;
t0 = 1;
ti = 24;
CDF = @(x)integral(@(t) 1/t0*exp(-bP./(Te^4+K*(307.59-190.96*(log(t/24)).^0.24)).^0.25),ti,x)
CDF = function_handle with value:
@(x)integral(@(t)1/t0*exp(-bP./(Te^4+K*(307.59-190.96*(log(t/24)).^0.24)).^0.25),ti,x)
x = ti:ti:300*ti;
F = arrayfun(@(x)CDF(x),x)
F = 1×300
0 10.9214 21.4913 31.9095 42.2291 52.4761 62.6657 72.8082 82.9106 92.9783 103.0154 113.0253 123.0105 132.9732 142.9153 152.8384 162.7438 172.6327 182.5061 192.3650 202.2102 212.0423 221.8622 231.6703 241.4672 251.2534 261.0294 270.7955 280.5523 290.2999
plot(x,F)
  4 Kommentare
Torsten
Torsten am 2 Dez. 2022
@Alireza Mofidi comment moved here:
Yes, I understand. But what I'm looking for is to find out at which "t" the CDF will approach 0.05. I think my question was confusing.
Torsten
Torsten am 2 Dez. 2022
As you can see, with the parameters I used for bP ,Te, K and t0, CDF tends to infinity as time grows. Insert the "correct" empirical parameters, run the code again and check the CDF curve shown. If it does not behave as you expect, recheck your model.

Melden Sie sich an, um zu kommentieren.

Tags

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by