%线性MPC的实用设计与应用
close all
%% System Identification of PV Cell
%% Simulate the model
sim('Chapter_8_Section_4_Model')
%% Create time vector
Time=0:1:length(Lambda_UV)-1;
%% Change plotting settings
set(0,'DefaultLineLineWidth',1)
set(0,'DefaultAxesFontWeight','bold')
set(0,'DefaultAxesFontName','Arial')
set(0,'DefaultAxesFontSize',12)
%% Grouping simulation data and neglecting first few seconds(Nstart*stp_sz)
Nstart =2000; %Clip the data starting from Nstart as the first few seconds of the simulation should be discarded
Measured_Outputs=[ Tm_f(Nstart:end)]; %Measured outputs
Manipipulated_Variables=[ Lambda_UV(Nstart:end) ];% Pout_previous ]; %Manipulated variables
%% Obtaining initial conditions at step time=Nstart
Measured_Outputs_Nstart=Measured_Outputs(1,:); %Capturing the measured outputs at step time= Nstart
Manipipulated_Variables_Nstart=Manipipulated_Variables(1,:); %Capturing the manipulated variables at step time= Nstart
%% Forcing response to start from zero initial conditions
Measured_Outputs_zero_initial_conditions=Measured_Outputs(1:end,:)-repmat(Measured_Outputs_Nstart,length(Measured_Outputs(1:end,:)),1); %Subtracting initial conditions for measured outputs to obtain zero response at step time= Nstart
Manipipulated_Variables_zero_initial_conditions=Manipipulated_Variables(1:end,:)-repmat(Manipipulated_Variables_Nstart,length(Manipipulated_Variables(1:end,:)),1); %Subtracting initial conditions for manipulated variables to obtain zero actuation at step time= Nstart
%% Prepare date for system identification
stp_sz=10
data=iddata(Measured_Outputs_zero_initial_conditions(1:stp_sz:end,:),Manipipulated_Variables_zero_initial_conditions(1:stp_sz:end,:),stp_sz); %data is packaged for system identification using iddata
%% Generate a preliminary 3rd order system that fits the data
sys1=n4sid(data,3,'Form','canonical','DisturbanceModel','None','InputDelay',[0 ]','InitialState','zero'); %n4sid generates a preliminary system in the canonical form
%% Generate a more refined system
sys2 = pem(data,sys1,'InitialState','zero') %pem generates a more refined system that fits the data better
%% Define the options for comparing the various identified systems
opt = compareOptions('InitialCondition','Z');
%% Plot the comparison between the simulation data and the identified system sys2
figure
compare(data,sys2,opt);
%% Extract A, B, C and D matrices from sys2
A=sys2.A
B=sys2.B
C=sys2.C
D=sys2.D
%% Use the ss command to represent the results from sys2 in a state space format
PV_Linear_Model = ss(A,B,C,D,stp_sz)
save Chapter_8_Section_4_Linear_Model.mat PV_Linear_Model
没有合适的资源?快使用搜索试试~ 我知道了~
基于Matlab和Simulink光伏板仿真(源码+数据).rar

共74个文件
mat:53个
l:5个
slx:5个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉

温馨提示
1、资源内容:基于Matlab和Simulink光伏板仿真(源码+数据).rar 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论




























收起资源包目录



























































































































共 74 条
- 1
资源评论

- windSDcry2024-06-24资源中能够借鉴的内容很多,值得学习的地方也很多,大家一起进步!
- weixin_590033392025-04-01感谢大佬分享的资源,对我启发很大,给了我新的灵感。
- qq_408962202024-06-05发现一个宝藏资源,赶紧冲冲冲!支持大佬~
- 2301_784827142024-06-07感谢资源主分享的资源解决了我当下的问题,非常有用的资源。

Matlab仿真实验室
- 粉丝: 4w+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 怎样听课评课jsp.ppt
- 嵌入式系统专业术语中英文对照.doc
- 调查报告网络游戏对中学生的影响.doc
- 软件需求规格说明书59956.pdf
- 信息化教学培训心得体会7篇.docx
- 计算机培训教师个人工作总结.doc
- 网络营销有哪些方法?.doc
- 嵌入式系统课程设计选题及任务书.docx
- 科技有限责任公司项目管理标准概述.doc
- 网络与信息安全事件应急预案.doc
- 网络营销基础培训.pptx
- 硬件系统安全和环境安全.pptx
- LabVIEW数据记录至Excel与TXT文件
- 网络课程设计方案.doc
- 《计算机网络》课件-冯博琴-程向前-编著-清华大学出版社-清华版.ppt
- Linux基本命令PPT.ppt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
