Home > demos > gpsol > gpjac.m

gpjac

PURPOSE ^

jacobian for GP

SYNOPSIS ^

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

DESCRIPTION ^

 jacobian for GP

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [c,fu,flam,b]=gpjac(p,u,lam) 
0002 % jacobian for GP
0003 mu=p.mu; c=[1;0;0;1;1;0;0;1]; 
0004 x=p.points(1,:)'; y=p.points(2,:)'; r=x.^2+y.^2; 
0005 pot=p.pa*pdeintrp(p.points,p.tria,r);
0006 [ux,uy]=pdegrad(p.points,p.tria,u); 
0007 ui=pdeintrp(p.points,p.tria,u);u=ui(1,:); v=ui(2,:); ua=u.^2+v.^2; 
0008 g=ua; gu=2*u; gv=2*v; 
0009 f1u=mu-pot+gu.*u+g; f1v=gv.*u; 
0010 f2u=gu.*v; f2v=mu-pot+gv.*v+g; 
0011 fu=[f1u; f2u; f1v; f2v]; 
0012 xi=pdeintrp(p.points,p.tria,x);yi=pdeintrp(p.points,p.tria,y);
0013 flam=[xi.*uy(2,:)-yi.*ux(2,:); yi.*ux(1,:)-xi.*uy(1,:)]; 
0014 b=zeros(p.neq*p.neq*2,p.nt); 
0015 b(3,:)=yi;b(4,:)=-xi;b(5,:)=-yi;b(6,:)=xi;b=lam*b;

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