Particle has an applied constant force until it aproaches C
2 views (last 30 days)
Show older comments
I'm simulating a particle that has a force exerted on it until it aproaches the speed of light (C), taking into account it's relativistic mass according to the lorentz factor. Problem is that the velocity of the particle starts fluctuating values after reaching about 0.71 C, after that it just turns crazy until I get a velocity greater than C and my code crashes due to having an imaginary mass.
clc
clear all
format long
m = 10;
v = 0;
F = 20000; %N
%Speed of Light
C = physconst('LightSpeed'); % m/s
Cp = 0.99999*C;
%Matriz para guardar incremento de masa conforme la velocidad aumenta
MRV = [];
%Para encontrar el limite del linspace
Ts = 0;
%Lorentz Factor
LF = 1/sqrt(1-((v^2)/(C^2)));
%Relativistic Mass
M = LF*m;
while Cp > v
Ts = Ts+5;
a = F/M;
v = a*Ts;
LF = 1/sqrt(1-((v^2)/(C^2)));
M = LF*m;
MRV = [MRV,M];
v/C
end
T = linspace(0,Ts);
plot(T,MRV)
2 Comments
Dyuman Joshi
on 26 Nov 2021
Shouldn't you be doing v = u + a*t instead v = a*t ? I don't know if this is applicable in your problem or not.
Also, Suppose Cp (0.99999c) > v (0.9c) but after the iteration of the loop v can become greater than C, See for yourself from your code -
P.S - your code runs fine here.
m = 10;
v = 0;
F = 20000; %N
%Speed of Light
C = physconst('LightSpeed'); % m/s
Cp = 0.99999*C;
%Matriz para guardar incremento de masa conforme la velocidad aumenta
MRV = [];
%Para encontrar el limite del linspace
Ts = 0;
%Lorentz Factor
LF = 1/sqrt(1-((v^2)/(C^2)));
%Relativistic Mass
M = LF*m;
while Cp > v
Ts = Ts+5;
a = F/M;
v = a*Ts;
LF = 1/sqrt(1-((v^2)/(C^2)));
M = LF*m;
MRV = [MRV,M];
end
v/C
Answers (1)
Walter Roberson
on 26 Nov 2021
Suppose that you have a high M (relativistic mass). a=F/M so a is "low". v=a*Ts so with low a, v would be low. But low v leads to low relativistic mass, which leads to high acceleration, which leads high mass which leads to low acceleration...
What value is this likely to fluctuate around? 1/sqrt(2)
Your bug is that v=a*Ts is wrong. instead v = previous v + a*Ts
See Also
Categories
Find more on Integrated Circuits in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!