function p11_tst_tmp %% function tst1_v0 %[n,p]= meshgrid(0:.1:2, 0:.1:3); [n,p]= meshgrid(0:.1:1.1, 0:.1:2.1); n= n(:); p=p(:); u= n.*(1-n-p); v= p.*(.5-p/4 -3*n/4); % clear vectors over p=2-2*n if 1 ind= find(p>2-2*n); u(ind)=0; v(ind)=0; end figure(301); clf; hold on quiver(n,p,u,v) axis equal np0= [0 0; 0 2; 1 0; .5 .5]; plot(np0(:,1), np0(:,2), 'or') %% function tst1 %[n,p]= meshgrid(0:.1:2, 0:.1:3); %[n,p]= meshgrid(0:.1:1.1, 0:.1:2.1); [n,p]= meshgrid(0.45:.01:.55, 0.45:.01:.55); sz= size(n); n= n(:); p=p(:); u= n.*(1-n-p); v= p.*(.5-p/4 -3*n/4); figure(301); clf; hold on g= 1e3; quiver(n,p,g*u,g*v) figure(302); clf; hold on uv2= reshape(sqrt(u.*u+v.*v), sz); %mask= (uv2>max(uv2(:,1))); uv2(mask)=max(uv2(:,1)); %0; %imshow(uint8(inorm(uv2))) %imagesc(uv2); axis xy mesh(uv2) view(24, 44) %% function tst2 p11_sh_np(0,0) p11_sh_np(0,2) p11_sh_np(1,0) p11_sh_np(.5,.5)