(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(*This notebook creates the figures for the cjSOE model using ctDiscrete code*)


ClearAll["Global`*"];ParamsAreSet=False;
(* If running from the Notebook interface *)
If[$VersionNumber<8,(*then*) Print["These programs require Mathematica version 8 or greater."];Abort[]];

If[Length[$FrontEnd] > 0,NBDir=SetDirectory[NotebookDirectory[]]];(* If running from the Notebook interface *)
If[$FrontEnd == Null,OpenFigsUsingShell=True,OpenFigsUsingShell=False]; 
AutoLoadDir=SetDirectory["../../CoreCode/Autoload"];Get["./init.m"];
CoreCodeDir=SetDirectory[".."];
rootDir = SetDirectory[".."];(* root directory is above CoreCode *)
FigsDir=SetDirectory[rootDir<>"/Examples/cjSOE/Figures/"];
CodeDir=SetDirectory[rootDir<>"/Examples/cjSOE"];
Get[CoreCodeDir<>"/MakeAnalyticalResults.m"];
Get[CoreCodeDir<>"/VarsAndFuncs.m"];
(* Method of creating figures depends on whether being run in batch mode or interactively *)
If[$FrontEnd == Null,OpenFigsUsingShell=True,OpenFigsUsingShell=False]; 
Get[CoreCodeDir<>"/ParametersBase.m"];


Get[CodeDir<>"/phaseDiagMake.m"];phaseDiagMake;Print[phaseDiag];


Get[CodeDir<>"/pathsMake.m"];pathsMake;Print[paths];


Get[CodeDir<>"/FuncsInit.m"];
Get[CodeDir<>"/FuncsSOE.m"];
Get[CodeDir<>"/FuncsIndivProblem.m"];
resetParams;
calculateValues;


Get[CodeDir<>"/sensitivityMake.m"];sensitivityMake;Print[sensitivity];


Get[CodeDir<>"/socInsMake.m"];socInsMake;Print[socIns];


Get[CodeDir<>"/transDynMake.m"];transDynMake;Print[transDyn];


Get[CodeDir<>"/capOutflowsMake.m"];capOutflowsMake;Print[capOutflows];


ClearAll["Global`*"];ParamsAreSet=False;
(* If running from the Notebook interface *)
If[$VersionNumber<8,(*then*) Print["These programs require Mathematica version 8 or greater."];Abort[]];

If[Length[$FrontEnd] > 0,NBDir=SetDirectory[NotebookDirectory[]]];(* If running from the Notebook interface *)
If[$FrontEnd == Null,OpenFigsUsingShell=True,OpenFigsUsingShell=False]; 
AutoLoadDir=SetDirectory["../../CoreCode/Autoload"];Get["./init.m"];
CoreCodeDir=SetDirectory[".."];
rootDir = SetDirectory[".."];(* root directory is above CoreCode *)
FigsDir=SetDirectory[rootDir<>"/Examples/cjSOE/Figures/"];
CodeDir=SetDirectory[rootDir<>"/Examples/cjSOE"];
cjSOEDirCode=SetDirectory[rootDir<>"/Examples/cjSOE"];cjSOEDirFigs=SetDirectory[rootDir<>"/Examples/cjSOE/Figures"];
Get[CoreCodeDir<>"/MakeAnalyticalResults.m"];
Get[CoreCodeDir<>"/VarsAndFuncs.m"];
(* Method of creating figures depends on whether being run in batch mode or interactively *)
If[$FrontEnd == Null,OpenFigsUsingShell=True,OpenFigsUsingShell=False]; 
Get[CoreCodeDir<>"/ParametersBase.m"];
Get[CodeDir<>"/FuncsInit.m"];
Get[CodeDir<>"/FuncsSOE.m"];
Get[CodeDir<>"/FuncsIndivProblem.m"];
resetParams;
calculateValues;


Get[CodeDir<>"/genEqbmMake.m"];genEqbmMake;Print[genEqbm];


Get[CodeDir<>"/globImbMake.m"];globImbMake;Print[globImb];
