HI I have a related question to this
I'm using the below code to cycle the beam on and off - monitoring the heat in the middle of the 'tumour' - and then stopping the cycle when a cem>240 is reached at the back of the tumour - but it takes ages! have you got any advice on a better way to achieve this
thanks!
Charlie
back_of_tumour = 100; % in pixels on a 201x201x201 matrix
middle_of_tumour = 120; % in pixels on a 201x201x201 matrix
% set source on time and off time steps
on_time = 1; % [s]
off_time = 1; % [s]
% calculate over this many steps
dt = 60;
kdiff.takeTimeStep(on_time, dt);
disp('cem43 after 1 step'); kdiff.cem43(back_of_tumour, 100, 100)
cem43_cycle_count = 0; % except the first round which has had an extra round to initiate k.diff heating cycle
on_count = 0;
off_count = 0;
while kdiff.cem43(back_of_tumour, 100, 100) < 241
disp('cem43'); kdiff.cem43(back_of_tumour, 100, 100)
while kdiff.T(middle_of_tumour, 100, 100) < 65
if kdiff.cem43(back_of_tumour, 100, 100) > 241
break
end
kdiff.Q = datacube; % this is my input source in W/m^3
kdiff.takeTimeStep(on_time, dt);
kdiff.T(middle_of_tumour, 100, 100)
on_count = on_count + 1
disp('cem43'); kdiff.cem43(back_of_tumour, 100, 100)
end
while kdiff.T(middle_of_tumour, 100, 100) > 45
if kdiff.cem43(back_of_tumour, 100, 100) > 241
break
end
kdiff.Q = 0;
kdiff.takeTimeStep(off_time, dt);
kdiff.T(middle_of_tumour, 100, 100)
off_count = off_count + 1
end
cem43_cycle_count = cem43_cycle_count + 1
end