SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

2D GRID

Name:
    2D GRID (LET)
    3D GRID (LET)
    4D GRID (LET)
Type:
    Let Subcommand
Purpose:
    Given a sequence of values for two to four variables, create a gridded set of values.
Description:
    It is sometimes useful to create a set of gridded values. For example, you may want to evaulate a function over this grid.

    For example, given X1 = 0, 0.5, 1.0 and X2 = 0, 0.2, 0.4 0.6, 0.8, 1.0, the gridded output (saved in Y1 and Y2) would be

      Y1 Y2
      0.0 0.0
      0.0 0.2
      0.0 0.4
      0.0 0.6
      0.0 0.8
      0.0 1.0
      0.5 0.0
      0.5 0.2
      0.5 0.4
      0.5 0.6
      0.5 0.8
      0.5 1.0
      1.0 0.0
      1.0 0.2
      1.0 0.4
      1.0 0.6
      1.0 0.8
      1.0 1.0

    This basic logic can be extended to the case of three or four input variables.

    Although the gridded values can also be generated with a set of SEQUENCE commands, these commands are provided as a convenience.

Syntax 1:
    LET <y1> <y2> = 2D GRID <x1> <x2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <x1> is a variable containing the values for the first variable to be gridded;
                <x2> is a variable containing the values for the second variable to be gridded;
                <y1> is a variable where the gridded values for the first variable are saved;
                <y2> is a variable where the gridded values for the second variable are saved;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
    LET <y1> <y2> <y3> = 3D GRID <x1> <x2> <x3>
                            <SUBSET/EXCEPT/FOR qualification>
    where <x1> is a variable containing the values for the first variable to be gridded;
                <x2> is a variable containing the values for the second variable to be gridded;
                <x3> is a variable containing the values for the third variable to be gridded;
                <y1> is a variable where the gridded values for the first variable are saved;
                <y2> is a variable where the gridded values for the second variable are saved;
                <y3> is a variable where the gridded values for the third variable are saved;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 3:
    LET <y1> <y2> <y3> <y4> = 4D GRID <x1> <x2> <x3> <x4>
                            <SUBSET/EXCEPT/FOR qualification>
    where <x1> is a variable containing the values for the first variable to be gridded;
                <x2> is a variable containing the values for the second variable to be gridded;
                <x3> is a variable containing the values for the third variable to be gridded;
                <x4> is a variable containing the values for the fourth variable to be gridded;
                <y1> is a variable where the gridded values for the first variable are saved;
                <y2> is a variable where the gridded values for the second variable are saved;
                <y3> is a variable where the gridded values for the third variable are saved;
                <y4> is a variable where the gridded values for the fourth variable are saved;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET Y1 Y2 = 2D GRID X1 X2
    LET Y1 Y2 Y3 = 3D GRID X1 X2 X3
Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Data Transformations
Implementation Date:
    2019/08
Program 1:
     
    . Step 1:   Define input values
    .
    let x1 = sequence 0 0.1 10
    let x2 = sequence 0 0.1 10
    .
    . Step 2:   Generate the gridded sequence
    .
    let y1 y2 = 2d grid x1 x2
    set write decimals 1
    print y1 y2
        
    ------------------------------
                 Y1             Y2
    ------------------------------
                0.0            0.0
                0.0            0.1
                0.0            0.2
                0.0            0.3
                0.0            0.4
                0.0            0.5
                0.0            0.6
                0.0            0.7
                0.0            0.8
                0.0            0.9
                0.0            1.0
                0.1            0.0
                0.1            0.1
                0.1            0.2
                0.1            0.3
                0.1            0.4
                0.1            0.5
                0.1            0.6
                0.1            0.7
                0.1            0.8
                0.1            0.9
                0.1            1.0
                0.2            0.0
                0.2            0.1
                0.2            0.2
                0.2            0.3
                0.2            0.4
                0.2            0.5
                0.2            0.6
                0.2            0.7
                0.2            0.8
                0.2            0.9
                0.2            1.0
                0.3            0.0
                0.3            0.1
                0.3            0.2
                0.3            0.3
                0.3            0.4
                0.3            0.5
                0.3            0.6
                0.3            0.7
                0.3            0.8
                0.3            0.9
                0.3            1.0
                0.4            0.0
                0.4            0.1
                0.4            0.2
                0.4            0.3
                0.4            0.4
                0.4            0.5
                0.4            0.6
                0.4            0.7
                0.4            0.8
                0.4            0.9
                0.4            1.0
                0.5            0.0
                0.5            0.1
                0.5            0.2
                0.5            0.3
                0.5            0.4
                0.5            0.5
                0.5            0.6
                0.5            0.7
                0.5            0.8
                0.5            0.9
                0.5            1.0
                0.6            0.0
                0.6            0.1
                0.6            0.2
                0.6            0.3
                0.6            0.4
                0.6            0.5
                0.6            0.6
                0.6            0.7
                0.6            0.8
                0.6            0.9
                0.6            1.0
                0.7            0.0
                0.7            0.1
                0.7            0.2
                0.7            0.3
                0.7            0.4
                0.7            0.5
                0.7            0.6
                0.7            0.7
                0.7            0.8
                0.7            0.9
                0.7            1.0
                0.8            0.0
                0.8            0.1
                0.8            0.2
                0.8            0.3
                0.8            0.4
                0.8            0.5
                0.8            0.6
                0.8            0.7
                0.8            0.8
                0.8            0.9
                0.8            1.0
                0.9            0.0
                0.9            0.1
                0.9            0.2
                0.9            0.3
                0.9            0.4
                0.9            0.5
                0.9            0.6
                0.9            0.7
                0.9            0.8
                0.9            0.9
                0.9            1.0
                1.0            0.0
                1.0            0.1
                1.0            0.2
                1.0            0.3
                1.0            0.4
                1.0            0.5
                1.0            0.6
                1.0            0.7
                1.0            0.8
                1.0            0.9
                1.0            1.0
     
        
