⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 partic1.m

📁 Dispersion de Rutherford en Matlab
💻 M
字号:
%partic1.m - given the mass and initial time-dependent positions of 3 particles,
%this script calculates the velocities, accelerations and their center of mass 
%values. Type "help symbolic" within the command line 
%if need help on symbolic functions
clear;
format compact;                        %Suppress extra line-feeds on outputs
syms t;                                %declare t as a symbol
t = sym('t','real');                   %let t, and the masses be real
m=[1,2,3]                              %mass vector
M=sum(m)                               %total mass
r=[3+2*t^2,4,0;-2+1/t,2*t,0;1,-3*t^2,0]%given position vectors 
v=diff(r,t,1)                          %velocity vector
a=diff(r,t,2)                          %acceleration vector
rcm=m*r/M                              %center of mass coordinate
vcm=m*v/M                              %center of mass velocity
acm=m*a/M                              %center of mass acceleration
%================== evaluate =====================
t=1;                                   %set the time at which to evaluate expressions
r=eval(r)
v=eval(v)
a=eval(a)
rcm=eval(rcm)
vcm=eval(vcm)
acm=eval(acm)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -