Why am i getting an Inf value when i am calculating definite integral in symbolic math toolbox?
Show older comments
I am calculating definite integral of a polynomial using syms command, using the following code: Lb=[-4 -4 -4 -4]; Ub=[4 4 4 4];d=4; n=4; for i=1:n; nx(i,:)=Lb+(Ub-Lb).*rand(1,d); end; syms s t; H= (s^3+7*s^2+24*s+24)/(s^5+10*s^4+35*s^3+50*s^2+24*s); h=(nx(1,1)*s+nx(1,2))/(s^3+nx(1,3)*s^2+nx(1,4)*s); Y=ilaplace(H,s,t); y=ilaplace(h,s,t); Ise=int((Y-y)^2,t,0,inf); ISE=double(Ise)
The problem is when i pick values from matrix nx and put them into h, then for every value of the nx matrix i get ISE=Inf, but when i manually put h, then it calculates ISE. For example, for the following code ISE is being calculated: syms s t; H= (s^3+7*s^2+24*s+24)/(s^5+10*s^4+35*s^3+50*s^2+24*s); h=(16*s+24)/(30*s^3+42*s^2+24*s); Y=ilaplace(H,s,t); y=ilaplace(h,s,t); Ise=int((Y-y)^2,t,0,inf); ISE=double(Ise) Can anyone please let me know where am i wrong and why am i getting Inf value for ISE when i take the coefficients of s in h from nx. Please help me as soon as possible. Thank you in advance.
Accepted Answer
More Answers (1)
Alberto
on 1 Oct 2014
0 votes
Your problem is that you are trying to integrate a function say F(y)=(Y-y)^2, but using t as integration variable. That means that F is constant while t variates form 0 to Inf. Matematically that value is infinite.
3 Comments
Preeti Prajapati
on 2 Oct 2014
Alberto
on 2 Oct 2014
I guess you should change:
Ise=int((Y-y)^2,t,0,inf)
for this one:
Ise=int((Y-y)^2,Y,0,inf)
that will be infinite too (its a math fact, the parabola has infinite area below). If you need a finite value, then you should also change the upper integration value for a finite one. For example:
Ise=int((Y-y)^2,Y,0,10)
Harshad Deshmane
on 2 Oct 2014
The only variables here are "s" (Laplace domain) and "t" (time domain). F = (Y - y)^2 is implicitly a function of "t" alone, since "Y" and "y" are functions of "t". So integrating with respect to "t" is in fact the right approach.
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!