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

推荐订阅源

J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
雷峰网
雷峰网
T
Tailwind CSS Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
博客园 - 司徒正美
I
InfoQ
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
小众软件
小众软件
U
Unit 42
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net

博客园 - 遗忘海岸

电磁场中的运动轨迹模拟 圆周运动模拟 带阻力的平抛运动 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 博客园 - 遗忘海岸

%% simple harmonic motion

clear; clc; close all;
hold on;
grid on;
axis equal;

%% 参数设置
K=10; %弹簧劲度系数 N/m
m=0.2; %震子质量 Kg

t_total = 10;       % 总时间 (s)
dt = 0.0001;          % 时间步长 (s)

%% 数值模拟(欧拉法)
% 初始化数组
n_steps = round(t_total / dt);
t = linspace(0, t_total, n_steps);
x=[];
v=[];
a=[];

x(1)=-0.2; %从负半轴释放
v(1)=0;
a(1)=-x(1)*K;

for i = 1:n_steps-1

  a(i+1)=-x(i)*K;
  v(i+1)=v(i) + a(i) * dt;
  x(i+1)=x(i)+v(i) *dt;

end

subplot(2,2,1)

plot(t, x, 'b-', 'LineWidth', 1);
title('t-x');
grid on
axis equal

subplot(2,2,2)
plot(t, v, 'r-', 'LineWidth', 1);
title('t-v');
grid on
axis equal

subplot(2,2,3)
plot(t, a, 'g-', 'LineWidth', 1);
title('t-a');
grid on
% axis equal

View Code