A4 - Momentum Flow
Computing Momentum Flow Lines
Get Metric and Energy Tensor
%% Alcubierre
gridSize = [1 20 20 20];
worldCenter = (gridSize+1)./2;
velocity = 0.5;
R = 5;
sigma = 0.5;
Metric = metricGet_AlcubierreComoving(gridSize,worldCenter,velocity,R,sigma);
% Compute energy tensor
EnergyTensor = getEnergyTensor(Metric);Get Momentum Flow Lines
%% Get momentum flow lines
% Define the inputs
ngridsteps = 4;
stepSize = 0.75;
maxSteps = 10000;
scaleFactor = 1/max(abs(EnergyTensor.tensor{1,2}),[],'all');
% Build a grid of starting points using meshgrid
[X,Y,Z] = meshgrid(1:ngridsteps:gridSize(2),1:ngridsteps:gridSize(3),1:ngridsteps:gridSize(4));
% Assign the starting points into the cell format
startPoints = cell(1,3);
startPoints{1} = X;
startPoints{2} = Y;
startPoints{3} = Z;
% Find the flowline paths
[Paths] = getMomentumFlowLines(EnergyTensor, startPoints, stepSize, maxSteps, scaleFactor);Plot Momentum Flow Lines
Last updated