[graphics] Demos: add a 'Technical plots' section 20/20720/2
Samuel GOUGEON [Mon, 21 Jan 2019 09:45:34 +0000 (10:45 +0100)]
Change-Id: Ie7e883fc9050a71c5dbd16fe883b74be70462450

13 files changed:
scilab/modules/graphics/demos/2d_3d_plots/2d_3d_plots.dem.gateway.sce
scilab/modules/graphics/demos/graphics.dem.gateway.sce
scilab/modules/graphics/demos/technical/black.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/bode.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/gainplot.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/hallchart.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/nicholschart.dem.sce [moved from scilab/modules/graphics/demos/2d_3d_plots/abaque.dem.sce with 79% similarity]
scilab/modules/graphics/demos/technical/nyquist.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/phaseplot.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/sgrid.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/svplot.dem.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/technical.dem.gateway.sce [new file with mode: 0644]
scilab/modules/graphics/demos/technical/zgrid.dem.sce [moved from scilab/modules/graphics/demos/2d_3d_plots/zgrid.dem.sce with 97% similarity]

index e09b558..a711539 100644 (file)
@@ -25,9 +25,7 @@ subdemolist = [                                   ..
 "fgrayplot"      , "fgrayplot.dem.sce"       ; ..
 "polarplot"      , "polarplot.dem.sce"       ; ..
 "errbar"         , "errbar.dem.sce"          ; ..
-"abaque"         , "abaque.dem.sce"          ; ..
-"zgrid"          , "zgrid.dem.sce"           ; ..
-"geom3d"          , "geom3d.dem.sce"           ; ..
+"geom3d"          , "geom3d.dem.sce"         ; ..
 "contour (3d) 2" , "contour_3d_2.dem.sce"    ; ..
 "contour (3d) 3" , "contour_3d_3.dem.sce"    ; ..
 "contour (3d) 4" , "contour_3d_4.dem.sce"    ; ..
@@ -35,4 +33,4 @@ subdemolist = [                                   ..
 "fac3d"          , "fac3d.dem.sce"           ];
 
 subdemolist(:,2) = demopath + subdemolist(:,2);
-clear demopath;
\ No newline at end of file
+clear demopath;
index 508eb74..0c0acc5 100644 (file)
@@ -12,20 +12,22 @@ function subdemolist = demo_gateway()
     _("Graphics");  // lets gettext() harvesting it
     add_demo("Graphics", demopath+"graphics.dem.gateway.sce");
 
-    subdemolist = [_("2D and 3D plots")             ,"2d_3d_plots/2d_3d_plots.dem.gateway.sce"             ; ..
-    _("Basic functions")             ,"basic_functions/basic_functions.dem.gateway.sce"     ; ..
-    _("Animation")                   ,"anim/anim.dem.gateway.sce"                           ; ..
-    _("Finite Elements")             ,"fec/fec.dem.gateway.sce"                             ; ..
-    _("Stems bars histograms")        ,"hist_bar_stem/histBarStem.dem.gateway.sce"           ; ..
-    _("Bezier curves and surfaces")  ,"bezier/bezier.dem.gateway.sce"                       ; ..
-    _("More surfaces")               ,"surface/surfaces.dem.gateway.sce"                    ; ..
-    _("Complex elementary functions"),"cmplxfunc/cmplxfunc.dem.gateway.sce"                 ; ..
-    _("Datatips")                    ,"datatips/datatips.dem.gateway.sce"                   ; ..
-    _("LaTeX/MathML")                ,"textrendering/textrendering.dem.gateway.sce"         ; ..
-    _("Lighting")                    ,"lighting/lighting.dem.gateway.sce"                   ; ..
-    _("Colormap")                    ,"colormap/colormaps.dem.sce"                           ; ..
-    _("Matplot")                     ,"matplot/matplot.dem.gateway.sce"];
-
+    subdemolist = [
+    _("2D and 3D plots")             , "2d_3d_plots/2d_3d_plots.dem.gateway.sce"
+    _("Basic functions")             , "basic_functions/basic_functions.dem.gateway.sce"
+    _("Animation")                   , "anim/anim.dem.gateway.sce"
+    _("Finite Elements")             , "fec/fec.dem.gateway.sce"
+    _("Stems bars histograms")       , "hist_bar_stem/histBarStem.dem.gateway.sce"
+    _("Bezier curves and surfaces")  , "bezier/bezier.dem.gateway.sce"
+    _("More surfaces")               , "surface/surfaces.dem.gateway.sce"
+    _("Complex elementary functions"), "cmplxfunc/cmplxfunc.dem.gateway.sce"
+    _("Technical plots")             , "technical/technical.dem.gateway.sce"
+    _("Datatips")                    , "datatips/datatips.dem.gateway.sce"
+    _("LaTeX/MathML")                , "textrendering/textrendering.dem.gateway.sce"
+    _("Lighting")                    , "lighting/lighting.dem.gateway.sce"
+    _("Colormap")                    , "colormap/colormaps.dem.sce"
+    _("Matplot")                     , "matplot/matplot.dem.gateway.sce"
+    ];
     subdemolist(:,2) = demopath + subdemolist(:,2);
 endfunction
 
diff --git a/scilab/modules/graphics/demos/technical/black.dem.sce b/scilab/modules/graphics/demos/technical/black.dem.sce
new file mode 100644 (file)
index 0000000..2d8c90b
--- /dev/null
@@ -0,0 +1,36 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_black()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("black.dem.sce");
+    my_plot_desc = "black";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    //Black diagram
+    s = poly(0,'s');
+    sl = syslin('c',5*(1+s)/(.1*s.^4+s.^3+15*s.^2+3*s+1))
+
+    subplot(1,2,1)
+    black(sl, 0.01, 10);
+
+    subplot(1,2,2)
+    //Black diagram with Nichols chart as a grid
+    Plant = syslin('c',16000/((s+1)*(s+10)*(s+100)));
+    //two degree of freedom PID
+    tau = 0.2;xsi=1.2;
+    PID = syslin('c',(1/(2*xsi*tau*s))*(1+2*xsi*tau*s+tau.^2*s.^2));
+    black([Plant;Plant*PID ],0.01,100,["Plant";"Plant and PID corrector"]);
+
+    //move the caption in the lower right corner
+    gca().children(1).legend_location = "in_lower_right";
+    nicholschart(colors=color('light gray')*[1 1])
+    // DEMO END
+endfunction
+
+demo_black();
+clear demo_black;
diff --git a/scilab/modules/graphics/demos/technical/bode.dem.sce b/scilab/modules/graphics/demos/technical/bode.dem.sce
new file mode 100644 (file)
index 0000000..5f114de
--- /dev/null
@@ -0,0 +1,20 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_bode()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("bode.dem.sce");
+    my_plot_desc = "bode";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    bode();
+    xtitle(my_plot_desc," "," "," ");
+    // DEMO END
+endfunction
+
+demo_bode();
+clear demo_bode;
diff --git a/scilab/modules/graphics/demos/technical/gainplot.dem.sce b/scilab/modules/graphics/demos/technical/gainplot.dem.sce
new file mode 100644 (file)
index 0000000..81289d8
--- /dev/null
@@ -0,0 +1,19 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_gainplot()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("gainplot.dem.sce");
+    my_plot_desc = "gainplot";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    gainplot()
+    // DEMO END
+endfunction
+
+demo_gainplot();
+clear demo_gainplot;
diff --git a/scilab/modules/graphics/demos/technical/hallchart.dem.sce b/scilab/modules/graphics/demos/technical/hallchart.dem.sce
new file mode 100644 (file)
index 0000000..43e8f73
--- /dev/null
@@ -0,0 +1,20 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_hallchart()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("hallchart.dem.sce");
+    my_plot_desc = "hallchart";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    hallchart();
+    xtitle(my_plot_desc," "," "," ");
+    // DEMO END
+endfunction
+
+demo_hallchart();
+clear demo_hallchart;
@@ -4,23 +4,22 @@
 //
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
-function demo_abaque()
+function demo_nicholschart()
 
     my_handle             = scf(100001);
     clf(my_handle,"reset");
     // DEMO START
-    my_plot_desc          = "chart";
+    my_plot_desc          = "nicholschart";
     if is_handle_valid(my_handle) then
         my_handle.figure_name = my_plot_desc;
         nicholschart();
         xtitle(my_plot_desc," "," "," ");
     end
-    demo_viewCode("abaque.dem.sce");
+    demo_viewCode("nicholschart.dem.sce");
     // DEMO END
 
 endfunction
 
-
-demo_abaque();
+demo_nicholschart();
 clear demo_abaque;
 
diff --git a/scilab/modules/graphics/demos/technical/nyquist.dem.sce b/scilab/modules/graphics/demos/technical/nyquist.dem.sce
new file mode 100644 (file)
index 0000000..7157b9a
--- /dev/null
@@ -0,0 +1,20 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_nyquist()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("nyquist.dem.sce");
+    my_plot_desc = "nyquist";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    nyquist();
+    xtitle(my_plot_desc," "," "," ");
+    // DEMO END
+endfunction
+
+demo_nyquist();
+clear demo_nyquist;
diff --git a/scilab/modules/graphics/demos/technical/phaseplot.dem.sce b/scilab/modules/graphics/demos/technical/phaseplot.dem.sce
new file mode 100644 (file)
index 0000000..b335061
--- /dev/null
@@ -0,0 +1,25 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_phaseplot()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("phaseplot.dem.sce");
+    my_plot_desc = "phaseplot";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    s = poly(0,'s')
+    h1 = syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
+    h2 = syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
+    phaseplot([h1;h2],0.01,100,..
+              ["$\frac{s^2+18 s+100}{s^2+6.06 s+102.1}$";
+               "$\frac{s^2+3.02 s+228.01}{s^2+27 s+225}$"])
+    title('Phaseplot')
+    // DEMO END
+endfunction
+
+demo_phaseplot();
+clear demo_phaseplot;
diff --git a/scilab/modules/graphics/demos/technical/sgrid.dem.sce b/scilab/modules/graphics/demos/technical/sgrid.dem.sce
new file mode 100644 (file)
index 0000000..ea0aed6
--- /dev/null
@@ -0,0 +1,20 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_sgrid()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("sgrid.dem.sce");
+    my_plot_desc = "sgrid";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    sgrid();
+    xtitle(my_plot_desc," "," "," ");
+    // DEMO END
+endfunction
+
+demo_sgrid();
+clear demo_sgrid;
diff --git a/scilab/modules/graphics/demos/technical/svplot.dem.sce b/scilab/modules/graphics/demos/technical/svplot.dem.sce
new file mode 100644 (file)
index 0000000..c3b7adb
--- /dev/null
@@ -0,0 +1,24 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_svplot()
+    my_handle = scf(100001);
+    clf(my_handle,"reset");
+    demo_viewCode("svplot.dem.sce");
+    my_plot_desc = "svplot";
+    my_handle.figure_name = my_plot_desc;
+
+    // DEMO START
+    x = logspace(-3,3);
+    y = svplot(ssrand(2,2,4),x);
+    clf()
+    plot2d("ln", x, 20*log(y')/log(10))
+    xgrid(12)
+    xtitle("Singular values plot","(rad/sec)", "dB");
+    // DEMO END
+endfunction
+
+demo_svplot();
+clear demo_svplot;
diff --git a/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce b/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce
new file mode 100644 (file)
index 0000000..764d409
--- /dev/null
@@ -0,0 +1,22 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+demopath = get_absolute_file_path("technical.dem.gateway.sce");
+
+subdemolist = [
+"Bode"               , "bode.dem.sce"
+"Phase plot"         , "phaseplot.dem.sce"
+"Gain plot"          , "gainplot.dem.sce"
+"Nyquist"            , "nyquist.dem.sce"
+"SV plot"            , "svplot.dem.sce"
+"Hall chart"         , "hallchart.dem.sce"
+"Nichols chart"      , "nicholschart.dem.sce"
+"Black-Nichols"      , "black.dem.sce"
+"s-grid"             , "sgrid.dem.sce"
+"z-grid"             , "zgrid.dem.sce"
+];
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
+clear demopath;
@@ -17,6 +17,7 @@ function demo_zgrid()
     my_handle.figure_name = my_plot_desc;
 
     zgrid();
+    isoview
     xtitle(my_plot_desc," "," "," ");
     // DEMO END