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
  • /
  • MultiPlot.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:afa3f9d5fc4fe06b76fc5e3edb8a9bbd9b8462cc
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
MultiPlot.m
function [] = MultiPlot(DATA, DMDOrig, DMDCons)
% This function MultiPlot replicates Fig. 10 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;

f = figure('Name','Multi');
set(f,'units','pix')

tiledlayout(8,6, 'TileSpacing','tight' );
%f.Position = [1,223,1473,456];
s = get(0, 'ScreenSize');
f.Position = [1,s(4)/3, s(4)*1.292105263157895, s(4)/2.5];

% Main Boxes:
dim = [0.072 0.1 0.427 0.9];
str = 'DMD';
annotation('textbox',dim,'String',str, 'FontWeight','bold')

dim = [0.501 0.1 0.427 0.9];
str = 'Constrained DMD';
annotation('textbox',dim,'String',str, 'FontWeight','bold')


%% DMD Orig Plots and Constrained DMD Plots
for s=1:2
    if s==1
        DMDPlot = DMDOrig;
        tileNumber = 1;
        I = DMDOrig.filtering;
    else
        DMDPlot = DMDCons;
        tileNumber = 4;
        I = DMDCons.filtering;
    end
    
    tmp = 0;
    tmp_sum = 0;
    
    for l = 1:length(DMDPlot.lambdaSort)
        k = I(l);

        if(imag(DMDPlot.lambdaSort(k)) < 1e-9)
            tmp_plot = real(TOOL_DiagonalAveragingMulti(DMDPlot.ThetaScaledSort(:,k) * DMDPlot.lambdaSort(k).^(0:DATA.m),DATA.delayParameter));
        else
            tmp_plot = 2*real(TOOL_DiagonalAveragingMulti(DMDPlot.ThetaScaledSort(:,k) * DMDPlot.lambdaSort(k).^(0:DATA.m),DATA.delayParameter));
        end

        axisLimits = {[-500, 4000], [-500 4000], [60, 90], 140, 140, 1.40};
        axisSteps = {[1000, 2000, 3000], [1000, 2000, 3000], [60, 70, 80, 90], [-100,100],[-100,100],[-1,1]};

        nexttile(tileNumber) 
        p1=plot(1:length(tmp_plot),tmp_plot(3,:));
        set(p1(1),'LineWidth',1,'Color',col(2,:)); 
        
        if l==1
            setupPlotsI = 1;
            title( sprintf('trend'), 'FontWeight','normal', 'FontSize',10)
        
        else
            setupPlotsI = 4;
            title( sprintf('period: %.3f, magnitude: %.3f' , 2*pi*1j/log(DMDPlot.lambdaSort(k)) , abs(DMDPlot.lambdaSort(k))), 'FontWeight','normal', 'FontSize',10)
        
        end
        
        setupPlotsI = setupPlotsI;
        ref = tmp_plot(3,:);
        setupPlots

        nexttile(tileNumber+1)
        
        p1=plot(1:length(tmp_plot),tmp_plot(2,:));
        set(p1(1),'LineWidth',1,'Color',col(4,:)); 
        setupPlotsI = setupPlotsI+1;
        ref = tmp_plot(2,:);
        setupPlots

        nexttile(tileNumber+2)
        p1=plot(1:length(tmp_plot),tmp_plot(1,:));
        set(p1(1),'LineWidth',1,'Color',col(5,:)); 
        setupPlotsI = setupPlotsI+1;
        ref = tmp_plot(1,:);
        setupPlots

        tmp = tmp + 1;
        tmp_sum = tmp_sum + tmp_plot;

        tileNumber = tileNumber + 6;
        if(tmp == 6)
            break
        end
            
    end

    nexttile(tileNumber, [2 3])

    title( sprintf('superposition -- mean absolute error: %.2f, %.2f, %.2f' , ...
        norm(abs(DATA.timeSeries(3,:)-tmp_sum(3,:)),1)/length(DATA.timeSeries), ...
        norm(abs(DATA.timeSeries(2,:)-tmp_sum(2,:)),1)/length(DATA.timeSeries), ...
        norm(abs(DATA.timeSeries(1,:)-tmp_sum(1,:)),1)/length(DATA.timeSeries)), ...
        'FontWeight','normal', 'FontSize',10)

    
    hold on
    p2=plot(1:length(DATA.timeSeries),DATA.timeSeries(2,:),1:length(tmp_sum),tmp_sum(2,:), ...
        1:length(DATA.timeSeries),DATA.timeSeries(3,:),1:length(tmp_sum),tmp_sum(3,:));
    set(p2(1),'LineWidth',1,'LineStyle', '-','LineStyle', '-','Color',col(11,:)); 
    set(p2(2),'LineWidth',1,'LineStyle', '-', 'LineStyle', '-','Color',col(4,:));
    set(p2(3),'LineWidth',1,'LineStyle', '-','Color',col(9,:)); 
    set(p2(4),'LineWidth',1,'LineStyle', '-','Color',col(2,:)); 
    ph0 = plot(1:length(DATA.timeSeries), 0*ones(length(DATA.timeSeries),1));
    set(ph0(:),'LineWidth',1, 'LineStyle', ':','Color',[0 0 0]); 

    yyaxis right
    p1=plot(1:length(DATA.timeSeries),DATA.timeSeries(1,:),1:length(tmp_sum),tmp_sum(1,:));
    ph = plot(1:length(DATA.timeSeries), ones(length(DATA.timeSeries),2).*[70 80]);
    
    set(ph(:),'LineWidth',1, 'LineStyle', ':','Color',col(12,:)); 

    set(p1(1),'LineWidth',1,'LineStyle', '-', 'Color',col(12,:)); 
    set(p1(2),'LineWidth',1,'LineStyle', '-','Color',col(5,:)); 
    hold off
    axis([-inf, inf, 60, 90])

    set(gca,'xtick',[])
    set(gca,'xticklabel',[])

    set(gca,'ytick',[70,80])
    set(gca,'yticklabel',[70 80])
    set(gca,'YColor',col(12,:))
    
    yyaxis left
    axis([-inf, inf, -500, 4000])
    set(gca,'ytick',[0,1000,2000,3000])
    set(gca,'yticklabel',[0 1000 2000 3000])
    box on
    pbaspect([5 1 1])

end

% Export into figures folder
% exportgraphics(f,'../figures/Fig10.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