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

28         Process Modelling and Simulation with Finite Element Methods

                                     au  ar
                                   d  -+-=F
                                    a  at  ax
          where T(u, ux) is in principle the same functionality as the coefficient form (1.3),
          but  is  treated  differently  by  the  Solver  routines.  In  Coefficient  Mode,  the
          coefficients are  treated  as  independent of  u  unless  the  numerical  Jacobian  is
          used,  which brings out some of  the nonlinear dependency - iteration does the
          rest.  The  exact  Jacobian  in  General  Mode  differentiates both  r and  F  with
          respect to u symbolically in assembling the stiffness matrix.  Typically, General
          Mode requires fewer iterations for convergence than Coefficient Mode with the
          numerical Jacobian.  The use of  the exact Jacobian below does not require any
          special treatment to avoid a singular stiffness matrix in the treatment of the linear
          terms as the coefficient mode did.  In general, General Mode is more robust at
          solving  nonlinear  problems  than  Coefficient  Mode.  It  is  my  opinion  that
          Coefficient Mode  is  a  ‘‘legacy’’ feature  of  FEMLAB  - the  PDE  Toolbox  of
          MATLAB,  in  many  ways  a  precursor  to  FEMLAB,  uses  coefficient
          representations extensively.  Further, the coefficient formulation with numerical
          Jacobian  is  a  long  standing FEM  methodology,  so  for  benchmarking against
          other codes, it is a useful formulation.
             Here’s the recipe for General Mode - a minor modification of what we just
          did.

           Model Navigator   1-D geom., PDE modes, general form (nonlin stat)
           Options           Set Axes/Grid to [0,1]
           Draw              Name: Interval;  Start = 0; Stop =1
           Boundary Model    Set both endpoints (domains) to Neumann BCs
           Boundary Settings
           Subdomain Model   Set r = 0; da = 0; F = uA3+uA2-4*u+2
           Subdomain Settings
           Mesh mode         Set Max element size, general = 1; Remesh
           Solve             Use default settings (nonlinear solver, exact Jacobian)
           Post Process      After five iterations, the solution is found.  Click on the
                             graph  to  read  out  u=0.732051.  Play  with  the  initial
                             conditions to find the other two roots.

         Although setting up this template (rtfindgen.m for root finiding of simple)
         function of one variable was rather involved, and in face MATLAB haas a
         simple procedure for root finding using the built-in function fzero and inline
         declarations of functions, the FEMLAB GUI still provides many options and
         flexibility to root finding that may not be available in other standard packages.
         The next subsection applies our newly constructed nonlinear root finding scheme
         to a common chemical engineering application, flash distillation, which clarifies
         A FEW MORE FEATURES OF THE femlab gui.
   36   37   38   39   40   41   42   43   44   45   46