|
楼主 |
发表于 2010-8-29 13:51
|
显示全部楼层
求助:用IHB法编程
附未完成之程序
clear all
clc
syms t
w0=0.2;
Q=10;
epsR=0.01;
m=[1 0.25;0.25 0.5];
c=[0.1 0;0 0.1];
k=[0.2 0.1*Q;0 0.5-0.04*Q];
Cs=[1 cos(t) cos(2*t) sin(t) sin(2*t) sin(3*t)];
S=[Cs zeros(1,6);zeros(1,6) Cs];
A1=[0.1 0.1 0.1 0.1 0.1 0.1]';
A2=[0.1 0.1 0.1 0.1 0.1 0.1]';
T1=[zeros(6,6) eye(6,6)];
T2=[eye(6,6) zeros(6,6)];
%A0=[A1;A2];
%X0=S*A0;
S2=diff(S,t,2);
fm=inline(S'*m*S2);
M=quadv(fm,0,2*pi);
S1=diff(S,t,1);
fc=inline(S'*c*S1);
C=quadv(fc,0,2*pi);
fk=inline(S'*k*S);
K=quadv(fk,0,2*pi);
A0=[A1;A2];
%X0=S*A0;
k3=[10*(Cs*A1).^2 0;0 20*(Cs*A2).^2];
fk3=inline(S'*k3*S);
K3=quadv(fk3,0,2*pi);
%%%%%
Kmc=w0^2*M+w0*C+K+3*K3;
R=-(w0^2*M+w0*C+K+K3)*A0;
Rmc=(2*w0*M+C)*A0;
%AA=inv(Kmc)*(R-Rmc*ww);
%AA首元素已知a1=0.0,求ww
a1=0.0;
Kmc11=Rmc(:,1);
Kmc=[Kmc11 Kmc(:,2:size(Kmc,2))];
AA=inv(Kmc)*R ; %drtA1(1)
ww=AA(1) ; %drtW(1)
%%%A00=[w0;A0(2:12,1)] ; %A1(0)
A01=A0+[a1;AA(2:12,1)] ; %A(1)+drtA(1)
%%%Aw0=AA+A00; %A1(0)+drtA1(1)=A1(1)
A10=T2*A01;
A20=T1*A01;
w01=w0+ww; %W+drtW(1)
n=1;
tol=1;
while tol>epsR
A0=A01;
%A0=[a1 A00(2:12,1)]
A1=A10;
A2=A20;
w0=w01;
k3=[10*(Cs*A1).^2 0;0 20*(Cs*A2).^2];
fk3=inline(S'*k3*S);
K3=quadv(fk3,0,2*pi);
Kmc=w0^2*M+w0*C+K+3*K3;
R=-(w0^2*M+w0*C+K+K3)*A0;
Rmc=(2*w0*M+C)*A0;
tol=norm(R)
Kmc11=Rmc(:,1);
Kmc=[Kmc11 Kmc(:,2:size(Kmc,2))];
AA=inv(Kmc)*R;
ww=AA(1);
%%%A00=[w0;A0(2:12,1)];
A01=A0+[a1;AA(2:12,1)];
A10=T2*A01;
A20=T1*A01;
w01=w0+ww;
n=n+1;
oo(n)=tol;
if(n>1000)
disp('迭代步数太多,可能不收敛')
return;
end
end
遇到的问题是:迭代不收敛,请各位熟悉IHB的同学帮忙看看
|
-
|