function principale()
init()
end

function init()

distribution_time_vector = 100e-6;
 
% gridvector_x = [];
% gridvector_y = [];

gridcells_x = 30;
gridcells_y = 30;
sim_x1 = 0;
sim_y1 = 0;
sim_x2 = 4000;
sim_y2 = 4000;
die_x2 = 4000;
die_y2 = 4000;

source_x1 = 1800;
source_y1 = 1900;
source_x2 = 2200;
source_y2 = 2300;

sensor_x = 2500;
sensor_y = 2700;

die_coords = [0 0 die_x2 die_y2];
source_coords (1,:) = [source_x1 source_y1 source_x2 source_y2];
sensor_coords (1,:) = [sensor_x sensor_y];

source_time_vector = [0 40 40 60 60]*1e-6;
source_power_vector = [1 2 2 5 0.5]; 
source_params {1,1} = {@pwl source_time_vector source_power_vector};

gridvector_x = linspace (sim_x1, sim_x2, gridcells_x+1);
gridvector_y = linspace (sim_y1, sim_y2, gridcells_y+1);

[gridmatrix_x, gridmatrix_y] = meshgrid (gridvector_x, gridvector_y);
x_vector = reshape (gridmatrix_x, length(gridvector_x) * length(gridvector_y), 1);
y_vector = reshape (gridmatrix_y, length(gridvector_x) * length(gridvector_y), 1);
temp_distribution = [];

disp('bravo');
autre()
end


function autre()
disp('traitement');
end

% distribution_time_vector = 100e-6;
%  
% % gridvector_x = [];
% % gridvector_y = [];
% 
% gridcells_x = 30;
% gridcells_y = 30;
% sim_x1 = 0;
% sim_y1 = 0;
% sim_x2 = 4000;
% sim_y2 = 4000;
% die_x2 = 4000;
% die_y2 = 4000;
% 
% source_x1 = 1800;
% source_y1 = 1900;
% source_x2 = 2200;
% source_y2 = 2300;
% 
% sensor_x = 2500;
% sensor_y = 2700;
% 
% die_coords = [0 0 die_x2 die_y2];
% source_coords (1,:) = [source_x1 source_y1 source_x2 source_y2];
% sensor_coords (1,:) = [sensor_x sensor_y];
% 
% source_time_vector = [0 40 40 60 60]*1e-6;
% source_power_vector = [1 2 2 5 0.5]; 
% source_params {1,1} = {@pwl source_time_vector source_power_vector};
% 
% gridvector_x = linspace (sim_x1, sim_x2, gridcells_x+1);
% gridvector_y = linspace (sim_y1, sim_y2, gridcells_y+1);
% 
% [gridmatrix_x, gridmatrix_y] = meshgrid (gridvector_x, gridvector_y);
% x_vector = reshape (gridmatrix_x, length(gridvector_x) * length(gridvector_y), 1);
% y_vector = reshape (gridmatrix_y, length(gridvector_x) * length(gridvector_y), 1);
% temp_distribution = [];

%  for i = 1 : length (distribution_time_vector)
%             temp_distribution (:,i) = temp_calculation (x_vector, y_vector, ...
%                 distribution_time_vector, i, die_coords, source_coords, source_params);
%  end;

