Re: [討論] 利用數值求解簡諧振盪已回收
function pttex144
n = 256;
t = 10*pi;
h = t/n;
[t x] = ode45(@hoke,0:h:t,[1,1])
plot(t,x)
function f = hoke(t,x)
k = 1;
m = 1;
f = zeros(2,1);
f(1) = x(2);
f(2) = -(k/m).*x(1);
-----------------------------------
我必須強調一下.原則上這個題目起始值為零有問題
對彈簧系統或簡諧運動.如果沒有外力或是初始位移.
木塊是會停在原地的
如果有外力.系統可以寫為 : x" + x = f(t)
如果有位移. x(0) 不等於 0
這樣才有解.不然都是零解(就是木塊不會動就是了)
--
1.MATLAB programming 2.ASPEN process simulation package
3.FORTRN programming 4.Advance Engineering Mathematics
5.Process Control Theory
6.Chemical Engineering Basic Theory(Kinetic.thermodynamics.transport)
7.Numerical Method and Analysis
8.MATLAB Toolbox.Simulink system basic design
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 113.167.210.104
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):