<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Operating on a list of values with units</title>
    <link>http://www.mapleprimes.com/questions/130360-Operating-On-A-List-Of-Values-With-Units</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 05:45:20 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 05:45:20 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Operating on a list of values with units</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Operating on a list of values with units</title>
      <link>http://www.mapleprimes.com/questions/130360-Operating-On-A-List-Of-Values-With-Units</link>
    </image>
    <item>
      <title>combine</title>
      <link>http://www.mapleprimes.com/questions/130360-Operating-On-A-List-Of-Values-With-Units?ref=Feed:MaplePrimes:Operating on a list of values with units:Comments#answer130362</link>
      <itunes:summary>&lt;p&gt;Here is one way. I'm pasting as plain text, which is why the units show below as function calls to Units:-Unit() instead of the nice 2D Math output way involving the fenced [[]] brackets.&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(ScientificConstants):

&amp;gt; L:=[seq(1/10^(-i)*Unit(nanometer),i=11..13)];

[100000000000 Units:-Unit('nm'), 1000000000000 Units:-Unit('nm'), 

  10000000000000 Units:-Unit('nm')]

&amp;gt; c := evalf(GetValue(Constant('c'))*GetUnit(Constant('c')));

                             8            /'m'\
                2.99792458 10  Units:-Unit|---|
                                          \'s'/

&amp;gt; newL := map2(`/`,c,L);

              [                          /'m'\  
              [0.002997924580 Units:-Unit|---|  
              [                          \'s'/  
              [-------------------------------, 
              [       Units:-Unit('nm')         

                                           /'m'\  
                0.0002997924580 Units:-Unit|---|  
                                           \'s'/  
                --------------------------------, 
                       Units:-Unit('nm')          

                                            /'m'\]
                0.00002997924580 Units:-Unit|---|]
                                            \'s'/]
                ---------------------------------]
                        Units:-Unit('nm')        ]

&amp;gt; newL := c /~ L;

              [                          /'m'\  
              [0.002997924580 Units:-Unit|---|  
              [                          \'s'/  
              [-------------------------------, 
              [       Units:-Unit('nm')         

                                           /'m'\  
                0.0002997924580 Units:-Unit|---|  
                                           \'s'/  
                --------------------------------, 
                       Units:-Unit('nm')          

                                            /'m'\]
                0.00002997924580 Units:-Unit|---|]
                                            \'s'/]
                ---------------------------------]
                        Units:-Unit('nm')        ]

&amp;gt; map(combine,newL,units);

[              6            / 1 \  
[2.997924580 10  Units:-Unit|---|, 
[                           \'s'/  


                5            / 1 \                         / 1 \]
  2.997924580 10  Units:-Unit|---|, 29979.24580 Units:-Unit|---|]
                             \'s'/                         \'s'/]

&lt;/pre&gt;
&lt;p&gt;Another way could be to rely on the automatic combining of units when the Units:-Standard package is loaded. (I use `map` slightly differently here. Due to the manner of the programming of Units:-Standard:-`/` as a unary procedure, it is a little awkward to `map` it.)&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(ScientificConstants):
&amp;gt; with(Units:-Standard):

&amp;gt; L:=[seq(1/10^(-i)*Unit(nanometer),i=11..13)];

[100000000000 Units:-Unit('nm'), 1000000000000 Units:-Unit('nm'), 

  10000000000000 Units:-Unit('nm')]

&amp;gt; c := evalf(GetValue(Constant('c'))*GetUnit(Constant('c')));

                             8            /'m'\
                2.99792458 10  Units:-Unit|---|
                                          \'s'/

&amp;gt; newL := map(t-&amp;gt;c/t,L);

[              6            / 1 \  
[2.997924580 10  Units:-Unit|---|, 
[                           \'s'/  

                5            / 1 \                         / 1 \]
  2.997924580 10  Units:-Unit|---|, 29979.24580 Units:-Unit|---|]
                             \'s'/                         \'s'/]
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Here is one way. I'm pasting as plain text, which is why the units show below as function calls to Units:-Unit() instead of the nice 2D Math output way involving the fenced [[]] brackets.&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(ScientificConstants):

&amp;gt; L:=[seq(1/10^(-i)*Unit(nanometer),i=11..13)];

[100000000000 Units:-Unit('nm'), 1000000000000 Units:-Unit('nm'), 

  10000000000000 Units:-Unit('nm')]

&amp;gt; c := evalf(GetValue(Constant('c'))*GetUnit(Constant('c')));

                             8            /'m'\
                2.99792458 10  Units:-Unit|---|
                                          \'s'/

&amp;gt; newL := map2(`/`,c,L);

              [                          /'m'\  
              [0.002997924580 Units:-Unit|---|  
              [                          \'s'/  
              [-------------------------------, 
              [       Units:-Unit('nm')         

                                           /'m'\  
                0.0002997924580 Units:-Unit|---|  
                                           \'s'/  
                --------------------------------, 
                       Units:-Unit('nm')          

                                            /'m'\]
                0.00002997924580 Units:-Unit|---|]
                                            \'s'/]
                ---------------------------------]
                        Units:-Unit('nm')        ]

&amp;gt; newL := c /~ L;

              [                          /'m'\  
              [0.002997924580 Units:-Unit|---|  
              [                          \'s'/  
              [-------------------------------, 
              [       Units:-Unit('nm')         

                                           /'m'\  
                0.0002997924580 Units:-Unit|---|  
                                           \'s'/  
                --------------------------------, 
                       Units:-Unit('nm')          

                                            /'m'\]
                0.00002997924580 Units:-Unit|---|]
                                            \'s'/]
                ---------------------------------]
                        Units:-Unit('nm')        ]

&amp;gt; map(combine,newL,units);

[              6            / 1 \  
[2.997924580 10  Units:-Unit|---|, 
[                           \'s'/  


                5            / 1 \                         / 1 \]
  2.997924580 10  Units:-Unit|---|, 29979.24580 Units:-Unit|---|]
                             \'s'/                         \'s'/]

&lt;/pre&gt;
&lt;p&gt;Another way could be to rely on the automatic combining of units when the Units:-Standard package is loaded. (I use `map` slightly differently here. Due to the manner of the programming of Units:-Standard:-`/` as a unary procedure, it is a little awkward to `map` it.)&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(ScientificConstants):
&amp;gt; with(Units:-Standard):

&amp;gt; L:=[seq(1/10^(-i)*Unit(nanometer),i=11..13)];

[100000000000 Units:-Unit('nm'), 1000000000000 Units:-Unit('nm'), 

  10000000000000 Units:-Unit('nm')]

&amp;gt; c := evalf(GetValue(Constant('c'))*GetUnit(Constant('c')));

                             8            /'m'\
                2.99792458 10  Units:-Unit|---|
                                          \'s'/

&amp;gt; newL := map(t-&amp;gt;c/t,L);

[              6            / 1 \  
[2.997924580 10  Units:-Unit|---|, 
[                           \'s'/  

                5            / 1 \                         / 1 \]
  2.997924580 10  Units:-Unit|---|, 29979.24580 Units:-Unit|---|]
                             \'s'/                         \'s'/]
&lt;/pre&gt;</description>
      <guid>130362</guid>
      <pubDate>Mon, 06 Feb 2012 08:13:15 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
  </channel>
</rss>