Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions matlab_scripts/term_lab.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

%% boiler plate

%%% add wsindy_obj_base to path
scriptsdir = fileparts(matlab.desktop.editor.getActiveFilename);
repodir = fileparts(scriptsdir);
addpath(genpath(repodir));

%%% restart with same rng seed or clear workspace and start from scratch
restart_run = false;
if ~restart_run
Expand All @@ -16,12 +11,18 @@
clear;
end

%%% add wsindy_obj_base to path (library only — avoids shadowing duplicate scripts)
scriptdir = fileparts(mfilename('fullpath'));
repodir = fileparts(scriptdir);
wsindy_lib = fullfile(repodir, 'libs', 'wsindy_obj_base');
addpath(wsindy_lib);

%%% consolidate figures
set(0,'DefaultFigureWindowStyle','docked')

%% load data

dr = 'pde_data/';
dr = [fullfile(wsindy_lib, 'pde_data'), filesep];
pde_name = 'NLS.mat';
load([dr,pde_name],'U_exact','lhs','true_nz_weights','xs')

Expand Down
9 changes: 5 additions & 4 deletions matlab_scripts/wendy_ode_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

%% boiler plate

%%% add wsindy_obj_base to path
scriptsdir = fileparts(matlab.desktop.editor.getActiveFilename);
repodir = fileparts(scriptsdir);
addpath(genpath(repodir));
%%% add wsindy_obj_base to path (library only — avoids shadowing duplicate scripts)
scriptdir = fileparts(mfilename('fullpath'));
repodir = fileparts(scriptdir);
wsindy_lib = fullfile(repodir, 'libs', 'wsindy_obj_base');
addpath(wsindy_lib);

%%% restart with same rng seed or clear workspace and start from scratch
restart_run = true;
Expand Down
9 changes: 5 additions & 4 deletions matlab_scripts/wsindy_ode_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
%%% consolidate figures
set(0,'DefaultFigureWindowStyle','docked')

%%% add wsindy_obj_base to path
scriptsdir = fileparts(matlab.desktop.editor.getActiveFilename);
repodir = fileparts(scriptsdir);
addpath(genpath(repodir));
%%% add wsindy_obj_base to path (library only — avoids shadowing duplicate scripts)
scriptdir = fileparts(mfilename('fullpath'));
repodir = fileparts(scriptdir);
wsindy_lib = fullfile(repodir, 'libs', 'wsindy_obj_base');
addpath(wsindy_lib);

%% load data

Expand Down
15 changes: 8 additions & 7 deletions matlab_scripts/wsindy_pde_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
%%% consolidate figures
set(0,'DefaultFigureWindowStyle','docked')

%%% add wsindy_obj_base to path
scriptsdir = fileparts(matlab.desktop.editor.getActiveFilename);
repodir = fileparts(scriptsdir);
addpath(genpath(repodir));
%%% add wsindy_obj_base to path (library only — avoids shadowing duplicate scripts)
scriptdir = fileparts(mfilename('fullpath'));
repodir = fileparts(scriptdir);
wsindy_lib = fullfile(repodir, 'libs', 'wsindy_obj_base');
addpath(wsindy_lib);

%% parameters

%%% available PDE data
% dr = 'pde_data/';
dr = '/home/danielmessenger/data/';
dr = [fullfile(wsindy_lib, 'pde_data'), filesep];
% dr = 'C:/Users/385570/Desktop/data/WSINDy_PDE_zenodo/';
pde_names = {'burgers.mat',...
'KS.mat',...
'NLS.mat',...
Expand Down Expand Up @@ -199,7 +200,7 @@
figure(2);clf;
for j=1:size(loss_wsindy,1)-1
f = min(loss_wsindy(j,:));
g = min(loss_wsindy(end,loss_wsindy(1,:)==f));
g = min(loss_wsindy(end,loss_wsindy(j,:)==f));
loglog(loss_wsindy(end,:),loss_wsindy(j,:),'o-',g,f,'rx')
hold on
end
Expand Down