-
Notifications
You must be signed in to change notification settings - Fork 4
/
launch.m
685 lines (497 loc) · 29.7 KB
/
launch.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
function varargout = launch(varargin)
% LAUNCH MATLAB code for launch.fig
% LAUNCH, by itself, creates a new LAUNCH or raises the existing
% singleton*.
%
% H = LAUNCH returns the handle to a new LAUNCH or the handle to
% the existing singleton*.
%
% LAUNCH('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in LAUNCH.M with the given input arguments.
%
% LAUNCH('Property','Value',...) creates a new LAUNCH or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before launch_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to launch_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help launch
% Last Modified by GUIDE v2.5 06-May-2016 14:28:01
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @launch_OpeningFcn, ...
'gui_OutputFcn', @launch_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
addpath(genpath(pwd))
% --- Executes just before launch is made visible.
function launch_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to launch (see VARARGIN)
% Choose default command line output for launch
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes launch wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = launch_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in Run.
function Run_Callback(hObject, eventdata, handles)
% hObject handle to Run (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Clos Fig. 1 in case the program ran previously
figure(1)
close 1
figure(2)
close 2
clc
convert_user_input(handles)
main
% --- Executes on button press in title_question.
function title_question_Callback(hObject, eventdata, handles)
% hObject handle to title_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Simulate a nonlinear dynamic system and calculate the control effort to stabilize it. Andy Zelenak, 2014');
% --- Executes on button press in run_question.
function run_question_Callback(hObject, eventdata, handles)
% hObject handle to run_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Run the simulation after all options have been configured.');
% --- Executes on button press in start_time_question.
function start_time_question_Callback(hObject, eventdata, handles)
% hObject handle to start_time_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Simulation start time. This quantity is unitless -- it could be seconds or hours, depending on your system definition.');
% --- Executes on button press in end_time_question.
function end_time_question_Callback(hObject, eventdata, handles)
% hObject handle to end_time_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Simulation end time. This quantity is unitless -- it could be seconds or hours, depending on your system definition.');
% --- Executes on button press in time_step_question.
function time_step_question_Callback(hObject, eventdata, handles)
% hObject handle to time_step_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Simulation time step. A smaller time step will give more accurate results and may do a better job of stabilizing the system, but it will take longer to run.');
% --- Executes on button press in num_states_question.
function num_states_question_Callback(hObject, eventdata, handles)
% hObject handle to num_states_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('What is the order of the dynamic system? 1,2,3, etc');
% --- Executes on button press in num_inputs_question.
function num_inputs_question_Callback(hObject, eventdata, handles)
% hObject handle to num_inputs_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('How many inputs does the system have? For example, if there is only one motor, there is probably just 1 input.');
% --- Executes on button press in stiff_system_question.
function stiff_system_question_Callback(hObject, eventdata, handles)
% hObject handle to stiff_system_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Are the system equations stiff? Check if so to use a stiff ode solver. Indications that it_s a stiff system include: 1. The non-stiff solver is slower than the stiff solver. 2. There is a mix of large and relatively small coefficients. 3. Some state variables vary much more rapidly than others. For stiff systems, ode23s is used, otherwise ode23.');
% --- Executes during object creation, after setting all properties.
function Picture_CreateFcn(hObject, eventdata, handles)
% hObject handle to Picture (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate Picture
function Start_Time_Input_Callback(hObject, eventdata, handles)
% hObject handle to Start_Time_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Start_Time_Input as text
% str2double(get(hObject,'String')) returns contents of Start_Time_Input as a double
% --- Executes during object creation, after setting all properties.
function Start_Time_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Start_Time_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Stop_Time_Input_Callback(hObject, eventdata, handles)
% hObject handle to Stop_Time_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Stop_Time_Input as text
% str2double(get(hObject,'String')) returns contents of Stop_Time_Input as a double
% --- Executes during object creation, after setting all properties.
function Stop_Time_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Stop_Time_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Time_Step_Input_Callback(hObject, eventdata, handles)
% hObject handle to Time_Step_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Time_Step_Input as text
% str2double(get(hObject,'String')) returns contents of Time_Step_Input as a double
% --- Executes during object creation, after setting all properties.
function Time_Step_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Time_Step_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Num_States_Input_Callback(hObject, eventdata, handles)
% hObject handle to Num_States_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Num_States_Input as text
% str2double(get(hObject,'String')) returns contents of Num_States_Input as a double
% --- Executes during object creation, after setting all properties.
function Num_States_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Num_States_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Num_Inputs_Input_Callback(hObject, eventdata, handles)
% hObject handle to Num_Inputs_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Num_Inputs_Input as text
% str2double(get(hObject,'String')) returns contents of Num_Inputs_Input as a double
% --- Executes during object creation, after setting all properties.
function Num_Inputs_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Num_Inputs_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Stiff_System_Input.
function Stiff_System_Input_Callback(hObject, eventdata, handles)
% hObject handle to Stiff_System_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Stiff_System_Input
function x_Target_Input_Callback(hObject, eventdata, handles)
% hObject handle to x_Target_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of x_Target_Input as text
% str2double(get(hObject,'String')) returns contents of x_Target_Input as a double
% --- Executes during object creation, after setting all properties.
function x_Target_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to x_Target_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Target_Location_Question.
function Target_Location_Question_Callback(hObject, eventdata, handles)
% hObject handle to Target_Location_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Where do you want to regulate the system to? This can be a static coordinate like [3] or a time-varying expression, expressed in terms of t(epoch).');
% --- Executes during object creation, after setting all properties.
function IC_Question_CreateFcn(hObject, eventdata, handles)
% hObject handle to IC_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in IC_Question.
function IC_Question_Callback(hObject, eventdata, handles)
% hObject handle to IC_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Where is the system in state-space, initially?');
function IC_Input_Callback(hObject, eventdata, handles)
% hObject handle to IC_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of IC_Input as text
% str2double(get(hObject,'String')) returns contents of IC_Input as a double
% --- Executes during object creation, after setting all properties.
function IC_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Stop_Time_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Min_Saturation_Input_Callback(hObject, eventdata, handles)
% hObject handle to Min_Saturation_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Min_Saturation_Input as text
% str2double(get(hObject,'String')) returns contents of Min_Saturation_Input as a double
% --- Executes during object creation, after setting all properties.
function Min_Saturation_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Min_Saturation_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Max_Saturation_Input_Callback(hObject, eventdata, handles)
% hObject handle to Max_Saturation_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Max_Saturation_Input as text
% str2double(get(hObject,'String')) returns contents of Max_Saturation_Input as a double
% --- Executes during object creation, after setting all properties.
function Max_Saturation_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Max_Saturation_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function V_Dot_Input_Callback(hObject, eventdata, handles)
% hObject handle to V_Dot_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of V_Dot_Input as text
% str2double(get(hObject,'String')) returns contents of V_Dot_Input as a double
% --- Executes during object creation, after setting all properties.
function V_Dot_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to V_Dot_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in V_Dot_Question.
function V_Dot_Question_Callback(hObject, eventdata, handles)
% hObject handle to V_Dot_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('How quickly should the controller push towards the target location? A more negative number generally performs better. It must be a negative number. It is -20log(V_dot_target_initial).');
% --- Executes on button press in Input_Saturation_Question.
function Input_Saturation_Question_Callback(hObject, eventdata, handles)
% hObject handle to Input_Saturation_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Are there physical limits on the input? Enter arrays of u1_limit, u2_limit, etc...');
function Max_Epochs_Input_Callback(hObject, eventdata, handles)
% hObject handle to Max_Epochs_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Max_Epochs_Input as text
% str2double(get(hObject,'String')) returns contents of Max_Epochs_Input as a double
% --- Executes during object creation, after setting all properties.
function Max_Epochs_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Max_Epochs_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Gamma_Question.
function Gamma_Question_Callback(hObject, eventdata, handles)
% hObject handle to Gamma_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Set saturation limits for how quickly the controller adapts.');
function Gamma_Input_Callback(hObject, eventdata, handles)
% hObject handle to Gamma_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Gamma_Input as text
% str2double(get(hObject,'String')) returns contents of Gamma_Input as a double
% --- Executes during object creation, after setting all properties.
function Gamma_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Gamma_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Adapt_Input.
function Adapt_Input_Callback(hObject, eventdata, handles)
% hObject handle to Adapt_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Adapt_Input
% --- Executes on button press in Adapt_Question.
function Adapt_Question_Callback(hObject, eventdata, handles)
% hObject handle to Adapt_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Check to run a model identification adaptive controller. It only works on single input systems. However, there is no mathematical guarantee that the adaptive controller will stabilize the system.');
% --- Executes on button press in Plant_Definition_Question.
function Plant_Definition_Question_Callback(hObject, eventdata, handles)
% hObject handle to Plant_Definition_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Locate the .m file that defines the dynamic equations of the system. To define your own system, copy one of the existing files and edit the last few lines.');
% --- Executes on button press in Model_Definition_Question.
function Model_Definition_Question_Callback(hObject, eventdata, handles)
% hObject handle to Model_Definition_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Locate the .m file that defines the dynamic equations that model the system. To define your own system, copy one of the existing files and edit the last few lines. Or, select the "No_model.m" file if a model is unknown.');
% --- Executes on button press in Browse_For_Plant.
function Browse_For_Plant_Callback(hObject, eventdata, handles)
% hObject handle to Browse_For_Plant (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cd plant_dynamic_equations
[plant_filename] = uigetfile({'*.m'},'Select Definition for Plant');
% Remove .m from the end of the filename
plant_filename = plant_filename(1:end-2);
set(handles.Browse_For_Plant, 'String', plant_filename);
cd ..
% --- Executes on button press in Browse_For_Model.
function Browse_For_Model_Callback(hObject, eventdata, handles)
% hObject handle to Browse_For_Model (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cd model_dynamic_equations
[model_filename] = uigetfile({'*.m'},'Select Definition for Model');
% Remove .m from the end of the filename
model_filename = model_filename(1:end-2);
set(handles.Browse_For_Model, 'String', model_filename);
cd ..
% --- Executes on button press in partial_derivative_question.
function partial_derivative_question_Callback(hObject, eventdata, handles)
% hObject handle to partial_derivative_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('The default controller performs poorly on underactuated (e.g. integrator) systems. Use the alternative method to focus only on the first state, x1.');
% --- Executes on button press in Underactuated_Input.
function Underactuated_Input_Callback(hObject, eventdata, handles)
% hObject handle to Underactuated_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Underactuated_Input
% --- Executes on button press in switching_threshold_question.
function switching_threshold_question_Callback(hObject, eventdata, handles)
% hObject handle to switching_threshold_question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Determines how often the alternative Lyapunov function should be used.');
function Switching_Threshold_Input_Callback(hObject, eventdata, handles)
% hObject handle to Switching_Threshold_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Switching_Threshold_Input as text
% str2double(get(hObject,'String')) returns contents of Switching_Threshold_Input as a double
% --- Executes during object creation, after setting all properties.
function Switching_Threshold_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Switching_Threshold_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in LPF_Input.
function LPF_Input_Callback(hObject, eventdata, handles)
% hObject handle to LPF_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of LPF_Input
% --- Executes on button press in LPF_Question.
function LPF_Question_Callback(hObject, eventdata, handles)
% hObject handle to LPF_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Apply a Low Pass Filter to smooth the calculated control effort.');
function Cutoff_Input_Callback(hObject, eventdata, handles)
% hObject handle to Cutoff_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Cutoff_Input as text
% str2double(get(hObject,'String')) returns contents of Cutoff_Input as a double
% --- Executes during object creation, after setting all properties.
function Cutoff_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Cutoff_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Integral_Question.
function Integral_Question_Callback(hObject, eventdata, handles)
% hObject handle to Integral_Question (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
h = msgbox('Apply integral action to correct steady-state error.');
function Integral_Input_Callback(hObject, eventdata, handles)
% hObject handle to Integral_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Integral_Input as text
% str2double(get(hObject,'String')) returns contents of Integral_Input as a double
% --- Executes during object creation, after setting all properties.
function Integral_Input_CreateFcn(hObject, eventdata, handles)
% hObject handle to Integral_Input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end