当前位置:网站首页>飞行器翼尖加速度和控制面的MPC控制
飞行器翼尖加速度和控制面的MPC控制
2022-06-27 06:09:00 【studyer_domi】
1、内容简介
略
372-可以交流、咨询、答疑
2、内容说明
clc
close all
clear
% Open file
path = pwd;
pathFull = strcat(path,'\系统状态空间');
addpath(pathFull);
fid = fopen('180.DAT');
disp(['Read file ' '180.DAT'])
% Read and display the header
head=fgetl(fid); disp(head)
V=str2num(head(36:46)); ro=str2num(head(56:66));
% Read dimensions
tmp=fgetl(fid); tmp=sscanf(tmp,'%i');
if length(tmp)==1
n=tmp(1); m=0; l=0;
elseif length(tmp)==3
n=tmp(1); m=tmp(2); l=tmp(3);
else
disp(['FATAL ERROR: File ' filename ' corupt.']); return
end
% Read state-space matrices
ABCD = zeros(n+l,n+m);
ABCD = fscanf(fid,'%g',[n+l,n+m]);
A=ABCD(1:n,1:n);
B=ABCD(1:n,n+1:n+m);
C=ABCD(n+1:n+l,1:n);
D=ABCD(n+1:n+l,n+1:n+m);
% Read gain matrix
if head(74:80)=='VEHICLE'
fgetl(fid);line = fgetl(fid);
G = fscanf(fid,'%g',[m,l]);
else
G = [];
end
% Read gust state-space matrices
%
fgetl(fid);line = fgetl(fid);
if ~isstr(line)
Bw=[]; CG=[]; return
else
nG2= fscanf(fid,'%g',1);
Bw = fscanf(fid,'%g',[n,nG2]);
end
fgetl(fid);line = fgetl(fid);
if ~isstr(line), CG=[]; return,
else CG = fscanf(fid,'%g',[l,nG2]);
end
% %% 建立MPC模型
% sys = ss(A,B,C,D);
% Ts=0.05; % 采样时间
% p=15; % 预测时域长度
% m=2; % 控制时域长度
% MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% % 设置限制,F的大小不能为0,F斜率绝对值最大1000
% MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e2,'RateMax',1e2);
% MPC1.OV=struct('Min',-1000,'Max',1000);
% MPC1.OV.MaxECR=1;
%% 建立MPC模型
close all
clc
% sys = ss(A,B,C,D);
% Ts=0.05; % 采样时间
% p=15; % 预测时域长度
% m=5; % 控制时域长度
% MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% % 设置限制,F的大小不能为0,F斜率绝对值最大1000
% MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e1,'RateMax',1e1);
% MPC1.OV=struct('Min',-1000,'Max',1000);
% MPC1.OV.MaxECR=1;
sys = ss(A,B,C,D);
Ts=0.05; % 采样时间
p=15; % 预测时域长度
m=5; % 控制时域长度
MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% 设置限制,F的大小不能为0,F斜率绝对值最大1000
MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e1,'RateMax',1e1);
MPC1.OV=struct('Min',-10,'Max',10);
MPC1.OV.MaxECR=1;
in = 10;
sim('model_mpc1.slx')
figure
plot(tout,yout(:,1))
xlabel 时间/s
ylabel 翼尖加速度传感器
figure
plot(tout,yout(:,2),tout,yout(:,3))
xlabel 时间/s
ylabel 控制面的偏角
3、仿真分析

4、参考论文
略
边栏推荐
- js实现双向数据绑定
- Multithreading basic part part 1
- IAR systems fully supports Centrino technology 9 series chips
- 函数式 连续式
- TiDB的使用限制
- expect脚本中使用scp命令的方法,expect脚本中scp命令获取不了值的问题完美解决方法
- Code is data
- LeetCode 0086. Separate linked list
- Convolution neural network -- Application of CNN model (ore prospecting prediction)
- TiDB 数据库快速上手指南
猜你喜欢

JVM garbage collection mechanism

创建一个基础WDM驱动,并使用MFC调用驱动

The risk of multithreading -- thread safety

yaml文件加密
软件测试年终总结报告模板

Altium designer 19 device silk screen label position shall be placed uniformly in batches

Yaml file encryption

Multithreading basic part part 1

JVM整体结构解析

Thinking technology: how to solve the dilemma in work and life?
随机推荐
How win 10 opens the environment variables window
Dev++ environment setting C language keyword display color
Distribution gaussienne, régression linéaire, régression logistique
Go日志-Uber开源库zap使用
693. 交替位二进制数
多线程基础部分Part3
爬虫学习5---反反爬之识别图片验证码(ddddocr和pytesseract实测效果)
Inter thread wait and wake-up mechanism, singleton mode, blocking queue, timer
MATLAB快速将影像的二维坐标转换为经纬度坐标
[collection] Introduction to basic knowledge of point cloud and functions of point cloud catalyst software
Add widget on qlistwidgetitem
多线程基础部分Part2
yaml文件加密
写一个 goroutine 实例, 同时练习一下 chan
【Cocos Creator 3.5.1】input.on的使用
项目-h5列表跳转详情,实现后退不刷新,修改数据则刷新的功能(记录滚动条)
The restart status of the openstack instance will change to the error handling method. The openstack built by the container restarts the compute service method of the computing node and prompts the gi
427- binary tree (617. merge binary tree, 700. search in binary search tree, 98. verify binary search tree, 530. minimum absolute difference of binary search tree)
使用 WordPress快速个人建站指南
WebRTC系列-網絡傳輸之7-ICE補充之提名(nomination)與ICE_Model