Particle has an applied constant force until it aproaches C

1 回表示 (過去 30 日間)
Marcelo Gonzalez
Marcelo Gonzalez 2021 年 11 月 26 日
コメント済み: Marcelo Gonzalez 2021 年 11 月 26 日
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 件のコメント
Dyuman Joshi
Dyuman Joshi 2021 年 11 月 26 日
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 2021 年 11 月 26 日
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

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 11 月 26 日
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 件のコメント
Marcelo Gonzalez
Marcelo Gonzalez 2021 年 11 月 26 日
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 2021 年 11 月 26 日
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)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntegrated Circuits についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by