Reputation: 33
I am using Matlab to compute the following integral:
I want to know what is the best method to do this integral(trapez ...ect), and how to write it down.
this formula is called . The Integral of Time multiply Absolute Error (ITAE).
where epsilon is the error vector, and t is a vector that has been generated as follow
t = 0 : 0.0001 : 10
here both epsilon and t have the same size.
Upvotes: 1
Views: 379
Reputation: 32084
Example using trapz:
t = 0 : 0.0001 : 10;
epsilon = sin(t*3 - pi/6).*exp(-0.2*t); %Example for epsilon
ITAE = trapz(t, t.*abs(epsilon))
Result:
ITAE =
9.4006
Upvotes: 1
Reputation: 36
Have you tried t*epsilon'? Where the " x' " means transposition of x. Then just try to add elements in matrix like sum(resultMatrix).
Upvotes: 0