-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStatorArcOpt.m
106 lines (78 loc) · 2.06 KB
/
StatorArcOpt.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
%==========================================
% Title: Parameteroptimierung elektrischer Maschinen mit Genetischen Algorithmen
% Author: Omar Askour
% Date: WS20/21
%=========================================
openfemm
opendocument('seminarclosed.fem');
mi_saveas('test.fem');
n=70;
torq=[]; %zeros(n,1);
posArcc=[];%zeros(n,1);
vol=[];%zeros(n,1);
mi_selectlabel(36,36);
mi_deleteselectedlabels;
mi_addblocklabel(33,33);
mi_selectlabel(33,33 );
mi_setblockprop('M-19 Steel', 1, 0, '<None>', 0, 0, 1);
mi_clearselected
mi_selectnode(0,54);
mi_selectnode(54,0);
mi_deleteselectednodes;
mi_addnode(0,n);
mi_addnode(n,0);
mi_addsegment(49,0,n,0);
mi_addsegment(0,49,0,n);
mi_addarc(n,0,0,n,90,0.92);
mi_addboundprop('arcc', 0, 0, 0, 0, 0, 0, 0, 0, 0);
mi_selectarcsegment(n,0);
mi_setarcsegmentprop(0.39, 'arcc', 0, 2);
mi_clearselected();
for i=1:20
aktstep =n-i ;
prestep = aktstep+1;
fname = sprintf('StArccOptim%d.fem', aktstep);
% disp(sprintf('iteration %i of %i',i,19));
% disp(sprintf('aktstep %i of %i',aktstep,70));
% disp(sprintf('prestep %i of %i',prestep,70));
mi_analyze();
mi_loadsolution;
mi_saveas(fname);
mo_groupselectblock(1);
torq=[torq , mo_blockintegral(22)];
mo_groupselectblock(0);
vol=[vol,mo_blockintegral(10)];
posArcc=[posArcc,n-i];
mi_addnode(0,aktstep);
mi_addnode(aktstep,0);
mi_addarc(aktstep,0,0,aktstep,90,0.92);
mi_addboundprop('arcc', 0, 0, 0, 0, 0, 0, 0, 0, 0);
mi_selectarcsegment(aktstep,0);
mi_setarcsegmentprop(0.39, 'arcc', 0, 2);
mi_clearselected();
mi_selectnode(0,prestep);
mi_selectnode(prestep,0);
mi_deleteselectednodes;
% boundary "Arcc"
% mi_addboundprop('arcc', 0, 0, 0, 0, 0, 0, 0, 0, 0);
% mi_selectarcsegment(aktstep,0);
% mi_setarcsegmentprop(0.39, 'arcc', 0, 0);
% mi_clearselected();
end
%
disp(sprintf(' vol = %d ',vol));
disp(sprintf(' torge = %d ',torq));
figure
axis auto
plot(posArcc,torq,'r')
xlabel('arcc positions, mm');
xlim([49 70])
ylabel('Torque');
title('torque depends to arc');
figure
axis auto
plot(posArcc,vol)
xlabel('arcc positions, mm');
xlim([49 70])
ylabel('volume ');
title('volume depends to arc');