-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRotation_initial_arc.m
137 lines (79 loc) · 2.39 KB
/
Rotation_initial_arc.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
%==========================================
% Title: Parameteroptimierung elektrischer Maschinen mit Genetischen Algorithmen
% Author: Omar Askour
% Date: WS20/21
%=========================================
openfemm
% opendocument('seminarclosed.fem');
opendocument('Finalshape2.fem');
mi_saveas('test.fem');
torq=[];
theta=[];
vol=[];
x2=31.30;
x1=31.35;
mi_selectsegment(0,31.326);
mi_selectsegment(31.326,0);
mi_deleteselected;
iphase=5;
tic
for k=1:45
% fname = sprintf('RotationInit%d.fem', i);
theta_akt = k;
theta_pre = k-1;
phi_q = 0;
x_akt=x2*cosd(theta_akt);
y_akt=x2*sind(theta_akt);
x_pre=x2*cosd(theta_pre);
y_pre=x2*sind(theta_pre);
% disp(sprintf('teta %i und dtta %i ',theta_akt,dtta));
% disp(sprintf('teta %i und x_akt %i ',theta_akt,x_akt));
% disp(sprintf('teta %i und y_akt %i ',theta_akt,y_akt));
%
mi_modifycircprop('A',1,iphase*cosd(4*(theta_akt+phi_q)));
mi_modifycircprop('B',1,iphase*cosd(4*(theta_akt-120)+phi_q));
mi_modifycircprop('C',1,iphase*cosd(4*(theta_akt-240)+phi_q));
mi_selectgroup(1);
mi_moverotate(0,0,theta_akt);
% mi_addnode(-y_akt,x_akt);
% mi_addnode(-x_akt,-y_akt);
% mi_addnode(x_akt,-y_akt);
%%--- x(-)y(+)
mi_addarc(0,x1,-y_akt,x_akt,theta_akt,1);
mi_addarc(x1,0,x_akt,y_akt,theta_akt,1);
mi_selectarcsegment(-y_akt,x_akt);
mi_selectarcsegment(x_akt,y_akt);
mi_setarcsegmentprop(1,'arcgap', 0, 1);
%%--- x(-)y(-)
%%--- x(+)y(-)
%%--- x(+)y(+)
mi_clearselected();
mi_analyze();
mi_loadsolution;
% mi_saveas(fname);
mo_groupselectblock(1);
torq=[torq , mo_blockintegral(22)];
theta=[theta,theta_akt];
mi_selectarcsegment(x_pre,y_pre);
mi_selectarcsegment(-y_pre,x_pre);
mi_deleteselectedarcsegments;
mi_selectgroup(1);
mi_moverotate(0,0,-theta_akt);
end
toc
vol=[vol,mo_blockintegral(10)];
Mtorq= mean(torq);
ripple= (max(torq)-min(torq))/ 2*Mtorq;
disp(sprintf('torque ripple== %i',ripple));
disp(sprintf(' mean torqe = %d ',Mtorq));
disp(sprintf(' vol = %d ',vol));
mi_addsegment(0,x2,0,x1);
mi_addsegment(x2,0,x1,0);
figure
% axis auto
plot(theta,torq,'r')
xlabel('Rotation Winkel [°]');
% xlim([5 27])
yline(Mtorq,'-','Mittleres Drehmoment [N.m]');
ylabel('Drehmoment [N.m]');
title('mittleres Drehmoment abhängig von ');