欢迎光临散文网 会员登陆 & 注册

北太天元软件做心脏射频消融手术相关的数值模拟

2023-02-10 20:10 作者:卢朓  | 我要投稿

%一维的热传传导方程的

%初边值问题。

%北太天元数值计算软件做心脏射频消融术有关的数值模拟

%激光头处的温度作为时间的函数设置为如下的函数

% 这个函数和方波的Fourier变换有关

Tc = 50;

N = 200;

L = 1;

NN = 1:N;

NNinv = 1.0./NN;

fh = @(t) Tc/2 + ...

   Tc/pi*( ...

    (NNinv.*(1-cos(NN*pi))) * ( sin(NN*pi*t/L) )' ...

   ) ;


t=0:0.1:5;

n = length(t);

y = zeros(1,n);

for i=1:n

   y(i) = fh(t(i));

end

plot(t, y, 'r*');



xl = 0;

xr = 1;

tbeg = 0;

dt = 0.0001

tend = 1e-2;

t = tbeg:dt:tend;

nt = length(t);

dx = 0.01;

x = xl:dx:xr;

nx = length(x);

T = zeros(nt,nx);


T(1,:) = 37; % 初始温度是37摄氏度


i=1;

T(i,1) = fh(t(i)); %左边界的温度

T(i,end) = 37; %右边界的温度



K = 0.001*dt/dx/dx; % 热传导系数设置为 0.001


for i=2:nt

   T(i,2:end-1) = T(i-1,2:end-1) + ...

      K * ( ...

               T(i-1,1:end-2) ...

            -2*T(i-1,2:end-1) ...

            +T(i-1,3:end) ...

         ); 


T(i,1) = fh(t(i)); %左边界的温度

T(i,end) = 37; %右边界的温度

end


load_plugin("time")

pause(2)


clf; close all;

hold on

for i=1:nt

   plot(x(1:20),T(i,1:20))

   pause(0.1)

end

hold off



北太天元软件做心脏射频消融手术相关的数值模拟的评论 (共 条)

分享到微博请遵守国家法律