⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cylindcat1g.m

📁 matlab在化学工程中的应用实例程序,对大家研究学习有指导作用。
💻 M
字号:
function [x,y]=CylindCat1g(bs,s)%CYLINDCAT1G	Gives geometry data for the CylindCat1g PDE model.%%   NE=CYLINDCAT1G gives the number of boundary segments%%   D=CYLINDCAT1G(BS) gives a matrix with one column for each boundary segment%   specified in BS.%   Row 1 contains the start parameter value.%   Row 2 contains the end parameter value.%   Row 3 contains the number of the left-hand regions.%   Row 4 contains the number of the right-hand regions.%%   [X,Y]=CYLINDCAT1G(BS,S) gives coordinates of boundary points. BS specifies the%   boundary segments and S the corresponding parameter values. BS may be%   a scalar.nbs=4;if nargin==0,  x=nbs; % number of boundary segments  returnendd=[  0 0 0 0 % start parameter value  1 1 1 1 % end parameter value  0 0 0 0 % left hand region  1 1 1 1 % right hand region];bs1=bs(:)';if find(bs1<1 | bs1>nbs),  error('Non-existent boundary segment number')endif nargin==1,  x=d(:,bs1);  returnendx=zeros(size(s));y=zeros(size(s));[m,n]=size(bs);if m==1 & n==1,  bs=bs*ones(size(s)); % expand bselseif m~=size(s,1) | n~=size(s,2),  error('bs must be scalar or of same size as s');endif ~isempty(s),% boundary segment 1ii=find(bs==1);if length(ii)x(ii)=(1-(0))*(s(ii)-d(1,1))/(d(2,1)-d(1,1))+(0);y(ii)=(0.5-(0.5))*(s(ii)-d(1,1))/(d(2,1)-d(1,1))+(0.5);end% boundary segment 2ii=find(bs==2);if length(ii)x(ii)=(1-(1))*(s(ii)-d(1,2))/(d(2,2)-d(1,2))+(1);y(ii)=(-0.5-(0.5))*(s(ii)-d(1,2))/(d(2,2)-d(1,2))+(0.5);end% boundary segment 3ii=find(bs==3);if length(ii)x(ii)=(0-(1))*(s(ii)-d(1,3))/(d(2,3)-d(1,3))+(1);y(ii)=(-0.5-(-0.5))*(s(ii)-d(1,3))/(d(2,3)-d(1,3))+(-0.5);end% boundary segment 4ii=find(bs==4);if length(ii)x(ii)=(0-(0))*(s(ii)-d(1,4))/(d(2,4)-d(1,4))+(0);y(ii)=(0.5-(-0.5))*(s(ii)-d(1,4))/(d(2,4)-d(1,4))+(-0.5);endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -