Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
matlab-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
matlab-gui
Commits
b9399974
Verified
Commit
b9399974
authored
5 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
simul: add possibility to use smoother/steady state vals as initial values
parent
73ec2b6e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gui_determ_simulation.m
+110
-26
110 additions, 26 deletions
src/gui_determ_simulation.m
with
110 additions
and
26 deletions
src/gui_determ_simulation.m
+
110
−
26
View file @
b9399974
...
@@ -39,43 +39,53 @@ gui_size = gui_tools.get_gui_elements_size(tabId);
...
@@ -39,43 +39,53 @@ gui_size = gui_tools.get_gui_elements_size(tabId);
% --- PANELS -------------------------------------
% --- PANELS -------------------------------------
handles
.
uipanelShocks
=
uipanel
(
...
handles
.
uipanelShocks
=
uipanel
(
...
'Parent'
,
tabId
,
...
'Parent'
,
tabId
,
...
'Tag'
,
'uipanelShocks'
,
'BackgroundColor'
,
special_color
,
...
'Tag'
,
'uipanelShocks'
,
...
'Units'
,
'normalized'
,
'Position'
,
[
0.01
0.18
0.6
0.73
],
...
'BackgroundColor'
,
special_color
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.01
0.18
0.6
0.73
],
...
'Title'
,
''
,
...
'Title'
,
''
,
...
'BorderType'
,
'none'
);
'BorderType'
,
'none'
);
uipanelShocks_CreateFcn
;
uipanelShocks_CreateFcn
;
handles
.
uipanelVars
=
uipanel
(
...
handles
.
uipanelVars
=
uipanel
(
...
'Parent'
,
tabId
,
'Tag'
,
'uipanelVars'
,
...
'Parent'
,
tabId
,
...
'UserData'
,
zeros
(
1
,
0
),
'BackgroundColor'
,
special_color
,
...
'Tag'
,
'uipanelVars'
,
...
'Units'
,
'normalized'
,
'Position'
,
[
0.62
0.18
0.37
0.73
],
...
'UserData'
,
zeros
(
1
,
0
),
...
'Title'
,
''
,
'BorderType'
,
'none'
);
'BackgroundColor'
,
special_color
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.62
0.18
0.37
0.70
],
...
'Title'
,
''
,
...
'BorderType'
,
'none'
);
handles
=
gui_tabs
.
create_endo_vars
(
handles
,
'perfect_foresight'
);
handles
=
gui_tabs
.
create_endo_vars
(
handles
,
'perfect_foresight'
);
handles
.
uipanelComm
=
uipanel
(
...
handles
.
uipanelComm
=
uipanel
(
...
'Parent'
,
tabId
,
...
'Parent'
,
tabId
,
...
'Tag'
,
'uipanelCommOptions'
,
...
'Tag'
,
'uipanelCommOptions'
,
...
'UserData'
,
zeros
(
1
,
0
),
'BackgroundColor'
,
bg_color
,
...
'UserData'
,
zeros
(
1
,
0
),
...
'Units'
,
'normalized'
,
'Position'
,
[
0.01
0.09
0.98
0.09
],
...
'BackgroundColor'
,
bg_color
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.01
0.09
0.98
0.09
],
...
'Title'
,
'Current command options:'
);
'Title'
,
'Current command options:'
);
% --- STATIC TEXT -------------------------------------
% --- STATIC TEXT -------------------------------------
handles
.
text7
=
uicontrol
(
...
uicontrol
(
...
'Parent'
,
tabId
,
...
'Parent'
,
tabId
,
...
'Tag'
,
'text7'
,
...
'Style'
,
'text'
,
...
'Style'
,
'text'
,
'BackgroundColor'
,
bg_color
,
...
'BackgroundColor'
,
bg_color
,
...
'Units'
,
'normalized'
,
'Position'
,[
0.62
0.92
0.48
0.05
],
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.62
0.92
0.48
0.05
],
...
'FontWeight'
,
'bold'
,
...
'FontWeight'
,
'bold'
,
...
'String'
,
'Select variables for which to plot simulated trajectory:'
,
...
'String'
,
'Select variables for which to plot simulated trajectory:'
,
...
'HorizontalAlignment'
,
'left'
);
'HorizontalAlignment'
,
'left'
);
handles
.
text8
=
uicontrol
(
...
uicontrol
(
...
'Parent'
,
tabId
,
...
'Parent'
,
tabId
,
...
'Tag'
,
'text8'
,
...
'Style'
,
'text'
,
...
'Style'
,
'text'
,
'BackgroundColor'
,
bg_color
,
...
'BackgroundColor'
,
bg_color
,
...
'Units'
,
'normalized'
,
'Position'
,[
0.01
0.92
0.48
0.05
],
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.01
0.92
0.48
0.05
],
...
'FontWeight'
,
'bold'
,
...
'FontWeight'
,
'bold'
,
...
'String'
,
'Define shocks on exogenous variables:'
,
...
'String'
,
'Define shocks on exogenous variables:'
,
...
'HorizontalAlignment'
,
'left'
);
'HorizontalAlignment'
,
'left'
);
...
@@ -95,6 +105,43 @@ handles.simul = uicontrol( ...
...
@@ -95,6 +105,43 @@ handles.simul = uicontrol( ...
'TooltipString'
,
comm_str
,
...
'TooltipString'
,
comm_str
,
...
'HorizontalAlignment'
,
'left'
);
'HorizontalAlignment'
,
'left'
);
% --- Check Boxes -------------------------------------
uicontrol
(
...
'Parent'
,
tabId
,
...
'Style'
,
'text'
,
...
'BackgroundColor'
,
bg_color
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.62
0.88
0.48
0.05
],
...
'FontWeight'
,
'bold'
,
...
'String'
,
'Use initial values from...'
,
...
'HorizontalAlignment'
,
'left'
);
handles
.
steadystate
=
uicontrol
(
...
'Parent'
,
tabId
,
...
'Style'
,
'checkbox'
,
...
'String'
,
'steady state'
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.72
0.89
0.48
0.05
],
...
'Value'
,
0
,
...
'Callback'
,
@
steady_state_init_val
);
handles
.
smoother
=
uicontrol
(
...
'Parent'
,
tabId
,
...
'Style'
,
'checkbox'
,
...
'String'
,
'smoother'
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.79
0.89
0.48
0.05
],
...
'Value'
,
0
,
...
'Callback'
,
@
smoother_init_val
);
handles
.
zero
=
uicontrol
(
...
'Parent'
,
tabId
,
...
'Style'
,
'checkbox'
,
...
'String'
,
'zero'
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
0.85
0.89
0.48
0.05
],
...
'Value'
,
0
,
...
'Callback'
,
@
zero_init_val
);
% --- PUSHBUTTONS -------------------------------------
% --- PUSHBUTTONS -------------------------------------
handles
.
pushbuttonSimulation
=
uicontrol
(
...
handles
.
pushbuttonSimulation
=
uicontrol
(
...
...
@@ -502,4 +549,41 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
...
@@ -502,4 +549,41 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
% return as JSON string
% return as JSON string
json
=
savejson
(
''
,
json
,
'ParseLogical'
,
1
,
'FileName'
,
''
,
'ArrayIndent'
,
0
);
json
=
savejson
(
''
,
json
,
'ParseLogical'
,
1
,
'FileName'
,
''
,
'ArrayIndent'
,
0
);
end
end
function
steady_state_init_val
(
~
,
evt
)
if
~
evt
.
Source
.
Value
return
end
if
~
isfield
(
oo_
,
'steady_state'
)
gui_tools
.
show_warning
(
'Must first calculate the steady state'
)
evt
.
Source
.
Value
=
0
;
return
end
handles
.
endoTable
.
Data
(:,
3
)
=
num2cell
(
oo_
.
steady_state
);
handles
.
zero
.
Value
=
0
;
handles
.
smoother
.
Value
=
0
;
end
function
smoother_init_val
(
~
,
evt
)
if
~
evt
.
Source
.
Value
return
end
if
~
isfield
(
oo_
,
'SmoothedVariables'
)
gui_tools
.
show_warning
(
'Must first run smoother'
)
evt
.
Source
.
Value
=
0
;
return
end
handles
.
endoTable
.
Data
(:,
3
)
=
num2cell
(
oo_
.
SmoothedVariables
);
handles
.
zero
.
Value
=
0
;
handles
.
steadystate
.
Value
=
0
;
end
function
zero_init_val
(
~
,
evt
)
if
~
evt
.
Source
.
Value
return
end
handles
.
endoTable
.
Data
(:,
3
)
=
num2cell
(
zeros
(
M_
.
orig_endo_nbr
,
1
));
handles
.
smoother
.
Value
=
0
;
handles
.
steadystate
.
Value
=
0
;
end
end
end
This diff is collapsed.
Click to expand it.
Houtan Bastani
@houtanb
mentioned in commit
a4df43e3
·
5 years ago
mentioned in commit
a4df43e3
mentioned in commit a4df43e3b7b977f14828ce0aeaf97e1a745fcd58
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment