-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eureqa_extract_A2.m
executable file
·203 lines (158 loc) · 3.99 KB
/
Eureqa_extract_A2.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
%compare across G, fix A1 mr
%cd G:\orange_backup % any dir
%cd /Volumes/GROUP_BLACK/orange_backup/
%output values
%gamr(1:4) f1(fi) Re A2(fi)
% G/D, A1/D, m^*, damp, f_1/f_n, Re, A2/D
close all
clear all
sysdir
%% undamped cases
lsgamr=dir(['g*a*m*r*']);
result=zeros(1,7);
resc=0;
Re=100;
zeta=0;
A2switch=1; % A2=1 or A2dA1=0 or both
mrswitch=0; %mass ratio is a variable or not
n1=1;%starting number of files
disp(['starting number= ',num2str(n1)])
if A2switch
disp('drawing A2 graph')
else
disp('drawing A2/A1 graph')
end
if mrswitch
disp('dealing with mass ratios')
else
disp('NOT dealing with mass ratios')
end
n0=length(lsgamr);
s=0;sp=0;
sleg=0;sgamall=0;
for j=n1:n0
cd (lsgamr(j).name)
lsf1=dir('0*');
n=length(lsf1);
cd ('../')
if n==0; continue; end
gamr=s2gamr(lsgamr(j).name);
if gamr(1)==0.8; continue; end
if length(gamr)~=4; continue; end
%%
cd(lsgamr(j).name)
Lf1=length(lsf1);
f1=zeros(1,Lf1);%A2=zeros(1,Lf1);A2dA1=zeros(1,Lf1);
%%
%if Lf1<30; cd ../; continue; end
%%
for fi=1:n
[A2(fi), f1(fi)]=calA2(lsf1(fi).name);
if isempty(A2(fi)); continue; end
resc=resc+1;
result(resc,:)=[gamr(1:3) zeta f1(fi) Re A2(fi)]; %write the text
cd ../
end
cd ../
end
%% damped case
lsgamr=dir(['g*a*m*d*r*']);
% result=zeros(1,6);
% resc=0;
Re=100;
% zeta=0;
A2switch=1; % A2=1 or A2dA1=0 or both
mrswitch=0; %mass ratio is a variable or not
% n1=45;%starting number of files
% disp(['starting number= ',num2str(n1)])
if A2switch
disp('drawing A2 graph')
else
disp('drawing A2/A1 graph')
end
if mrswitch
disp('dealing with mass ratios')
else
disp('NOT dealing with mass ratios')
end
n0=length(lsgamr);
s=0;sp=0;
sleg=0;sgamall=0;
for j=1:n0
cd (lsgamr(j).name)
lsf1=dir('0*');
n=length(lsf1);
cd ('../')
if n==0; continue; end
gamr=s2gamr(lsgamr(j).name);
if gamr(1)==0.8; continue; end %0.8 mesh is broken, skipped
if length(gamr)~=5; continue; end %avoid picking up cases that are not targeted
%%
cd(lsgamr(j).name)
Lf1=length(lsf1);
f1=zeros(1,Lf1);%A2=zeros(1,Lf1);A2dA1=zeros(1,Lf1);
%%
%if Lf1<30; cd ../; continue; end
%%
for fi=1:n
[A2(fi), f1(fi)]=calA2(lsf1(fi).name);
if isempty(A2(fi)); continue; end
resc=resc+1;
result(resc,:)=[gamr(1:4) f1(fi) Re A2(fi)]; %write the text
cd ../
end
cd ../
end
%%
%% Re verid damped case
lsgamr=dir(['g*a*m*d*e*r*']);
% result=zeros(1,6);
% resc=0;
% zeta=0;
A2switch=1; % A2=1 or A2dA1=0 or both
mrswitch=0; %mass ratio is a variable or not
% n1=45;%starting number of files
% disp(['starting number= ',num2str(n1)])
if A2switch
disp('drawing A2 graph')
else
disp('drawing A2/A1 graph')
end
if mrswitch
disp('dealing with mass ratios')
else
disp('NOT dealing with mass ratios')
end
n0=length(lsgamr);
s=0;sp=0;
sleg=0;sgamall=0;
for j=1:n0
cd (lsgamr(j).name)
lsf1=dir('0*');
n=length(lsf1);
cd ('../')
if n==0; continue; end
gamr=s2gamr(lsgamr(j).name);
if gamr(1)==0.8; continue; end %0.8 mesh is broken, skipped
if length(gamr)~=6; continue; end %avoid picking up cases that are not targeted
%%
cd(lsgamr(j).name)
Lf1=length(lsf1);
f1=zeros(1,Lf1);%A2=zeros(1,Lf1);A2dA1=zeros(1,Lf1);
%%
%if Lf1<30; cd ../; continue; end
%%
for fi=1:n
[A2(fi), f1(fi)]=calA2(lsf1(fi).name);
if isempty(A2(fi)); continue; end
resc=resc+1;
result(resc,:)=[gamr(1:4) f1(fi) gamr(5) A2(fi)]; %write the text
cd ../
end
cd ../
end
%%
sysdir
result=result(~any(isnan(result),2),:);
csvwrite(['Eureqa_extract_',num2str(1+length(dir('Eureqa_extract*'))),'.dat'],result)
%%