File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ project (gimp_test)
2+
3+ set (CMAKE_CXX_STANDARD 14)
4+
5+ # Eigen
6+ find_package (Eigen3 REQUIRED )
7+ include_directories (${EIGEN3_INCLUDE_DIR} )
8+
9+ add_executable (gimp_test main.cpp )
Original file line number Diff line number Diff line change 1+ shp_fn = [0
2+ 0
3+ 0
4+ 0
5+ 0
6+ 0
7+ 0
8+ 0
9+ 0
10+ 0.000568182
11+ 0.00227273
12+ 0.00511364
13+ 0.00909091
14+ 0.0142045
15+ 0.0204545
16+ 0.0278409
17+ 0.0363636
18+ 0.0460227
19+ 0.0568182
20+ 0.06875
21+ 0.0818182
22+ 0.0960227
23+ 0.111364
24+ 0.127841
25+ 0.145455
26+ 0.164205
27+ 0.184091
28+ 0.205114
29+ 0.227273
30+ 0.250568
31+ 0.275
32+ 0.3
33+ 0.325
34+ 0.35
35+ 0.375
36+ 0.4
37+ 0.425
38+ 0.45
39+ 0.475
40+ 0.5
41+ 0.525
42+ 0.55
43+ 0.575
44+ 0.6
45+ 0.625
46+ 0.65
47+ 0.675
48+ 0.7
49+ 0.725
50+ 0.748864
51+ 0.770455
52+ 0.789773
53+ 0.806818
54+ 0.821591
55+ 0.834091
56+ 0.844318
57+ 0.852273
58+ 0.857955
59+ 0.861364
60+ 0.8625
61+ 0.861364
62+ 0.857955
63+ 0.852273
64+ 0.844318
65+ 0.834091
66+ 0.821591
67+ 0.806818
68+ 0.789773
69+ 0.770455
70+ 0.748864
71+ 0.725
72+ 0.7
73+ 0.675
74+ 0.65
75+ 0.625
76+ 0.6
77+ 0.575
78+ 0.55
79+ 0.525
80+ 0.5
81+ 0.475
82+ 0.45
83+ 0.425
84+ 0.4
85+ 0.375
86+ 0.35
87+ 0.325
88+ 0.3
89+ 0.275
90+ 0.250568
91+ 0.227273
92+ 0.205114
93+ 0.184091
94+ 0.164205
95+ 0.145455
96+ 0.127841
97+ 0.111364
98+ 0.0960227
99+ 0.0818182
100+ 0.06875
101+ 0.0568182
102+ 0.0460227
103+ 0.0363636
104+ 0.0278409
105+ 0.0204545
106+ 0.0142045
107+ 0.00909091
108+ 0.00511364
109+ 0.00227273
110+ 0.000568182
111+ 5 .42342e- 30
112+ 0
113+ 0
114+ 0
115+ 0
116+ 0
117+ 0
118+ 0
119+ 0
120+ 0 ];
121+
122+ grad_fn = [0
123+ 0
124+ 0
125+ 0
126+ 0
127+ 0
128+ 0
129+ 0
130+ 0
131+ 0.0227273
132+ 0.0454545
133+ 0.0681818
134+ 0.0909091
135+ 0.113636
136+ 0.136364
137+ 0.159091
138+ 0.181818
139+ 0.204545
140+ 0.227273
141+ 0.25
142+ 0.272727
143+ 0.295455
144+ 0.318182
145+ 0.340909
146+ 0.363636
147+ 0.386364
148+ 0.409091
149+ 0.431818
150+ 0.454545
151+ 0.477273
152+ 0.5
153+ 0.5
154+ 0.5
155+ 0.5
156+ 0.5
157+ 0.5
158+ 0.5
159+ 0.5
160+ 0.5
161+ 0.5
162+ 0.5
163+ 0.5
164+ 0.5
165+ 0.5
166+ 0.5
167+ 0.5
168+ 0.5
169+ 0.5
170+ 0.5
171+ 0.454545
172+ 0.409091
173+ 0.363636
174+ 0.318182
175+ 0.272727
176+ 0.227273
177+ 0.181818
178+ 0.136364
179+ 0.0909091
180+ 0.0454545
181+ 5 .65204e- 15
182+ -0.0454545
183+ -0.0909091
184+ -0.136364
185+ -0.181818
186+ -0.227273
187+ -0.272727
188+ -0.318182
189+ -0.363636
190+ -0.409091
191+ -0.454545
192+ -0.5
193+ -0.5
194+ -0.5
195+ -0.5
196+ -0.5
197+ -0.5
198+ -0.5
199+ -0.5
200+ -0.5
201+ -0.5
202+ -0.5
203+ -0.5
204+ -0.5
205+ -0.5
206+ -0.5
207+ -0.5
208+ -0.5
209+ -0.5
210+ -0.5
211+ -0.477273
212+ -0.454545
213+ -0.431818
214+ -0.409091
215+ -0.386364
216+ -0.363636
217+ -0.340909
218+ -0.318182
219+ -0.295455
220+ -0.272727
221+ -0.25
222+ -0.227273
223+ -0.204545
224+ -0.181818
225+ -0.159091
226+ -0.136364
227+ -0.113636
228+ -0.0909091
229+ -0.0681818
230+ -0.0454545
231+ -0.0227273
232+ -2 .22045e- 15
233+ 0
234+ 0
235+ 0
236+ 0
237+ 0
238+ 0
239+ 0
240+ 0
241+ 0 ];
242+
243+ interval = 0.05 ;
244+ looplength = 120 ;
245+ xi_start = - 3.95 ;
246+ xi_end = xi_start + (looplength * interval );
247+
248+ distance_from_node = [];
249+ test = [];
250+ j = 0 ;
251+ for i = xi_start : interval : xi_end - interval
252+ j = j + 1 ;
253+ distance_from_node(j ) = - 1 - i
254+ test(j ) = distance_from_node(j )/2 ;
255+ end
256+
257+ plot(test , shp_fn , test , grad_fn )
258+ xlabel(' Distance from node (1 = L)' )
259+ ylabel(' Function value' )
You can’t perform that action at this time.
0 commit comments