Home > demos > rbconv > rbconvjac.m

rbconvjac

PURPOSE ^

jacobian for Rayleigh-Benard convection in vorticity formulation

SYNOPSIS ^

function [c,fu,flam,b]=rbconvjac(p,u,lam)

DESCRIPTION ^

 jacobian for Rayleigh-Benard convection in vorticity formulation

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [c,fu,flam,b]=rbconvjac(p,u,lam) 
0002 % jacobian for Rayleigh-Benard convection in vorticity formulation
0003 [ux,uz]=pdegrad(p.points,p.tria,u); 
0004 psix=ux(1,:); psiz=uz(1,:); 
0005 omx =ux(2,:); omz =uz(2,:); 
0006 Tx  =ux(3,:); Tz  =uz(3,:); 
0007 R=lam; P=1;
0008 c=[1;1;P;P;1;1];fu = zeros(p.neq^2,1); fu(4)=-1;
0009 flam=[zeros(1,p.nt);Tx;zeros(1,p.nt)];
0010 b = zeros(p.neq^2*2,p.nt); 
0011 
0012 b(2*p.neq*2+3,:) = R*P*ones(1,p.nt); % b231: (partial_x)_3 in second eqn.
0013 b(3,:)           = -omz;  % b211
0014 b(2*p.neq+4,:)   = -psix; % b222
0015 b(2*p.neq+3,:)   = psiz;  % b221
0016 b(4,:)           = omx;   % b212
0017 
0018 b(5,:)           = ones(1,p.nt)-Tz;   % b311: (partial_x)_1 in third eqn.
0019 b(3*2*p.neq,:)   = -psix; % b332
0020 b(3*2*p.neq-1,:) = psiz;  % b331
0021 b(6,:)           = Tx;    % b312

Generated on Wed 15-Aug-2012 12:53:02 by m2html © 2005