HI I'm not quite understudying something basic here as I'm getting this error (see below) I have a 201x201x201 matrix of values in W/m3 which I am trying to get it to calculate on. is I something wrong with my kgrid?
Running k-Wave thermal simulation...
start time: 08-Apr-2019 14:22:38
dt: 500ms, t_end: 150s, time steps: 300
input grid size: 202 by 202 by 202 grid points (20.2 by 20.2 by 20.2mm)
Array dimensions must match for binary array op.
Error in kWaveDiffusion/takeTimeStep (line 689)
q_term = obj.diffusion_p1 .* obj.IT( kappa .* obj.FT( obj.Q ) );
Error in k_wave (line 61)
kdiff.takeTimeStep(Nt, dt);
the code I am running is here:
% create the computational grid
Nx = 201; % number of grid points in the x (row) direction
Ny = 201; % number of grid points in the y (column) direction
Nz = 201;
dx = 1e-4; % grid point spacing in the x direction [m]
dy = 1e-4; % grid point spacing in the y direction [m]
dz = 1e-4;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);
% define medium properties
medium.density = 1079; % [kg/m^3]
medium.thermal_conductivity = 0.52; % [W/(m.K)]
medium.specific_heat = 3540; % [J/(kg.K)]
% set Gaussian initial temperature distribution [degC]
% width = 4 * dx;
% source.T0 = 37 + 5 .* exp( -(kgrid.x ./ width).^2 - (kgrid.y ./width).^2 );
T0 = 37 .* ones(201, 201, 201);
T0(:, 120:201, :) = 20 ;
source.T0 = T0;
source.Q = absorbCube;
% set input args
input_args = {'PlotScale', [37, 50]};
% create kWaveDiffusion object
kdiff = kWaveDiffusion(kgrid, medium, source, [], input_args{:});
% % take time steps (temperature can be accessed as kdiff.T)
Nt = 300;
dt = 0.5;
kdiff.takeTimeStep(Nt, dt);
% %
% % plot the current temperature field
figure;
kdiff.plotTemp;