Home > demos > animalchem > chemft.m

chemft

PURPOSE ^

pde for chemotaxis, text-version, unused, just a template

SYNOPSIS ^

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

DESCRIPTION ^

 pde for chemotaxis, text-version, unused, just a template 
 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]=chemft(p,u,lam)
0002 % pde for chemotaxis, text-version, unused, just a template
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 lams=mat2str(lam); D='0.25'; r='1.52';
0006 c1111=D; c1112='0'; c1121='0'; c1122=D; 
0007 c1211=['-' lams '*u(1,:)']; c1212='0'; c1221='0';c1222=['-' lams '*u(1,:)'];
0008 c2111='0'; c2112='0'; c2121='0'; c2122='0'; 
0009 c2211='1'; c2212='0'; c2221='0'; c2222='1'; 
0010 c=char({c1111 c1121 c1112 c1122 c2111 c2121 c2112 c2122 ... 
0011     c1211 c1221 c1212 c1222 c2211 c2221 c2212 c2222});  
0012 f1=[r '*u(1,:).*(1-u(1,:))']; f2='u(1,:)./(1+u(1,:))-u(2,:)'; a=0; b=0;
0013 f=char({f1 f2}); [c,a,f]=pdetxpd(p.points,p.tria,u,c,a,f); % evaluate on triangles

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