Adaptive Model Predictive Controller

3 views (last 30 days)
Dafom
Dafom on 16 Nov 2024
Edited: Dafom on 16 Nov 2024
I am working on LFC using adaptive model predictive controller (AMPC). The code i generated for Update Model Plant is showing Mat.A does not match with AMPC A input in terms of dimension and matrix size. What should i do?
Below is the code of one of the "Update Model Plant" for area 1.
function [A, B, C, D, U, Y, X, DX] = area1_thermal_control(freq_dev, tie_line_dev, control_input)
% Inputs:
% freq_dev: Frequency deviation (scalar)
% tie_line_dev: Tie-line power deviation (scalar)
% control_input: Control signal (governor output)
% Outputs:
% A, B, C, D: 3D State-space matrices (for all prediction steps)
% U: Control input (scalar)
% Y: Output (frequency deviation, scalar)
% X: State vector [freq_dev; tie_line_dev]
% DX: Rate of change of state vector
% Define prediction horizon
P = 10; % Number of prediction steps
% Thermal power plant 3D state-space matrices
A_base = [-0.05, 0; 0, -2];
B_base = [1; 0];
C_base = [1, 0];
D_base = 0;
  2 Comments
John D'Errico
John D'Errico on 16 Nov 2024
What should you do? Since you show no code, you should write better code.
If you want better help, you need to provide some basis so someone can help you. Make it possible to get help, or the only possible answer is as I gave it above.
Dafom
Dafom on 16 Nov 2024
Edited: Dafom on 16 Nov 2024
Hi Sir John D'Errico.
Below is the code of one of the 'Update Model Plant' for Area 1. Kindly go through and see how you can help out.
function [A, B, C, D, U, Y, X, DX] = area1_thermal_control(freq_dev, tie_line_dev, control_input)
% Inputs:
% freq_dev: Frequency deviation (scalar)
% tie_line_dev: Tie-line power deviation (scalar)
% control_input: Control signal (governor output)
% Outputs:
% A, B, C, D: 3D State-space matrices (for all prediction steps)
% U: Control input (scalar)
% Y: Output (frequency deviation, scalar)
% X: State vector [freq_dev; tie_line_dev]
% DX: Rate of change of state vector
% Define prediction horizon
P = 10; % Number of prediction steps
% Thermal power plant 3D state-space matrices
A_base = [-0.05, 0; 0, -2];
B_base = [1; 0];
C_base = [1, 0];
D_base = 0;
% Replicate matrices across the third dimension

Sign in to comment.

Answers (0)

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!