Program 2:
    . Step 1:   Define input values
    .
    let x1 = sequence 0 0.1 10
    let x2 = sequence 0 0.1 10
    let x3 = sequence 0 0.1 10
    .
    . Step 2:   Test the command
    .
    let y1 y2 y3 = 3d grid x1 x2 x3
    set write decimals 1
    print y1 y2 y3 for i = 1 1 40
        
    ---------------------------------------------
                 Y1             Y2             Y3
    ---------------------------------------------
                0.0            0.0            0.0
                0.0            0.0            0.1
                0.0            0.0            0.2
                0.0            0.0            0.3
                0.0            0.0            0.4
                0.0            0.0            0.5
                0.0            0.0            0.6
                0.0            0.0            0.7
                0.0            0.0            0.8
                0.0            0.0            0.9
                0.0            0.0            1.0
                0.0            0.1            0.0
                0.0            0.1            0.1
                0.0            0.1            0.2
                0.0            0.1            0.3
                0.0            0.1            0.4
                0.0            0.1            0.5
                0.0            0.1            0.6
                0.0            0.1            0.7
                0.0            0.1            0.8
                0.0            0.1            0.9
                0.0            0.1            1.0
                0.0            0.2            0.0
                0.0            0.2            0.1
                0.0            0.2            0.2
                0.0            0.2            0.3
                0.0            0.2            0.4
                0.0            0.2            0.5
                0.0            0.2            0.6
                0.0            0.2            0.7
                0.0            0.2            0.8
                0.0            0.2            0.9
                0.0            0.2            1.0
                0.0            0.3            0.0
                0.0            0.3            0.1
                0.0            0.3            0.2
                0.0            0.3            0.3
                0.0            0.3            0.4
                0.0            0.3            0.5
                0.0            0.3            0.6
                0.0            0.3            0.7
                0.0            0.3            0.8
                0.0            0.3            0.9
                0.0            0.3            1.0
                0.0            0.4            0.0
                0.0            0.4            0.1
                0.0            0.4            0.2
                0.0            0.4            0.3
                0.0            0.4            0.4
                0.0            0.4            0.5
                0.0            0.4            0.6
                0.0            0.4            0.7
                0.0            0.4            0.8
                0.0            0.4            0.9
                0.0            0.4            1.0
                0.0            0.5            0.0
                0.0            0.5            0.1
                0.0            0.5            0.2
                0.0            0.5            0.3
                0.0            0.5            0.4
                0.0            0.5            0.5
                0.0            0.5            0.6
                0.0            0.5            0.7
                0.0            0.5            0.8
                0.0            0.5            0.9
                0.0            0.5            1.0
                0.0            0.6            0.0
                0.0            0.6            0.1
                0.0            0.6            0.2
                0.0            0.6            0.3
                0.0            0.6            0.4
                0.0            0.6            0.5
                0.0            0.6            0.6
                0.0            0.6            0.7
                0.0            0.6            0.8
                0.0            0.6            0.9
                0.0            0.6            1.0
                0.0            0.7            0.0
                0.0            0.7            0.1
                0.0            0.7            0.2
                0.0            0.7            0.3
                0.0            0.7            0.4
                0.0            0.7            0.5
                0.0            0.7            0.6
                0.0            0.7            0.7
                0.0            0.7            0.8
                0.0            0.7            0.9
                0.0            0.7            1.0
                0.0            0.8            0.0
                0.0            0.8            0.1
                0.0            0.8            0.2
                0.0            0.8            0.3
                0.0            0.8            0.4
                0.0            0.8            0.5
                0.0            0.8            0.6
                0.0            0.8            0.7
                0.0            0.8            0.8
                0.0            0.8            0.9
                0.0            0.8            1.0
                0.0            0.9            0.0
     
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 08/30/2019
Last updated: 08/30/2019

Please email comments on this WWW page to alan.heckert@nist.gov.