>> syms x ttotal = 0;totalmax = 0;trest = 0;t2 = 0;ton = 0;h = 0;pulse = 1;totaltime = 1440;p = 5.119*exp(-0.08898*h)+ 13.47*exp(-0.0003734*h);while pulse <= 1440while total >= totalmaxfor trest=0:totaltimeton = (totaltime - trest)/pulse;for i=1:pulset2 = double(solve(5.119*exp(-0.08898*t)+ 13.47*exp(-0.0003734*t)-p,'t'));p = (5.119*exp(-0.08898*(t2+ton))+ 13.47*exp(-0.0003734*(t2+ton)) + 0.05262*trest);total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x)),x,t2,t2+ton);endif total >= totalmaxtotalmax = total;elsetrest = trest + 0,01;if trest == 20print trest;endendendpulse = pulse + 1;print pulse;endend
Hi everybody, I seem to be running into trouble where I do the integration, I haven't got a clue how to solve this error though as it seemed to work just fine when I used numerical data for ton and trest.
Please, release me from my misery 😀
Best Answer