%--------------------------------------------------------%
% Trajectory of 2D plate based on Holmes's model
%--------------------------------------------------------%
close all
clear
clc
% properties of plate
m=0.196; % mass
A=0.133; % area
l=sqrt(A); % chord/span
I=0.001; % inertia moment
% properites of air
rou=1.225; % density of air
% time step
T=10; % Total time
dt=0.01; % time step
nt=T/dt; % number of time steps
t=(0:dt:T-dt);
% constant
g=9.81;
% initialization
ax=zeros(nt,1); % horizontal acceleration
ay=zeros(nt,1); % vertical acceleration
aw=zeros(nt,1); % angular acceleration
u=zeros(nt,1); % horizontal velocity
v=zeros(nt,1); % vertical velocity
w=zeros(nt,1); % angular velocity
V=zeros(nt,1); % total velocity
x=zeros(nt,1); % horizontal displacement
y=zeros(nt,1); % veritical displancement
theta=zeros(nt,1); % the angle of the plate to the horizontal, rad
% initial condition
U=35; % wind speed or relative horizontal velocity
v(1)=0;
theta(1)=deg2rad(0.0);
y(1)=75;
% calculation
for i=1:nt-1
V(i)=sqrt((U-u(i))^2+v(i)^2); % square of total velocity
beta=atan(-v(i)/abs(U-u(i))); % rad
alpha=rad2deg(theta(i)+beta); % angle of attack, deg, [0,180]
alpha=mod(alpha,180);
ax(i)=sign(U-u(i))*0.5*rou*(Cd(alpha)*cos(beta)-(Cl(alpha)+C_Lr(w(i),U,l))*sin(beta))*A*V(i)^2/m;
ay(i)=0.5*rou*(Cd(alpha)*sin(beta)+(Cl(alpha)+C_Lr(w(i),U,l))*cos(beta))*A*V(i)^2/m-g;
aw(i)=0.5*rou*Cm(alpha)*A*l*V(i)^2/I;
u(i+1)=u(i)+ax(i)*dt;
v(i+1)=v(i)+ay(i)*dt;
w(i+1)=w(i)+aw(i)*dt;
x(i+1)=x(i)+(U-u(i))*dt;
y(i+1)=y(i)+v(i)*dt;
theta(i+1)=theta(i)+w(i)*dt; % rad
if (y(i+1)<=0)
disp('plate dropped onto the ground');
iEnd=i;
break
end
end
% plot
figure
plot(x,y,'.')
grid on
title('x-y')
figure
plot(t,x,'.')
grid on
title('t-x')
figure
plot(t,y,'.')
grid on
title('t-y')
figure;
plot(t,theta,'.')
grid on
title('t-theta')
figure;
plot(t,V,'.')
grid on
title('t-V')
Matlab平板(2D)空中运动轨迹模拟代码
需积分: 50 42 浏览量
2018-01-25
23:00:41
上传
评论 2
收藏 3KB RAR 举报
dg8844
- 粉丝: 2
- 资源: 7
最新资源
- Java SE Development Kit 11.0.23 macOS ARM64 DMG Installer
- python matplotlib 可视化编程.zip
- NumPy Matplotlib Matplotlib 是 Python 的绘图库 .zip
- Matplotlib主要的作用,是用来生成绘图,饼图,功率谱,条形图,错误图,散点图等.zip
- Java SE Development Kit 8u411 macOS x64 DMG Installer
- matplotlib 绘图库的cpp版本,负责图形的绘画与数据化.zip
- 1.使用xlrd扩展包读取Excel数据 2.使用Matplotlib绘制二维图像.zip
- a20bc49b4d1bfd71a60bfbde7c5fbe00a5ef385dc2087ffa3457e5cbf9d96897.png
- 基于STM32单片机的智能停车场设计源码+全部资料(优质毕业设计).zip
- 网上购物商城的设计与实现(部署视频)-kaic.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