Changeset 537

Show
Ignore:
Timestamp:
08/16/07 13:30:55 (16 months ago)
Author:
otter
Message:

Replaced <h3> by <h4> and removed <font> from <h3>
(<h3> is used by automatically generated structuring units,
such as "Information", "Parameters", "Connectors" and therefore
it shoud not be used in a model. The "font" should be set by
"css style files" and not inside the model
(is now supported in Dymola for generated html and pdf, but
not yet in the info-layer in Dymola).

Location:
Modelica/trunk/Modelica
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Electrical/Digital.mo

    r535 r537  
    44     
    55  annotation (DocumentationClass=true, Documentation(info="<html> 
    6 <h3><font color=\"#008000\" size=5>Users Guide of package Electrical.Digital</font></h3> 
     6<h4>Users Guide of package Electrical.Digital</h4> 
    77<p> 
    88Library <b>Electrical.Digital</b> is a <b>free</b> Modelica package providing 
     
    3434       
    3535    annotation (Documentation(info="<html> 
    36 <h3><font color=\"#008000\" size=5>Overview of Library Electrical.Digital</font></h3> 
     36<h4>Overview of Library Electrical.Digital</h4> 
    3737<p> 
    3838In this section, an overview of the most important features 
     
    4747       
    4848    annotation (Documentation(info="<html> 
    49 <h3><font color=\"#008000\" size=5>A first example</font></h3> 
     49<h4>A first example</h4> 
    5050<p> 
    5151A first example will be given here (not yet done). 
     
    5858       
    5959    annotation (Documentation(info="<html> 
    60 <h3><font color=\"#008000\" size=5>An application example</font></h3> 
     60<h4>An application example</h4> 
    6161<p> 
    6262An application example will be given here (not yet done). 
     
    6969       
    7070    annotation (Documentation(info="<html> 
    71 <h3><font color=\"#008000\" size=5>Release notes</font></h3> 
    72 <h3><font color=\"#008000\">Version 1.0.7, 2005-07-01</font></h3> 
     71<h4>Release notes</h4> 
     72<h4>Version 1.0.7, 2005-07-01</h4> 
    7373<ul> 
    7474<li> xxxx</li> 
    7575</ul> 
    76 <h3><font color=\"#008000\">Version 1.0.6, 2004-10-18</font></h3> 
     76<h4>Version 1.0.6, 2004-10-18</h4> 
    7777<ul> 
    7878<li> Missing HTML tags added (problems with mismatched pre tags fixed).</li> 
    7979<li> CVS ID string deleted.</li> 
    8080</ul> 
    81 <h3><font color=\"#008000\">Version 1.0.5, 2004-10-01</font></h3> 
     81<h4>Version 1.0.5, 2004-10-01</h4> 
    8282<ul> 
    8383<li> Wrong identifiers x0 and Tdel in HalfAdder example fixed.</li> 
     
    8585<li> Known issue: Pulse source causes a warning in Dymola. It is recommended to use Clock source.</li> 
    8686</ul> 
    87 <h3><font color=\"#008000\">Version 1.0.4, 2004-09-30</font></h3> 
     87<h4>Version 1.0.4, 2004-09-30</h4> 
    8888<ul> 
    8989<li> Documentation improved.</li> 
    9090</ul> 
    91 <h3><font color=\"#008000\">Version 1.0.3, 2004-09-21</font></h3> 
     91<h4>Version 1.0.3, 2004-09-21</h4> 
    9292<ul> 
    9393<li> Table names changed from \"map\" to \"Table\".</li> 
     
    102102<li> Simple Clock source added in addition to Pulse source (for convenience reasons).</li> 
    103103</ul> 
    104 <h3><font color=\"#008000\">Version 1.0.2, 2004-09-13</font></h3> 
     104<h4>Version 1.0.2, 2004-09-13</h4> 
    105105<ul> 
    106106<li> First prerelease for discussions at the 40th Modelica Design Meeting.</li> 
    107107</ul> 
    108 <h3><font color=\"#008000\">Version 1.0.1, 2004-06-01</font></h3> 
     108<h4>Version 1.0.1, 2004-06-01</h4> 
    109109<ul> 
    110110<li> Packages Tables, Basic, and Gates implemented.</li> 
    111111<li> Transport and inertial delay implemented and successfully tested.</li> 
    112112</ul> 
    113 <h3><font color=\"#008000\">Version 1.0.0, 2003-05-01</font></h3> 
     113<h4>Version 1.0.0, 2003-05-01</h4> 
    114114<ul> 
    115115<li> A first version has been implemented for case studies.</li> 
     
    124124       
    125125    annotation (Documentation(info="<html> 
    126 <h3><font color=\"#008000\" size=5>Literature</font></h3> 
     126<h4>Literature</h4> 
    127127<p> 
    128128The Electrical.Digital library is based on the following references: 
     
    161161       
    162162    annotation (Documentation(info="<html> 
    163 <h3><font color=\"#008000\" size=5>Contact</font></h3> 
     163<h4>Contact</h4> 
    164164<dl> 
    165165<dt><b>Main Authors:</b> 
     
    331331      annotation ( 
    332332        Documentation(info="<HTML> 
    333 <h3><font color=\"#008000\" size=5>4 to 1 Bit Multiplexer</font></h3> 
     333<h4>4 to 1 Bit Multiplexer</h4> 
    334334<P> 
    335335The multiplexer converts a parallel 4 bit signal in a sequential 
     
    445445      annotation ( 
    446446        Documentation(info="<HTML> 
    447 <h3><font color=\"#008000\" size=5>FlipFlop</font></h3> 
     447<h4>FlipFlop</h4> 
    448448<P> 
    449449Pulse-triggered master-slave flip-flop. 
  • Modelica/trunk/Modelica/Math/package.mo

    r535 r537  
    22  import SI = Modelica.SIunits; 
    33 
    4  
    54extends Modelica.Icons.Library2; 
    6  
    75 
    86annotation(preferedView="info", 
     
    2220<p> 
    2321This package contains <b>basic mathematical functions</b> (such as sin(..)), 
    24 as well as functions operating on <b>matrices</b>. 
    25 </p> 
    26  
     22as well as functions operating on <b>vectors</b> and <b>matrices</b>. 
     23</p> 
     24  
    2725<dl> 
    2826<dt><b>Main Author:</b> 
     
    3533    email: <A HREF=\"mailto:Martin.Otter@dlr.de\">Martin.Otter@dlr.de</A><br> 
    3634</dl> 
    37  
     35  
    3836<p> 
    3937Copyright &copy; 1998-2007, Modelica Association and DLR. 
     
    5957       Realized.</li> 
    6058</ul> 
    61  
     59  
    6260</html>")); 
    6361 
     62package Vectors "Library of functions operating on vectors"  
     63  extends Modelica.Icons.Library; 
     64   
     65  annotation ( 
     66    preferedView = "info", 
     67    Documentation(info="<HTML> 
     68<h4>Library content</h4> 
     69<p> 
     70This library provides functions operating on vectors: 
     71</p> 
     72<table border=1 cellspacing=0 cellpadding=2> 
     73  <tr><th><i>Function</i></th> 
     74      <th><i>Description</i></th> 
     75  </tr> 
     76  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.isEqual\">isEqual</a>(v1, v2)</td> 
     77      <td>Determines whether two vectors have the same size and elements</td> 
     78  </tr> 
     79  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.norm\">norm</a>(v,p)</td> 
     80      <td>p-norm of vector v</td> 
     81  </tr> 
     82  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.length\">length</a>(v)</td> 
     83      <td>Length of vector v (= norm(v,2), but inlined and therefore usable in  
     84          symbolic manipulations) </td> 
     85  </tr> 
     86  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.normalize\">normalize</a>(v)</td> 
     87      <td>Return normalized vector such that length = 1 and prevent  
     88          zero-division for zero vector</td> 
     89  </tr> 
     90  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.reverse\">reverse</a>(v)</td> 
     91      <td>Reverse vector elements</td> 
     92  </tr> 
     93  <tr><td><a href=\"Modelica:Modelica.Math.Vectors.sort\">sort</a>(v)</td> 
     94      <td>Sort elements of vector in ascending or descending order</td> 
     95  </tr> 
     96</table> 
     97<h4>See also</h4> 
     98<a href=\"Modelica:Modelica.Math.Matrices\">Matrices</a> 
     99</HTML>")); 
     100   
     101  function isEqual "Determine if two Real vectors are numerically identical"  
     102    extends Modelica.Icons.Function; 
     103    input Real v1[:] "First vector"; 
     104    input Real v2[:] "Second vector (may have different length as v1"; 
     105    input Real eps(min=0) = 0  
     106      "Two elements e1 and e2 of the two vectors are identical if abs(e1-e2) <= eps"; 
     107    output Boolean result  
     108      "= true, if vectors have the same length and the same elements"; 
     109     
     110    annotation (preferedView="info", Documentation(info="<HTML> 
     111<h4>Syntax</h4> 
     112<blockquote><pre> 
     113Vectors.<b>isEqual</b>(v1, v2); 
     114Vectors.<b>isEqual</b>(v1, v2, eps=0); 
     115</pre></blockquote> 
     116<h4>Description</h4> 
     117<p> 
     118The function call \"<code>Vectors.isEqual(v1, v2)</code>\" returns <b>true</b>,  
     119if the two Real vectors v1 and v2 have the same dimensions and  
     120the same elements. Otherwise the function 
     121returns <b>false</b>. Two elements e1 and e2 of the two vectors 
     122are checked on equality by the test \"abs(e1-e2) &le; eps\", where \"eps\" 
     123can be provided as third argument of the function. Default is \"eps = 0\". 
     124</p>Modelica.Utilities.Strings.isEqual 
     125<h4>Example</h4> 
     126<blockquote><pre> 
     127  Real v1[3] = {1, 2, 3}; 
     128  Real v2[3] = {1, 2, 3, 4}; 
     129  Real v3[3] = {1, 2, 3.0001}; 
     130  Boolean result; 
     131<b>algorithm</b> 
     132  result := Vectors.isEqual(v1,v2);     // = <b>false</b> 
     133  result := Vectors.isEqual(v1,v3);     // = <b>false</b> 
     134  result := Vectors.isEqual(v1,v1);     // = <b>true</b> 
     135  result := Vectors.isEqual(v1,v3,0.1); // = <b>true</b> 
     136</pre></blockquote> 
     137<h4>See also</h4> 
     138<a href=\"Modelica:Modelica.Math.Matrices.isEqual\">Matrices.isEqual</a>,  
     139<a href=\"Modelica:Modelica.Utilities.Strings.isEqual\">Strings.isEqual</a> 
     140</HTML>")); 
     141  protected  
     142    Integer n=size(v1, 1) "Dimension of vector v1"; 
     143    Integer i=1; 
     144  algorithm  
     145    result := false; 
     146    if size(v2, 1) == n then 
     147      result := true; 
     148      while i <= n loop 
     149        if abs(v1[i] - v2[i]) > eps then 
     150          result := false; 
     151          i := n; 
     152        end if; 
     153        i := i + 1; 
     154      end while; 
     155    end if; 
     156  end isEqual; 
     157   
     158  function norm "Returns the norm of a vector"  
     159    extends Modelica.Icons.Function; 
     160    input Real v[:] "Vector"; 
     161    input Real p(min=1) = 2  
     162      "Type of p-norm (often used: 1, 2, or Modelica.Constants.inf)"; 
     163    output Real result "p-norm of vector v"; 
     164     
     165    annotation (preferedView="info", Documentation(info="<HTML> 
     166<h4>Syntax</h4> 
     167<blockquote><pre> 
     168Vectors.<b>norm</b>(v); 
     169Vectors.<b>norm</b>(v,p=2);   // 1 &le; p &le; &#8734; 
     170</pre></blockquote> 
     171<h4>Description</h4> 
     172<p> 
     173The function call \"<code>Vectors.<b>norm</b>(v)</code>\" returns the 
     174<b>Euclidean norm</b> \"<code>sqrt(v*v)</code>\" of vector v.  
     175With the optional  
     176second argument \"p\", any other p-norm can be computed: 
     177</p> 
     178<center> 
     179<IMG SRC=\"../Images/vectorNorm.png\" ALT=\"function Vectors.norm\"> 
     180</center> 
     181<p> 
     182Besides the Euclidean norm (p=2), also the 1-norm and the 
     183infinity-norm are sometimes used: 
     184</p> 
     185<table border=1 cellspacing=0 cellpadding=2> 
     186  <tr><td><b>1-norm</b></td> 
     187      <td>= sum(abs(v))</td> 
     188      <td><b>norm</b>(v,1)</td> 
     189  </tr> 
     190  <tr><td><b>2-norm</b></td> 
     191      <td>= sqrt(v*v)</td> 
     192      <td><b>norm</b>(v) or <b>norm</b>(v,2)</td> 
     193  </tr> 
     194  <tr><td><b>infinity-norm</b></td> 
     195      <td>= max(abs(v))</td> 
     196      <td><b>norm</b>(v,Modelica.Constants.<b>inf</b>)</td> 
     197  </tr> 
     198</table> 
     199<p> 
     200Note, for any vector norm the following inequality holds: 
     201</p> 
     202<blockquote><pre> 
     203<b>norm</b>(v1+v2,p) &le; <b>norm</b>(v1,p) + <b>norm</b>(v2,p) 
     204</pre></blockquote> 
     205<h4>Example</h4> 
     206<blockquote><pre> 
     207  v = {2, -4, -2, -1}; 
     208  <b>norm</b>(v,1);    // = 9 
     209  <b>norm</b>(v,2);    // = 5 
     210  <b>norm</b>(v);      // = 5 
     211  <b>norm</b>(v,10.5); // = 4.00052597412635 
     212  <b>norm</b>(v,Modelica.Constants.inf);  // = 4 
     213</pre></blockquote> 
     214<h4>See also</h4> 
     215<a href=\"Modelica:Modelica.Math.Matrices.norm\">Matrices.norm</a> 
     216</HTML>")); 
     217  algorithm  
     218    if p == 2 then 
     219      result:=sqrt(v*v); 
     220    elseif p == Modelica.Constants.inf then 
     221      result:=max(abs(v)); 
     222    elseif p == 1 then 
     223      result:=sum(abs(v)); 
     224    else 
     225      result:=(sum(abs(v[i])^p for i in 1:size(v, 1)))^(1/p); 
     226    end if; 
     227  end norm; 
     228   
     229  function length "Return length of a vector"  
     230    extends Modelica.Icons.Function; 
     231    input Real v[:] "Vector"; 
     232    output Real result "Length of vector v"; 
     233     
     234    annotation (preferedView="info", Documentation(info="<html> 
     235<h4>Syntax</h4> 
     236<blockquote><pre> 
     237Vectors.<b>length</b>(v); 
     238</pre></blockquote> 
     239<h4>Description</h4> 
     240<p> 
     241The function call \"<code>Vectors.<b>length</b>(v)</code>\" returns the 
     242<b>Euclidean length</b> \"<code>sqrt(v*v)</code>\" of vector v.  
     243The function call is equivalent to Vectors.norm(v). The advantage of 
     244length(v) over norm(v)\"is that function length(..) is implemented 
     245in one statement and therefore the function is usually automatically 
     246inlined. Further symbolic processing is therefore possible, which is 
     247not the case with function norm(..). 
     248</p> 
     249<h4>Example</h4> 
     250<blockquote><pre> 
     251  v = {2, -4, -2, -1}; 
     252  <b>length</b>(v);  // = 5 
     253</pre></blockquote> 
     254<h4>See also</h4> 
     255<a href=\"Modelica:Modelica.Math.Vectors.norm\">Vectors.norm</a> 
     256</html>")); 
     257  algorithm  
     258    result := sqrt(v*v); 
     259  end length; 
     260   
     261  function normalize  
     262    "Return normalized vector such that length = 1 and prevent zero-division for zero vector"  
     263    extends Modelica.Icons.Function; 
     264    input Real v[:] "Vector"; 
     265    input Real eps = 100*Modelica.Constants.eps "if |v| < eps then result = v"; 
     266    output Real result[size(v, 1)] "Input vector v normalized to length=1"; 
     267     
     268    annotation (preferedView="info", Documentation(info="<html> 
     269<h4>Syntax</h4> 
     270<blockquote><pre> 
     271Vectors.<b>normalize</b>(v); 
     272Vectors.<b>normalize</b>(v,eps=100*Modelica.Constants.eps); 
     273</pre></blockquote> 
     274<h4>Description</h4> 
     275<p> 
     276The function call \"<code>Vectors.<b>normalize</b>(v)</code>\" returns the 
     277<b>unit vector</b> \"<code>v/length(v)</code>\" of vector v.  
     278If length(v) is close to zero (more precisely, if length(v) &lt; eps),  
     279v is returned in order to avoid 
     280a division by zero. For many applications this is useful, because 
     281often the unit vector <b>e</b> = <b>v</b>/length(<b>v</b>) is used to compute 
     282a vector x*<b>e</b>, where the scalar x is in the order of length(<b>v</b>),  
     283i.e., x*<b>e</b> is small, when length(<b>v</b>) is small and then  
     284it is fine to replace <b>e</b> by <b>v</b> to avoid a division by zero. 
     285</p> 
     286<p> 
     287Since the function is implemented in one statement, 
     288it is usually inlined and therefore symbolic processing is 
     289possible. 
     290</p> 
     291<h4>Example</h4> 
     292<blockquote><pre> 
     293  <b>normalize</b>({1,2,3});  // = {0.267, 0.534, 0.802} 
     294  <b>normalize</b>({0,0,0});  // = {0,0,0} 
     295</pre></blockquote> 
     296<h4>See also</h4> 
     297<a href=\"Modelica:Modelica.Math.Vectors.length\">Vectors.length</a> 
     298</html>")); 
     299  algorithm  
     300    result := if length(v) >= eps then  v/length(v) else v; 
     301  end normalize; 
     302   
     303  function reverse "Reverse vector elements (e.g. v[1] becomes last element)"  
     304    extends Modelica.Icons.Function; 
     305    input Real v[:] "Vector"; 
     306    output Real result[size(v, 1)] "Elements of vector v in reversed order"; 
     307     
     308    annotation (preferedView="info", Documentation(info="<html> 
     309<h4>Syntax</h4> 
     310<blockquote><pre> 
     311Vectors.<b>reverse</b>(v); 
     312</pre></blockquote> 
     313<h4>Description</h4> 
     314<p> 
     315The function call \"<code>Vectors.<b>reverse</b>(v)</code>\" returns the 
     316vector elements in reverse order. 
     317</p> 
     318<h4>Example</h4> 
     319<blockquote><pre> 
     320  <b>reverse</b>({1,2,3,4});  // = {4,3,2,1} 
     321</pre></blockquote> 
     322</html>")); 
     323  algorithm  
     324    result := {v[end-i+1] for i in 1:size(v,1)}; 
     325  end reverse; 
     326   
     327  function sort "Sort elements of vector in ascending or descending order"  
     328    extends Modelica.Icons.Function; 
     329    input Real v[:] "Vector to be sorted"; 
     330    input Boolean ascending = true  
     331      "= true if ascending order, otherwise descending order"; 
     332    output Real sorted_v[size(v,1)] = v "Sorted vector"; 
     333    output Integer indices[size(v,1)] = 1:size(v,1) "sorted_v = v[indices]"; 
     334     
     335    annotation (preferedView="info",Documentation(info="<HTML> 
     336<h4>Syntax</h4> 
     337<blockquote><pre> 
     338           sorted_v = Vectors.<b>sort</b>(v); 
     339(sorted_v, indices) = Vectors.<b>sort</b>(v, ascending=true); 
     340</pre></blockquote> 
     341<h4>Description</h4> 
     342<p> 
     343Function <b>sort</b>(..) sorts a Real vector v 
     344in ascending order and returns the result in sorted_v. 
     345If the optional argument \"ascending\" is <b>false</b>, the vector 
     346is sorted in descending order. In the optional second 
     347output argument the indices of the sorted vector with respect 
     348to the original vector are given, such that sorted_v = v[indices]. 
     349</p> 
     350<h4>Example</h4> 
     351<blockquote><pre> 
     352  (v2, i2) := Vectors.sort({-1, 8, 3, 6, 2}); 
     353       -> v2 = {-1, 2, 3, 6, 8} 
     354          i2 = {1, 5, 3, 4, 2} 
     355</pre></blockquote> 
     356</HTML>")); 
     357    /* shellsort algorithm; should be improved later */ 
     358  protected  
     359    Integer gap; 
     360    Integer i; 
     361    Integer j; 
     362    Real wv; 
     363    Integer wi; 
     364    Integer nv = size(v,1); 
     365    Boolean swap; 
     366  algorithm  
     367    gap := div(nv,2); 
     368     
     369    while gap > 0 loop 
     370       i := gap; 
     371       while i < nv loop 
     372          j := i-gap; 
     373          if j>=0 then 
     374             if ascending then 
     375                swap := sorted_v[j+1] > sorted_v[j + gap + 1]; 
     376             else 
     377                swap := sorted_v[j+1] < sorted_v[j + gap + 1]; 
     378             end if; 
     379          else 
     380             swap := false; 
     381          end if; 
     382         
     383          while swap loop 
     384             wv := sorted_v[j+1]; 
     385             wi := indices[j+1]; 
     386             sorted_v[j+1] := sorted_v[j+gap+1]; 
     387             sorted_v[j+gap+1] := wv; 
     388             indices[j+1] := indices[j+gap+1]; 
     389             indices[j+gap+1] := wi; 
     390             j := j - gap; 
     391             if j >= 0 then 
     392                if ascending then 
     393                   swap := sorted_v[j+1] > sorted_v[j + gap + 1]; 
     394                else 
     395                   swap := sorted_v[j+1] < sorted_v[j + gap + 1]; 
     396                end if; 
     397             else 
     398                swap := false; 
     399             end if; 
     400          end while; 
     401          i := i + 1; 
     402       end while; 
     403       gap := div(gap,2); 
     404    end while; 
     405  end sort; 
     406end Vectors; 
    64407 
    65 package Matrices "Functions on matrices"  
     408 
     409package Matrices "Library of functions operating on matrices"  
    66410   
    67411  extends Modelica.Icons.Library; 
     
    78422      autolayout=1), 
    79423    Documentation(info="<HTML> 
    80 <h3><font color=\"#008000\">Library content</font></h3> 
     424<h4>Library content</h4> 
    81425<p> 
    82426This library provides functions operating on matrices: 
     
    86430      <th><i>Description</i></th> 
    87431  </tr> 
     432  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.isEqual\">isEqual</a>(M1, M2)</td> 
     433      <td>Determines whether two matrices have the same size and elements</td> 
     434  </tr> 
    88435  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.norm\">norm</a>(A)</td> 
    89436      <td>1-, 2- and infinity-norm of matrix A</td> 
    90437  </tr> 
    91   <tr><td><a href=\"Modelica:Modelica.Math.Matrices.isEqual\">isEqual</a>(M1, M2)</td> 
    92       <td>determines whether two matrices have the same size and elements</td> 
     438  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.sort\">sort</a>(M)</td> 
     439      <td>Sort rows or columns of matrix in ascending or descending order</td> 
    93440  </tr> 
    94441  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.solve\">solve</a>(A,b)</td> 
    95442      <td>Solve real system of linear equations A*x=b with a b vector</td> 
     443  </tr> 
     444  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.solve2\">solve2</a>(A,B)</td> 
     445      <td>Solve real system of linear equations A*X=B with a B matrix</td> 
    96446  </tr> 
    97447  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.leastSquares\">leastSquares</a>(A,b)</td> 
     
    110460          b vector and an LU decomposition from \"LU(..)\"</td> 
    111461  </tr> 
     462  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.LU_solve2\">LU_solve2</a>(LU,p,B)</td> 
     463      <td>Solve real system of linear equations P*L*U*X=B with a<br> 
     464          B matrix and an LU decomposition from \"LU(..)\"</td> 
     465  </tr> 
    112466  <tr><td>(Q,R,p) = <a href=\"Modelica:Modelica.Math.Matrices.QR\">QR</a>(A)</td> 
    113467      <td> QR decomposition with column pivoting of rectangular matrix (Q*R = A[:,p]) </td> 
     
    115469  <tr><td>eval = <a href=\"Modelica:Modelica.Math.Matrices.eigenValues\">eigenValues</a>(A)<br> 
    116470          (eval,evec) = <a href=\"Modelica:Modelica.Math.Matrices.eigenValues\">eigenValues</a>(A)</td> 
    117       <td> compute eigenvalues and optionally eigenvectors<br> 
     471      <td> Compute eigenvalues and optionally eigenvectors<br> 
    118472           for a real, nonsymmetric matrix </td> 
    119473  </tr> 
    120474  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.eigenValueMatrix\">eigenValueMatrix</a>(eigen)</td> 
    121       <td> return real valued block diagonal matrix J of eigenvalues of  
     475      <td> Return real valued block diagonal matrix J of eigenvalues of  
    122476            matrix A (A=V*J*Vinv) </td> 
    123477  </tr> 
    124478  <tr><td>sigma = <a href=\"Modelica:Modelica.Math.Matrices.singularValues\">singularValues</a>(A)<br> 
    125479      (sigma,U,VT) = <a href=\"Modelica:Modelica.Math.Matrices.singularValues\">singularValues</a>(A)</td> 
    126       <td> compute singular values and optionally left and right singular vectors </td> 
     480      <td> Compute singular values and optionally left and right singular vectors </td> 
    127481  </tr> 
    128482  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.det\">det</a>(A)</td> 
    129       <td> determinant of a matrix (do <b>not</b> use; use rank(..))</td> 
     483      <td> Determinant of a matrix (do <b>not</b> use; use rank(..))</td> 
    130484  </tr> 
    131485  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.inv\">inv</a>(A)</td> 
    132       <td> inverse of a matrix </td> 
     486      <td> Inverse of a matrix </td> 
    133487  </tr> 
    134488  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.rank\">rank</a>(A)</td> 
    135       <td> rank of a matrix </td> 
     489      <td> Rank of a matrix </td> 
    136490  </tr> 
    137491  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.balance\">balance</a>(A)</td> 
    138       <td>balance a square matrix to improve the condition</td> 
     492      <td>Balance a square matrix to improve the condition</td> 
    139493  </tr> 
    140494  <tr><td><a href=\"Modelica:Modelica.Math.Matrices.exp\">exp</a>(A)</td> 
    141       <td> compute the exponential of a matrix by adaptive Taylor series<br>  
     495      <td> Compute the exponential of a matrix by adaptive Taylor series<br>  
    142496           expansion with scaling and balancing</td> 
    143497  </tr> 
    144498  <tr><td>(P, G) = <a href=\"Modelica:Modelica.Math.Matrices.integralExp\">integralExp</a>(A,B)</td> 
    145       <td> compute the exponential of a matrix and its integral</td> 
     499      <td> Compute the exponential of a matrix and its integral</td> 
    146500  </tr> 
    147501  <tr><td>(P, G, GT) = <a href=\"Modelica:Modelica.Math.Matrices.integralExpT\">integralExpT</a>(A,B)</td> 
    148       <td> compute the exponential of a matrix and two integrals</td> 
     502      <td> Compute the exponential of a matrix and two integrals</td> 
    149503  </tr> 
    150504</table> 
    151  
     505  
    152506<p> 
    153507Most functions are solely an interface to the external LAPACK library 
     
    155509The details of this library are described in: 
    156510</p> 
    157  
     511  
    158512<dl> 
    159513<dt>Anderson E., Bai Z., Bischof C., Blackford S., Demmel J., Dongarra J., 
     
    162516     Third Edition, SIAM, 1999.</dd> 
    163517</dl> 
    164  
    165  
     518  
     519  
    166520</HTML> 
    167521")); 
    168    
    169   function norm "Returns the norm of a matrix"  
    170     extends Modelica.Icons.Function; 
    171     input Real A[:, :] "Input matrix"; 
    172     input Real p(min=1) = 2  
    173       "Type of p-norm (only allowed: 1, 2 or Modelica.Constants.inf)"; 
    174     output Real result=0.0 "p-norm of matrix A"; 
    175      
    176     annotation (preferedView="info", Documentation(info="<HTML> 
    177 <h3><font color=\"#008000\">Syntax</font></h3> 
    178 <blockquote><pre> 
    179 Matrices.<b>norm</b>(A); 
    180 Matrices.<b>norm</b>(A, p=2); 
    181 </pre></blockquote> 
    182 <h3><font color=\"#008000\">Description</font></h3> 
    183 <p> 
    184 The function call \"<code>Matrices.norm(A)</code>\" returns the 
    185 2-norm of matrix A, i.e., the largest singular value of A.<br> 
    186 The function call \"<code>Matrices.norm(A, p)</code>\" returns the 
    187 p-norm of matrix A. The only allowed values for p are</p> 
    188 <ul> 
    189 <li> \"p=1\": the largest column sum of A</li> 
    190 <li> \"p=2\": the largest singular value of A</li>  
    191 <li> \"p=Modelica.Constants.inf\": the largest row sum of A</li> 
    192 </ul> 
    193 <p> 
    194 Note, for any matrices A1, A2 the following inequality holds: 
    195 </p> 
    196 <blockquote><pre> 
    197 Matrices.<b>norm</b>(A1+A2,p) &le; Matrices.<b>norm</b>(A1,p) + Matrices.<b>norm</b>(A2,p) 
    198 </pre></blockquote> 
    199 <p> 
    200 Note, for any matrix A and vector v the following inequality holds: 
    201 </p> 
    202 <blockquote><pre> 
    203 Vectors.<b>norm</b>(A*v,p) &le; Matrices.<b>norm</b>(A,p)*Vectors.<b>norm</b>(A,p) 
    204 </pre></blockquote> 
    205 </HTML>")); 
    206   algorithm  
    207     if p == 1 then 
    208       // column sum norm 
    209       for i in 1:size(A, 2) loop 
    210         result := max(result, sum(abs(A[:, i]))); 
    211       end for; 
    212     elseif p == 2 then 
    213       // largest singular value 
    214       result := max(singularValues(A));