-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_Commensurate_PMSM.m
51 lines (44 loc) · 1.5 KB
/
data_Commensurate_PMSM.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%% Author : TAO ZHANG * [email protected] *
% Created Time : 2022-10-01 08:58
% Last Revised : TAO ZHANG ,2023-03-19
% Remark : forward problem: get data----Fractional-Order Commensurate PMSM system
% Model ref: Parameter Estimation of Fractional Chaotic Systems
% Based on Stepwise Integration and Response Sensitivity Analysis
clear;clc;close all;
addpath('./SRSA');
%% problem setting for the nonlinear dynamic problem
global tf h parameters n Tdata
% system paramter
a=100;b=10;q=0.95;
tf=20;h=0.005;Tdata=(0:h:tf)';
n=length(Tdata);
%% parameter and initial setting
parameters=[a,b,q];
x_cal=cal_Commensurate_PMSM(parameters);
%% add noise
fr1=0.5; % level of the noise
fr2=0.5;
fr3=0.5; % level of the noise
for j=1:length(x_cal(:,1))
x_cal(j,1)=x_cal(j,1)+fr1*(2*rand-1);
x_cal(j,2)=x_cal(j,2)+fr2*(2*rand-1);
x_cal(j,3)=x_cal(j,3)+fr3*(2*rand-1);
end
x_cal_data=x_cal(1:1:end,:);
savefile='simple_fre_data.mat';
save(savefile,'Tdata','x_cal_data');
%% plot
figure;
plot(Tdata,x_cal(:,1),'k-');
hold on;
plot(Tdata,x_cal(:,2),'r-');
hold on;
plot(Tdata,x_cal(:,3),'b-');
h1=legend('$$x$$','$$y$$','$$z$$');
set(h1,'Interpreter','latex','FontSize',15);
set(gca,'FontName','Times New Roman','FontSize',15,'LineWidth',1.5);
figure;
plot3(x_cal_data(:,1),x_cal_data(:,2),x_cal_data(:,3),'k-');
view(-35,30);
xlabel('x');ylabel('y');zlabel('z');
set(gca,'FontName','Times New Roman','FontSize',15,'LineWidth',1.5);