MATLAB_自动出钢曲线生成

34 篇文章 1 订阅

data.txt中预设某个时间点下的摇炉角度和钢包车位置;假设摇炉角度的初始角度-86度,钢包车位置初始位置66米。在data.txt中设定你想要的轨迹曲线。

在第4秒想让摇炉摇到-86.3度,钢包车驶到65.46米
在第8秒想让摇炉摇到-87.3度,钢包车驶到65.03米
在第13秒想让摇炉摇到-88.2度,钢包车驶到65.01米



在第301秒想让摇炉摇到-102.7度,钢包车驶到63.59米

参考《基于出钢时间和模型计算的转炉自动出钢功能研究_褚光宇》
请添加图片描述

clear;close all;clc

sdata=importdata('data.txt');
data=sdata.data;
x=data(:,1);
y1=data(:,2);
y2=data(:,3);
xmax = max(x);
xcnt = length(x);
Y1 = zeros(xmax,1);
Y2 = zeros(xmax,1);
for j=1:xmax
    for i=1:xcnt
        if x(i)==j
            Y1(j) = y1(i);
            Y2(j) = y2(i);
        end
    end
end
Y1(xmax) = Y1(xmax);
for j=xmax-1:-1:1
    if Y1(j)==0
        Y1(j) = Y1(j+1);
    else
        Y1(j) = Y1(j);
    end
end
Y2(xmax) = Y2(xmax);
for j=xmax-1:-1:1
    if Y2(j)==0
        Y2(j) = Y2(j+1);
    else
        Y2(j) = Y2(j);
    end
end
figure(1)
subplot(221)
plot(Y1)
xlabel('连续时间')
ylabel('摇炉角度')
title('填补处理')
subplot(222)
plot(Y2)
xlabel('连续时间')
ylabel('钢包车位置')
title('填补处理')
subplot(223)
plot(y1)
xlabel('离散时间')
ylabel('摇炉角度')
title('原始数据')
subplot(224)
plot(y2)
xlabel('离散时间')
ylabel('钢包车位置')
title('原始数据')
z = 0;
ZZZ = [];
YY1 = [];
YY2 = [];
while 1
	z=z+1;
    if z > xmax
        break;
    end
    formatSpec = '时间:%ds,摇炉角度:%.2f°,钢包车位置:%.2fm\n';
    resutstr = sprintf(formatSpec,z,Y1(z),Y2(z)) 
    ZZZ = [ZZZ,z];
    YY1 = [YY1,Y1(z)];
    YY2 = [YY2,Y2(z)];
    hold on;
    figure(2)
    subplot(121)
    plot(ZZZ,YY1)
    xlabel('连续时间')
    ylabel('摇炉角度')
    title(sprintf('时间: %ds ,摇炉角度: %.2f° ', z,Y1(z)));
    grid on;
    subplot(122)
    plot(ZZZ,YY2)
    xlabel('连续时间')
    ylabel('钢包车位置')
    title(sprintf('时间: %ds ,钢包车位置: %.2fm ', z,Y2(z)));
    grid on;
    pause(1);
end

请添加图片描述
代码、使用说明、演示视频:
https://download.csdn.net/download/weixin_37928884/86724958
siemens中的WinCC和Step7仿真项目:
https://download.csdn.net/download/weixin_37928884/86724951

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

杨铮...

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

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

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

打赏作者

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

抵扣说明:

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

余额充值