【GP-OLS】线性参数动态输入输出系统的模型结构识别(Matlab代码实现)

 👨‍🎓个人主页:研学社的博客   

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

2.1 算例1

2.2 算例2 

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

遗传编程(GP)从输入输出测量数据生成动态系统的非线性输入输出模型。该GP-OLS工具箱应用正交最小二乘算法(OLS)来提高GP的搜索效率。
它可用于静态方程发现或简单动态线性参数模型(即NARX模型,多项式模型等)的结构识别。

📚2 运行结果

2.1 算例1

2.2 算例2 

部分代码:

% Simple example for GP-OLS
%  Dynamical input-output model identification
% (Append the GpOls directory to the path)
%

clear all

%Simulation of a dynamic system and generates input/output data
t = [0:0.2:20]';
u = sin(t/2)-0.5;
u = u + randn(size(u))*0.1;
y = zeros(size(u));
y(1) = 0;
y(2) = 0;
for k = 3:length(t),
  dy = 0.7*u(k-1)*u(k-1) - 0.6*y(k-1) - 0.3*y(k-2) - 0.1;
  y(k) = y(k-1) + dy;
end
%Adds some simulated 'measurement noise' to the output
y = y + randn(size(y))*0.02;

%Select the maximum input and output order for identification
uorder = 2;
yorder = 2;

%Regressors and outputs for identification
tofs = max(uorder,yorder)+1;
Y = y(tofs:end) - y(tofs-1:end-1); %dy
X = [];
for  i=1:yorder,
  X = [X, y(tofs-i:end-i)];
end
for  i=1:uorder,
  X = [X, u(tofs-i:end-i)];
end

%GP equation symbols
symbols{1} = {'+','*'};
for i = 1:yorder,
  symbols{2}{i} = sprintf('y(k-%i)',i);
end
for j = 1:uorder,
  symbols{2}{i+j} = sprintf('u(k-%i)',j);
end

%Initial population
popusize = 40;
maxtreedepth = 5;
popu = gpols_init(popusize,maxtreedepth,symbols);

%first evaluation
opt = [0.8 0.7 0.3 2 2 0.2 25 0.01 1 0];
popu = gpols_evaluate(popu,[1:popusize],X,Y,[],opt(6:9));
%info
disp(gpols_result([],0));
disp(gpols_result(popu,1));
%GP loops
for c = 2:20,
  %iterate 
  popu = gpols_mainloop(popu,X,Y,[],opt);
  %info  
  disp(gpols_result(popu,1));
end

%Result
[s,tree] = gpols_result(popu,2);
disp(s);

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]聂黎雯.变系数模型的稳健变量选择与结构识别[J].兰州文理学院学报(自然科学版),2022,36(04):15-19.DOI:10.13804/j.cnki.2095-6991.2022.04.001.

[2]János Madár (2023). GP-OLS model structure identification

🌈4 Matlab代码实现

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值