Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/kraketm/ConstrainedDMD
06 August 2026, 14:24:23 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • e660bed
  • /
  • replication
  • /
  • TeaserPlot.m
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:5da6345ab382852c2a917fca544247fefc0134b1
origin badgedirectory badge
swh:1:dir:2c84a4fa67080b87e4954fa34921b700666b13e6
origin badgerevision badge
swh:1:rev:543b1af120732aa94738315eb75b8a4394caa951
origin badgesnapshot badge
swh:1:snp:3a2a144e060e76b48791aeb591bfbb26116f6bdd

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 543b1af120732aa94738315eb75b8a4394caa951 authored by timkrake on 24 November 2022, 08:36:43 UTC
Update README
Tip revision: 543b1af
TeaserPlot.m
function [] = TeaserPlot(DATA, DMDOrig, DMDCons)
% This function TeaserPlot replicates Fig. 1 of the related publication.
% It is only created for the Replicability Stamp.
%


col = [228,026,028;055,126,184;077,175,074;152,078,163;255,127,000;255,255,051;166,086,040;251,180,174;179,205,227;204,235,197;222,203,228;254,217,166;255,255,204;229,216,189]./255;

timeSeries  = DATA.timeSeries;
trend       = 2*(1:length(timeSeries)) + 50*ones(size(timeSeries));
frequency1  = 8*sin(2*pi*(0:size(timeSeries,2)-1)/7);
frequency2  = 20*sin(2*pi*(0:size(timeSeries,2)-1)/28);
noise       = DATA.timeSeries-trend-frequency1-frequency2;

patterns = [trend; frequency2; frequency1];

s = get(0, 'ScreenSize');
f = figure('Name','Teaser');
set(f,'units','pix')

tiledlayout(3,6, 'TileSpacing','compact' );
%f.Position = [1 (s(4)/3) (s(3)/1.0769) (s(4)/3)];
f.Position = [1 (s(4)/3) s(4)*1.485746123131210 (s(4)/3)];


%% DMD Orig Plots

I = DMDOrig.filtering;
    
tmp = 0;
tmp_sum = 0;
plotnum = 1;

for l = 1:length(DMDOrig.lambdaSort)
    nexttile(plotnum, [1 2])
    k = I(l);
    
    if(imag(DMDOrig.lambdaSort(k)) < 1e-9)
        tmp_plot = real(TOOL_DiagonalAveraging(DMDOrig.ThetaScaledSort(:,k) * ...
            DMDOrig.lambdaSort(k).^(0:DATA.m)));
    else
        tmp_plot = 2*real(TOOL_DiagonalAveraging(DMDOrig.ThetaScaledSort(:,k) * ...
            DMDOrig.lambdaSort(k).^(0:DATA.m)));
    end

    tmp_sum = tmp_sum + tmp_plot;
    p2=plot(1:length(DATA.timeSeries),patterns(l,:),1:length(tmp_sum),tmp_plot);
    set(p2(1),'LineStyle','-','LineWidth',1,'Color',col(9,:));
    set(p2(2),'LineWidth',1,'Color',col(2,:));
    
    if l==1
        title( 'trend', 'FontWeight','normal' )
        box off
        axis([-inf inf -20 170])
    else
        title(sprintf('period: %.2f', 2*pi*1j/log(DMDOrig.lambdaSort(k))), 'FontWeight','normal')
        box off
        axis([-inf inf min(min(patterns(l,:)), min(tmp_plot)) max(max(patterns(l,:)), max(tmp_plot))])
    end

    set(gca,'xtick',[])
    set(gca,'xticklabel',[])
    set(gca,'ytick',[])
    set(gca,'yticklabel',[])
    pbaspect([6 1 1])
    box on

    tmp = tmp + 1;

    if(tmp == 3)
        break
    end
        
    plotnum= plotnum + 6;
end

%f.Position = [1 378 1560 350];


dim = [0.0628 0.1 0.285 0.9];
str = 'Dynamic Mode Decomposition';
annotation('textbox',dim,'String',str, 'FontWeight','bold')

dim = [0.3576 0.1 0.285 0.9];
str = 'Input';
annotation('textbox',dim,'String',str, 'FontWeight','bold')

dim = [0.6527 0.1 0.285 0.9];
str = 'Constrained Dynamic Mode Decomposition';
annotation('textbox',dim,'String',str, 'FontWeight','bold')

%% Time Series Plots
nexttile(3)
plot(trend)
axis([-inf inf min(trend) max(trend)])
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
pbaspect([6 1 1])
box on
pbaspect([4 1 1])
title( 'trend: linear increase','FontWeight','normal');
        
nexttile(4)
plot(noise)
axis([-inf inf -20 20])
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
pbaspect([6 1 1])
box on
pbaspect([4 1 1])
title('noise: 5.00%', 'FontWeight','normal' )

nexttile(9)
plot(frequency2)
axis([-inf inf min(frequency2) max(frequency2)])
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
pbaspect([6 1 1])
box on
pbaspect([4 1 1])
title( sprintf('seasonal pattern - period: %.2f', 28.00) , 'FontWeight','normal')

nexttile(10)
plot(frequency1)
axis([-inf inf min(frequency1) max(frequency1)])
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
pbaspect([6 1 1])
box on
pbaspect([4 1 1])
title( sprintf('seasonal pattern - period: %.2f', 7.00), 'FontWeight','normal' )

nexttile(15, [1 2])
plot(DATA.timeSeries)

axis([-inf inf min(timeSeries) max(timeSeries)])
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
pbaspect([6 1 1])
box on
title( sprintf('time series') , 'FontWeight','normal')


%% Constrained DMD Plots

I = DMDCons.filtering;

tmp = 0;
tmp_sum = 0;
plotnum = 5;

for l = 1:length(DMDCons.lambdaSort)
    nexttile(plotnum, [1 2])
    k = I(l);
        
    if(imag(DMDCons.lambdaSort(k)) < 1e-9)
        tmp_plot = real(TOOL_DiagonalAveraging(DMDCons.ThetaScaledSort(:,k) * ...
            DMDCons.lambdaSort(k).^(0:DATA.m)));
    else
        tmp_plot = 2*real(TOOL_DiagonalAveraging(DMDCons.ThetaScaledSort(:,k) * ...
            DMDCons.lambdaSort(k).^(0:DATA.m)));
    end

    tmp_sum = tmp_sum + tmp_plot;
    p2=plot(1:length(DATA.timeSeries),patterns(l,:),1:length(tmp_sum),tmp_plot);
    set(p2(1),'LineStyle','-','LineWidth',1,'Color',col(9,:));
    set(p2(2),'LineWidth',1,'Color',col(2,:));
    box off
    

    if l==1
        title( 'trend', 'FontWeight','normal')
        box off
        axis([-inf inf -20 170])
    else
        title(sprintf('period: %.2f', 2*pi*1j/log(DMDCons.lambdaSort(k))), 'FontWeight','normal')
        box off
        axis([-inf inf min(min(patterns(l,:)), min(tmp_plot)) max(max(patterns(l,:)), max(tmp_plot))])
    end


    set(gca,'xtick',[])
    set(gca,'xticklabel',[])
    set(gca,'ytick',[])
    set(gca,'yticklabel',[])
    pbaspect([6 1 1])
    box on
    pbaspect([6 1 1])
    
    tmp = tmp + 1;

        if(tmp == 3)
            break
        end
    
    plotnum= plotnum + 6;
end

% Export into figures folder
% exportgraphics(f,'../figures/Fig01.jpg')

end


back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API