How to evaluate definite integral inside simulink while running the simulation?
1 view (last 30 days)
I have a simulink dynamical model wherein one of the ODEs involve evaluating a definite integral from time period t to t+T. Where t is the system time and T is 0.1 seconds. The dynamical system and the definite integral is given as follows:MathWorks
with respect to eqn 54, gamma is a constant, t is the system time, T is 0.1 seconds, X is states in my simulink model, Q is a constant positive definite matrix, u is a constant, lambda is a constant, R is a positive definite matrix. The second term in eqn 54 (W1*delphi(X(t))) is outside the integral and hence not so important.
and my dynamical system that I am dealing with in simulink is: w_dot=-alpha*(phi/k)*e_b; where alpha,phi are known and e_b is the definite integral that must be evaluated as shown in the picture above.
My main concern is how to evaluate the integral at every time step and feed it to the dynamical system-w_dot=-alpha*(phi/k)*e_b;