MATLAB Answers

how to find integral

2 views (last 30 days)
bhanu kiran vandrangi
bhanu kiran vandrangi on 3 Aug 2021
Answered: Walter Roberson on 4 Aug 2021
74513/(10000*sign(0.99966444607707671821117401123047*e + 15567.00356006622314453125*d*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 99966.4446048736572265625*e*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 143208.73040008544921875*d*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 919819.01861572265625*e*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 6144.93734991550445556640625*d*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 79516.50818634033203125*e*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 1)*(0.99966444607707671821117401123047*e + 15567.00356006622314453125*d*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 99966.4446048736572265625*e*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 143208.73040008544921875*d*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 919819.01861572265625*e*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 6144.93734991550445556640625*d*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 79516.50818634033203125*e*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 1))
my equation looks big but it is in fractional form , how to integrate (from 0 to 2000)this w.r.t 't' alone and by keeping 'd' and 'e' as constant
  2 Comments
bhanu kiran vandrangi
bhanu kiran vandrangi on 4 Aug 2021
d and e are variables which vary from [0,1] , i need the equation that comes after integration as a function of d,e so that i can optimize the equation to find the suitable values of d,e in that range[0.1]

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 4 Aug 2021
First let us enter the equation in without losing precision
S = '74513/(10000*sign(0.99966444607707671821117401123047*e + 15567.00356006622314453125*d*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 99966.4446048736572265625*e*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 143208.73040008544921875*d*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 919819.01861572265625*e*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 6144.93734991550445556640625*d*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 79516.50818634033203125*e*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 1)*(0.99966444607707671821117401123047*e + 15567.00356006622314453125*d*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 99966.4446048736572265625*e*(0.000000006195369979837203611161555727449*exp(-0.031830333683444479966526650949188*t) + 0.000010273947474104261345928534865379*exp(-9.113261252370440103050611146962*t) - 0.00000028014284413763190784152357082348*exp(-0.21190841394611541708927664531825*t)) - 143208.73040008544921875*d*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 919819.01861572265625*e*(0.00000019463729288710096554382289468776*exp(-0.031830333683444479966526650949188*t) + 0.0000011273623338192706455629377160221*exp(-9.113261252370440103050611146962*t) - 0.0000013219996267133105050106678390875*exp(-0.21190841394611541708927664531825*t)) + 6144.93734991550445556640625*d*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 79516.50818634033203125*e*(0.0000061148367096475197968175052665174*exp(-0.031830333683444479966526650949188*t) + 0.0000001237056968493577269185834666132*exp(-9.113261252370440103050611146962*t) - 0.0000062385424065558581219193001743406*exp(-0.21190841394611541708927664531825*t)) - 1))';
SS = str2sym(S)
SS = 
Now let us get an idea of how the equation looks over a range of d, e, t values, to see if integration is likely to work
syms d e t
N = 40;
tvec = linspace(0,2000,N);
[D, E, T] = meshgrid(linspace(0,1,N),linspace(0,1,N),tvec);
Is = double(subs(SS,{d,e,t},{D,E,T}));
minis = min(Is(:)); maxis = max(Is(:));
[minis, maxis]
ans = 1×2
1.0e+04 * 0.0007 2.2206
levels = linspace(minis, maxis, 5);
for K = 1 : length(levels)
isosurface(D, E, T, Is, levels(K));
end
xlabel('d'); ylabel('e'); zlabel('t');
legend(string(levels));
colorbar()
Unfortunately at this angle, the yellow is hidden, but we know it exists somewhere.
That back wall... let's get an idea of what the function looks like there
T1 = linspace(0,2000,5000);
I11 = double(subs(SS, {d,e,t}, {1, 1, T1}));
plot(T1, I11)
Looks like it settles in near 22000 for each value, so the integral would be roughly 22000 * 1700 or so, on the order of 4e7
We can do a numeric integration over t, over a range of d and e values
IntI = trapz(tvec, Is, 3);
surf(D(:,:,1), E(:,:,1), IntI); xlabel('d'); ylabel('e'); zlabel('integral')
4E7 is pretty much what we estimated just a moment ago.
This tells us that to maximize the integral, we should concentrate on e near 1; it is not obvious at the moment whether d has much effect.
I would suggest redoing a plot using e = 1 (constant) and using a range of d and using a denser range of t values, and using trapz() to do numeric integration; this will give you better information about which range is worth looking more closely at.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!