是第一问还是第二问啊?第一问没有符号解,只能数值解
g = 10; L = 1; theta0 = 30*pi/180;%30° odefun = @(t,theta) [theta(2); -g/L*sin(theta(1))]; [t,theta] = ode45(odefun, [0,10], [theta0, 0]); plot(t,theta(:,1))
这个周期是2.007第二问周期是2*pi*sqrt(L/g)
2*pi*sqrt(L/g)