惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Recent Announcements
Recent Announcements
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News | PayPal Newsroom
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
S
Security @ Cisco Blogs
K
Kaspersky official blog
A
Arctic Wolf
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
L
LINUX DO - 最新话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Last Watchdog
The Last Watchdog
T
The Exploit Database - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Archives - TechRepublic
Security Archives - TechRepublic
V
V2EX
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
F
Full Disclosure
I
Intezer
Schneier on Security
Schneier on Security
AWS News Blog
AWS News Blog
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
M
MIT News - Artificial intelligence
P
Privacy & Cybersecurity Law Blog
Attack and Defense Labs
Attack and Defense Labs
量子位
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
Google Online Security Blog
Google Online Security Blog
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
C
Check Point Blog
N
Netflix TechBlog - Medium
博客园 - Franky
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
S
Securelist

博客园 - 遗忘海岸

简协运动模拟 圆周运动模拟 带阻力的平抛运动 C# 队列的一些并发模拟 devexpress gridview master,detail视图 focuseRowHandle 同步选中 C# Tcp Server端实现,使用TcpListener 深信服务超融合管理Api调用 GDI+画工作流图的一些总结 绘制贝塞而曲线 GDI+画直线带箭头 devexpress schedulerControl Gantt View 使用 逻辑回归损失函数求导 matplotlim柱状图 匀加速运动模拟python,(matplotlib) C# 实现排列 python 类鸟群Boids C#动态编译 正太分布数据排序后分段数据的方差与标准差 Android 的一个通用列表单选AlertDialog封装
电磁场中的运动轨迹模拟
遗忘海岸 · 2025-12-19 · via 博客园 - 遗忘海岸

%% 竖直 方向的电场E=3N/C,垂直运动平面的均匀磁场,质量为m=0.2KG,电荷量Q=2C正电荷
% 不考虑重力,初速度v0=5,夹角theta0=90
% 电场力:F_E=Q*E
% 洛伦磁力: F_L=B*V*Q

clear; clc; 
%close all


%% 参数设置
m = 8;            % 质量 (kg)
v0 = 15;           % 初始速度大小 (m/s)
B=1                 % 单位(T)
Q=2;                % 2C+
E=3;                % 3N/C
theta0 = pi *1/2;         % 初始速度方向 (弧度,0表示+x方向)
t_total = 100;       % 总时间 (s)
dt = 0.0001;          % 时间步长 (s)

n_steps = round(t_total / dt);
x=[]
y=[]
vx=[]
vy=[]
ax=[]
ay=[]


x(1)=0;
y(1)=0;
vx(1)=v0*cos(theta0);
vy(1)=v0*sin(theta0);
ax(1)=0;
ay(1)=0;
ay_E= - (Q*E/m);%电场力产生的加速度整个过程恒定不变
F_L=v0*B*Q;
% 数值积分
for i = 1:n_steps-1

    %% 计算洛伦磁力在x,y方向上产生的加速度
    % 当前速度大小和方向
    v = sqrt(vx(i)^2 + vy(i)^2);
   

    F_L=v*B*Q;
    % 计算垂直于速度方向的单位向量
    % 垂直于(vx, vy)的向量可以是(-vy, vx)或(vy, -vx)
    % 这里选择使质点顺时针旋转的方向
    nx = -vy(i) / v;
    ny = vx(i) / v;
    
    % 计算加速度(力垂直于速度)
    ax_L = (F_L / m) * nx;
    ay_L = (F_L / m) * ny;


    ax(i+1)= ax_L;
    ay(i+1)= ay_E + ay_L;
    


    % 更新速度和位置
    vx(i+1) = vx(i) + ax(i) * dt;
    vy(i+1) = vy(i) + ay(i) * dt;
    
    x(i+1) = x(i) + vx(i) * dt;
    y(i+1) = y(i) + vy(i) * dt;
end


figure;
hold on;
grid on;
axis equal;
plot(x, y, 'b-', 'LineWidth', 1);

View Code