PLIST built-in models


The handling of built-in plist models is different from the other classes built-in models. To see a list of available models, use

  >> plist.getBuiltInModels

The built-in plist models contain lists of parameters, that are usually needed to have centralized source. They are typically employed to group together reference values, and can hold a lot of useful informations. In order to build them, you need a configuration plist. But they are plist objects ... so the syntax is:

    pl = plist(plist('built-in', 'physical_constants'))
----------- plist 01 -----------
n params: 34
---- param 1 ----
key:    C
val:    299792458
desc:   Speed of light in vacuum
origin: default
props: units='m s^-1', error=[], subsystem='universal', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------
---- param 2 ----
key:    G
val:    6.6742867000000001e-11
desc:   Newtonian constant of gravitation
origin: default
props: units='m^3 kg^-1 s^-2', error=0.0001, subsystem='universal', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------
---- param 3 ----
key:    H
val:    6.6260689633000002e-34
desc:   Planck constant
origin: default
props: units='J s', error=4.9999999999999998e-08, subsystem='universal', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------
---- param 4 ----
key:    PLANCK_CONST
val:    6.6260689633000002e-34
desc:   Planck constant
origin: default
props: units='J s', error=4.9999999999999998e-08, subsystem='universal', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------
---- param 5 ----
key:    RED_PLANCK_CONST
val:    1.0545716287769856e-34
desc:   Reduced Planck constant (h/(2*pi))
origin: default
props: units='J s', error=4.9999999999999998e-08, subsystem='universal', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------
---- param 6 ----
key:    MAGNETIC_CONST
val:    1.2566370614359173e-06
desc:   Magnetic constant
origin: default
props: units='N A^-2', error=[], subsystem='electromagnetic', reference='http://en.wikipedia.org/wiki/Physical_constants'
-----------------

Now, in order to search for a given value, you can use the find method of the plist class. Let's assume you wish to access the value of the speed of light in vacuum, usually known as 'c':

    c = pl.find('c')
ans =
   299792458
    

As you can see, the numeric value of the desired constant is returned. Now, LTPDA provides a better way to know which are the values (parameters) contained in such a built-in plist. In order to access these information, just remember that all plist model files are called plist_model_<model_name> and then type

    help plist_model_physical_constants
    plist_model_physical_constants constructs a PLIST with physical constants.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  DESCRIPTION: plist_model_physical_constants constructs a PLIST with
               physical constants.
 
  CALL:
            pl = plist(plist('built-in', 'physical_constants'));
 
  INPUTS:
            additional parameters (see below)
 
  OUTPUTS:
            pl - an PLIST object representing the physical constants
 
  INFO:
    Model Information
 
  MODEL CONTENT:
    Model Content
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    

The 'Model Content' link is very useful since it will open a help browser html page like the following:

Built-in plist model content

In this way you can know the content of the model, in particular the name of the parameters.


A very powerful usage of these parameters list built-in model is in conjunction with the ao constructor:

c = ao(plist('parameter', 'physical_constants', 'key', 'c'))
----------- ao 01: C -----------
 
       name: C
       data: 299792458
             -------- cdata [vals] ------------
                  y:  [1x1], double
                 dy:  [0x0], double
             yunits:  [m s^(-1)]
             ----------------------------------
              
       hist: ao / ao / fece767e70dde615b6543df76c3ecd63c958633d
description: Speed of light in vacuum
       UUID: 657c1a8c-499f-41d7-bbe5-d3577c9cb570
--------------------------------

For creating your own plist models, follow similar rules as in the ao case. A good example to follow is

  >> edit plist_model_physical_constants



©LTP Team