我有一个方程f(β) = cosh β cos β + 1 = 0
,我需要使用 βi 根来找到一些频率。频率的公式是
fi = sqrt((βi^4 * E*I) / (4*pi*m*L^3) );
我收到此错误,我不知道问题出在哪里
??? Subscript indices must either be real positive integers or logicals.
Error in ==> C:\Documents and Settings\Laura Lupas\Desktop\subiect88\frecventa.m
On line 18 ==> p= p0 - f(p0)/fd(p0);
这是我的代码:
function p = frecventa(f,fd,p_start,eps);
p0=p_start;
i=1;
L = 0.9; %lungimea grinzii in m
b = 0.025; %latimea grinzii in metri
h = 0.0025; %inaltimea in metrii
dens = 7850; % kg/m cub
v = b * h * L ; % volum
m = dens * v;
E = 2000e11; %modulul de elasti N/m patrat
I= (b*h^2)/12;%mometul de inertie
while(i <= 2)
p= p0 - f(p0)/fd(p0);
if abs(p-p0) < eps
return
end
i = i + 1;
p0=p;
p = sqrt((p0^4 * E*I) / (4*pi*m*L^3) )
end
% beta = 0:0.001:pi
%f = cosh(beta).*cos(beta) + 1;
%fd = sinh(beta).*cos(beta) - cosh(beta).*sin(beta);