Particle has an applied constant force until it aproaches C

2 views (last 30 days)
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
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
ans = 1.0063
Marcelo Gonzalez
Marcelo Gonzalez on 26 Nov 2021
I agree with the v=u+at, but since the object starts at rest u=0 Also, yeah, at certain point v > C, that's why I break the while after v < 0.9999C Since the relativistic mass increases as v aproaches C, it's techincally imposible for v to be greater than C Idk why my code breaks after around 0.71C I'll keep trying tomorrow, already turned off my pc and went to bed, I'll keep this thread updated if I find anything

Sign in to comment.

Answers (1)

Walter Roberson
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
  2 Comments
Marcelo Gonzalez
Marcelo Gonzalez on 26 Nov 2021
Oh my god, you're a genius! Can't believe I missed that! You just got me out of my bed to modify my code and give it a go. Thanks!
Marcelo Gonzalez
Marcelo Gonzalez on 26 Nov 2021
Update, this was it.
I changed it and it worked amazingly! Thank you very much!
I made some plots of how mass converges at infinite (as much as matlab could handle), velocity converges in C and acceleration converges in 0
The axis-labels are in spanish since my course is in spanish (I'm from Mexico)

Sign in to comment.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!