Solving Matrix Equation in Simulink
Ältere Kommentare anzeigen
Hi everyone, I have the following matrix euation:
Pdot=beta*P-P*(Phi*Phi'-error*H)*P
which P is a matrix with 4*4 size. I want to solve this equation in simulink.I use matlab embeded block.In every step,this equation should be solved and P is updated. what code i should write?
1 Kommentar
Azzi Abdelmalek
am 13 Jan. 2014
Where P is updated?
Antworten (1)
Mischa Kim
am 13 Jan. 2014
The basic structure looks like this:

In the embedded function you compute Pdot which is inputted into an integrator that computes P. Don't forget to set initial conditions for P by opening the integrator. Assuming that all the other variables are constants the embedded function might look something like:
function Pdot = fcn(P)
beta = ...
Phi = ...
Phip = ...
error = ...
H = ...
Pdot = beta*P - P*(Phi*Phip - error*H)*P;
6 Kommentare
Sarah Miller
am 1 Feb. 2014
Mischa Kim
am 1 Feb. 2014
Hard to say. Can you attach the model (see paper clip)?
What happens when you change integrator settings (in > Simulation > Model Configuration Parameters)? Decrease RelTol and AbsTol to say 1e-10 .
Sarah Miller
am 2 Feb. 2014
Mischa Kim
am 2 Feb. 2014
When you have a comment text box open, the paper clip is right on top of the window on the right, next to the Help button.
Sarah Miller
am 2 Feb. 2014
Sarah Miller
am 2 Feb. 2014
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!