Home > demos > chemotax > chemf.m

chemf

PURPOSE ^

pde for chemotaxis model

SYNOPSIS ^

function [c,a,f,b]=chemf(p,u,lam)

DESCRIPTION ^

 pde for chemotaxis model 
 u_t=0.25*Lap u-lam*div(u*grad v)+r*u(1-u)
 v_t=Lap v+(u/(1+u)-v)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [c,a,f,b]=chemf(p,u,lam)
0002 % pde for chemotaxis model
0003 % u_t=0.25*Lap u-lam*div(u*grad v)+r*u(1-u)
0004 % v_t=Lap v+(u/(1+u)-v)
0005 u=pdeintrp(p.points,p.tria,u);duv=ones(1,p.nt); D=0.25; r=1.52;
0006 c=isoc([[D*duv -lam*u(1,:)]; [0*duv duv]],p.neq,p.nt);
0007 
0008 % To set c by hand:
0009 %c1111=D*duv; c1112=0*duv; c1121=0*duv; c1122=D*duv;
0010 %c1211=-lam*u(1,:); c1212=0*duv; c1221=0*duv;c1222=-lam*u(1,:);
0011 %c2111=0*duv; c2112=0*duv; c2121=0*duv; c2122=0*duv;
0012 %c2211=duv; c2212=0*duv; c2221=0*duv; c2222=1*duv;
0013 %c=[c1111; c1121; c1112; c1122; c2111; c2121; c2112; c2122; ...
0014 %   c1211; c1221; c1212; c1222; c2211; c2221; c2212; c2222];
0015 
0016 f1=r*u(1,:).*(1-u(1,:)); f2=u(1,:)./(1+u(1,:))-u(2,:); a=0; b=0;
0017 f=[f1;f2];

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