Page 378 - Process Modelling and Simulation With Finite Element Methods
P. 378

A MATLAB/FEMLAB Primer for Vector Calculus    365

          FEMLAB  provides  a  special  post interp function  to  extract  interpolated
          values from fem.sol for each dependent variable and derived variable.  The book
          is littered with examples of using postinterp to represent functions.  It can even
          be automated in an m-file function that calls the appropriate fem structure from a
          mat-file.


          A.4  Differentiation in Multivariable Calculus


          A.4.1  The gradient of a scalar field
          If $=$(x,y,z),  then the vector















          is called the gradient of the scalar field $,  and is denoted as well by grad $. The
          gradient operator v (the nabla character) is the vector operator
                                      a  .a       a
                                V=i-+j--+k-
                                     ax  ay  az

          in Cartesian coordinates in 3-D.

          A FEMLAB example.  Suppose 4 = x2 + y2, then  V$  = (2x, 2y, 0).

          But MATLAB does not directly deal with such symbolic calculations, however
          its  symbolic  toolbox  does.   FEMLAB,  however,  routinely  calculates  the
          numerical approximation of  the derivatives of  a solution.  So the gradient of  a
          scalar field can be constructed by FEMLAB “primitive” operations.  How do we
          easily access this information?  Here’s the recipe.
   373   374   375   376   377   378   379   380   381   382   383