classdef problem
% PROBLEM Extended H-infinity controller synthesis problem
% This file is part of sshinfcd.
% Copyright (c) 2022, Laurens Jacobs, MECO Research Team @ KU Leuven.
%
% sshinfcd is free software: you can redistribute it and/or modify it under
% the terms of the GNU Lesser General Public License as published by the
% Free Software Foundation, version 3.
%
% sshinfcd is distributed in the hope that it will be useful, but WITHOUT
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
% License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with sshinfcd. If not, see <https://www.gnu.org/licenses/>.
properties
% P - Generalized plant
% A state-space realization of the (unweighted) generalized plant.
P
% Wi - Input weighting filter
% A state-space realization of the input weighting filter.
Wi
% Wo - Output weighting filter
% A state-space realization of the output weighting filter.
Wo
% specs - Desired performance specifications
% Structure array indicating the performance channels and their relative weights.
specs
% region - Desired closed-loop D-stability specificions
% Structure array indicating the closed-loop pole region constraints.
region
% watchdog - A watchdog for monitoring
% The watchdog keeps track of all processes that happen on objects of this class.
watchdog
end
methods
%% Constructor, input checking, standard form
function obj = problem(watchdog, P, Wi, Wo, specs, region)
% PROBLEM Constructor
% construct the object
assert(isa(watchdog,'sshinfcd.watchdog.watchdog'), 'Invalid watchdog.');
obj.watchdog = watchdog;
obj.P = P;
obj.Wi = Wi;
obj.Wo = Wo;
obj.specs = specs;
obj.region = region;
% check the validity of the input
obj.checkInput();
% preprocess the object
obj = obj.standardfilters();
obj = obj.balreal();
obj.checkassumptions();
obj = obj.sortchannels();
end
function checkInput(obj)
% CHECKINPUT Checks the validity of the input arguments
% check member types
obj.watchdog.assertType(obj.watchdog, 'sshinfcd.watchdog.watchdog', 'Invalid watchdog type.');
obj.watchdog.assertType(obj.P, 'numlti', 'P is not a standard MATLAB representation of an LTI system.');
obj.watchdog.assertType(obj.Wi, 'numlti', 'Wi is not a standard MATLAB representation of an LTI system.');
obj.watchdog.assertType(obj.Wo, 'numlti', 'Wo is not a standard MATLAB representation of an LTI system.');
obj.watchdog.assertType(obj.specs, 'struct', 'specs is not a structure.');
obj.watchdog.assertType(obj.region, 'struct', 'region is not a structure.');
% check sample times
obj.watchdog.assertCond(obj.P.Ts==obj.Wi.Ts && obj.P.Ts==obj.Wo.Ts, 'Sampling times of Wi, Wo and P should be equal.');
% assert compatible sizes
obj.watchdog.assertCond(size(obj.P,1)>size(obj.Wo,2), 'At least one measured output is required.');
obj.watchdog.assertCond(size(obj.P,2)>size(obj.Wi,1), 'At least one control input is required.');
% check specifications
obj.watchdog.assertField(obj.specs, 'in', 'specs requires a field ''in''.');
obj.watchdog.assertField(obj.specs, 'out', 'specs requires a field ''out''.');
obj.watchdog.assertField(obj.specs, 'weight', 'specs requires a field ''weight''.');
cellfun(@(x) obj.watchdog.assertNonEmpty(x, 'A specification cannot have zero performance inputs.'), {obj.specs.in});
cellfun(@(x) obj.watchdog.assertType(x, 'double', 'specs.in can only contain numeric values.'), {obj.specs.in});
cellfun(@(x) obj.watchdog.assertCond(all(mod(x,1)==0) && all(x>0), 'specs.in can only contain integer values.'), {obj.specs.in});
cellfun(@(x) obj.watchdog.assertNonEmpty(x, 'A specification cannot have zero performance outputs.'), {obj.specs.out});
cellfun(@(x) obj.watchdog.assertType(x, 'double', 'specs.out can only contain numeric values.'), {obj.specs.out});
cellfun(@(x) obj.watchdog.assertCond(all(mod(x,1)==0) && all(x>0), 'specs.out can only contain integer values.'), {obj.specs.out});
cellfun(@(x) obj.watchdog.assertNonEmpty(x,'A specification requires a weight. Set to 0 to handle it as a normalized constraint.'), {obj.specs.weight});
cellfun(@(x) obj.watchdog.assertType(x, 'double', 'specs.weight can only contain numeric values.'), {obj.specs.weight});
cellfun(@(x) obj.watchdog.assertCond(all(x>=0) && isscalar(x), 'specs.weight can only positive scalars or 0.'), {obj.specs.weight});
obj.watchdog.assertField(obj.region, 'M', 'region requires a field ''M''.');
obj.watchdog.assertField(obj.region, 'L', 'region requires a field ''L''.');
cellfun(@(x) obj.watchdog.assertType(x, 'double', 'region.M can only contain numeric values.'), {obj.region.M});
cellfun(@(x) obj.watchdog.assertType(x, 'double', 'region.L can only contain numeric values.'), {obj.region.L});
cellfun(@(x) obj.watchdog.assertCond(isreal(x) && issymmetric(x), 'region.L can only contain real symmetric matrices.'), {obj.region.L});
cellfun(@(x) obj.watchdog.assertCond(isreal(x), 'region.M can only contain real matrices.'), {obj.region.M});
cellfun(@(x,y) obj.watchdog.assertCond(size(x,1)==size(y,1) && issymmetric(y), 'region.M and region.L must have the same number of rows. In addition, L must be symmetric.'), {obj.region.M}, {obj.region.L});
obj.watchdog.assertCond(max(vertcat(obj.specs.in))<=size(obj.Wi,2), 'A performance input exceeding the inputs of the input weighting filter was requested.');
obj.watchdog.assertCond(max(vertcat(obj.specs.out))<=size(obj.Wo,1), 'A performance output exceeding the outputs of the output weighting filter was requested.');
obj.watchdog.warnCond(all(ismember(1:size(obj.Wi,2),vertcat(obj.specs.in))),'Some performance inputs do not appear in the specifications. They will therefore be ignored.');
obj.watchdog.warnCond(all(ismember(1:size(obj.Wo,1),vertcat(obj.specs.out))),'Some performance outputs do not appear in the specifications. They will therefore be ignored.');
end
function obj = sortchannels(obj)
% SORTCHANNELS Sorts the specifications and its performance inputs and outputs
obj.Wi = obj.Wi(:,vertcat(obj.specs.in));
obj.Wo = obj.Wo(vertcat(obj.specs.out),:);
chi = 0; cho = 0;
for k=1:length(obj.specs)
obj.specs(k).in = (chi+1):(chi+length(obj.specs(k).in)); chi = chi+length(obj.specs(k).in);
obj.specs(k).out = (cho+1):(cho+length(obj.specs(k).out)); cho = cho+length(obj.specs(k).out);
end
end
function checkassumptions(obj)
% CHECKASSUMPTIONS Check the assumptions for the extended H-infinity control problem
% conditions on P
obj.watchdog.assertCond(sshinfcd.util.isdtcb(obj.P) && sshinfcd.util.isstbz(obj.P), 'P should be finite dynamics detectable and stabilizable.');
% conditions on Wi
obj.watchdog.assertCond(sshinfcd.util.isctrb(obj.Wi), 'Wi should be controllable.');
% conditions on Wo
obj.watchdog.asse
没有合适的资源?快使用搜索试试~ 我知道了~
LTI系统的状态空间H∞控制matlab设计.zip
共24个文件
m:22个
svg:1个
mat:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 123 浏览量
2024-03-11
20:45:47
上传
评论
收藏 160KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 5.作者介绍:某大厂资深算法工程师,从事Matlab算法仿真工作10年;擅长智能优化算法、神经网络预测、信号处理、元胞自动机等多种领域的算法仿真实验,更多仿真源码、数据集定制私信+。
资源推荐
资源详情
资源评论
收起资源包目录
LTI系统的状态空间H∞控制matlab设计.zip (24个子文件)
LTI系统的状态空间H∞控制matlab设计
examples
ccta2023
model.mat 109KB
with_lctoolbox.m 3KB
without_lctoolbox.m 4KB
+sshinfcd
@sshinfcd
setoptions.m 1017B
sshinfcd.m 3KB
solve.m 2KB
options.m 2KB
@problem
problem.m 26KB
+standard
+nlcov
nlcov.m 24KB
@postprocessor
postprocessor.m 4KB
@preprocessor
preprocessor.m 6KB
+watchdog
watchdog.m 6KB
printer.m 4KB
+util
isctrb.m 811B
link.m 977B
removehtml.m 841B
isdtcb.m 873B
isstbz.m 876B
isobsv.m 808B
stabsep.m 2KB
mergestruct.m 2KB
prob_illustration.svg 62KB
strucsylvester.m 1KB
bold.m 962B
共 24 条
- 1
资源评论
matlab科研助手
- 粉丝: 3w+
- 资源: 5985
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功