声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2016|回复: 5

[结构振动] matlab 计算非对称系统的传递函数

[复制链接]
发表于 2012-10-13 11:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
计算非对称系统的传递函数,原系统与伴随系统的特征值互为相反数。但是matlab计算的时候,特征值排列顺序不一致,这样就须要调整特征值的位置。我的想法是原系统特征值向量d1不变,将伴随系统的特征值d2改换位置,使之与d1一 一对应,即对于第J特征值,有d1(j)+d2(j)=0.我的程序是
d1=diag(D1);  %原系统特征值
d2=diag(D2);  %伴随系统特征值
for ih=1:lv
    da=d1(ih);
    sa1=sign(real(da));
    sa2=sign(imag(da));
    for ik=1:lv
        db=d2(ik);
        sb1=sign(real(db));
        sb2=sign(imag(db));
       if abs(da+db)<1e-6 && sa1*sb1<=0 && sa2*sb2 <=0
            pt(ih,ik)=1;
            d2(ik)=1e10;
            continue
        end
    end
end
p2=pt*D2/pt;
p2=diag(p2);%转换之后的特征值

实际操作中发现这样做会出现一些问题,计算出的单位转换矩阵pt是奇异的。这是因为有个别特征值特别小,但却不是零,比如原系统特征值为2.0768e-11+5.3803e-07i,2.0768e-11-5.3803e-07i, 伴随系统的特征值为 -2.0768e-10+4.6803e-07i, -2.0768e-10-4.6803e-07i (此处注意,由于他们非常小,尽管看起来并不是相反数,但是他们确实应该是相对应的特征值。)。大家有没有什么好办法可以解决这种问题?
我试过用sort函数排序的方法,但是复特征值含有共轭复数,即若a+bi是系统的特征值,那么a-bi也是系统的特征值,排序之后仍然是混乱的,原系统与伴随系统的特征值不能一一对应。
下面是给出的原系统与伴随系统的特征值,
d1=[-1845.49541213810 + 0.00000000000000i-1845.49541213808 + 0.00000000000000i
-1845.40941094619 + 0.00000000000000i
-1845.40941094621 + 0.00000000000000i
-472.246223347626 + 0.00000000000000i
-472.246350993078 + 0.00000000000000i
-472.071455473269 + 1.46667655355149e-06i
-472.071455473269 - 1.46667655355149e-06i
-227.352615221296 + 0.00000000000000i
-230.021473271048 + 0.00000000000000i
-257.246014837252 + 0.00000000000000i
-257.248713756431 + 0.00000000000000i
-6.48933405731889 + 170.480224870405i
-6.48933405731889 - 170.480224870405i
-6.48796291014994 + 170.493802983727i
-6.48796291014994 - 170.493802983727i
-71.5820046916887 + 40.0406357190903i
-71.5820046916887 - 40.0406357190903i
-71.5819199801466 + 40.0405877748384i
-71.5819199801466 - 40.0405877748384i
-17.4525889721331 + 93.5698350764033i
-17.4525889721331 - 93.5698350764033i
-17.2414873474845 + 93.7448478937123i
-17.2414873474845 - 93.7448478937123i
-22.4007205149178 + 50.6774878787548i
-22.4007205149178 - 50.6774878787548i
-22.5218905614466 + 50.6104821982531i
-22.5218905614466 - 50.6104821982531i
-41.3615158353333 + 60.8231190900376i
-41.3615158353333 - 60.8231190900376i
-41.4397812852449 + 60.8390786811484i
-41.4397812852449 - 60.8390786811484i
-0.502311317644877 + 21.8489330692530i
-0.502311317644877 - 21.8489330692530i
-0.368133272358209 + 19.2410921507305i
-0.368133272358209 - 19.2410921507305i
-26.4864864864970 + 49.7679054409655i
-26.4864864864970 - 49.7679054409655i
-1.03372368587870 + 27.7765957071689i
-1.03372368587870 - 27.7765957071689i
-1.26065995471749 + 26.9781051685545i
-1.26065995471749 - 26.9781051685545i
-26.4864864865794 + 49.7679054409201i
-26.4864864865794 - 49.7679054409201i
-0.214078698340815 + 8.30599258375584i
-0.214078698340815 - 8.30599258375584i
-0.216363678460396 + 8.31033068469545i
-0.216363678460396 - 8.31033068469545i
-15.3205924021527 + 8.87343017676416i
-15.3205924021527 - 8.87343017676416i
-15.3123715291150 + 8.86444778856135i
-15.3123715291150 - 8.86444778856135i
-0.859131738977660 + 2.70498943994292i
-0.859131738977660 - 2.70498943994292i
-4.33195394652078 + 7.56852409752328i
-4.33195394652078 - 7.56852409752328i
-2.05752258514469 + 8.04806868511919i
-2.05752258514469 - 8.04806868511919i
-1.34774144613383 + 7.10197859505354i
-1.34774144613383 - 7.10197859505354i
2.07681605256731e-11 + 5.38032719750580e-07i
2.07681605256731e-11 - 5.38032719750580e-07i
-0.0132663696591051 + 0.00000000000000i
-1.63914794555864 + 0.00000000000000i
-1.67478033670299 + 0.00000000000000i
-2.67474850493452 + 4.40080074654108i
-2.67474850493452 - 4.40080074654108i
-0.00519642624549730 + 1.61371615705890i
-0.00519642624549730 - 1.61371615705890i
-0.868892400794832 + 0.00000000000000i
-1.49160196032936 + 0.00000000000000i
-1.79757877145070 + 0.00000000000000i
-1.79757877145070 + 0.00000000000000i
-1.79757877145070 + 0.00000000000000i
];
d2=[1845.49541213830 + 0.00000000000000i1845.49541213727 + 0.00000000000000i
1845.40941110159 + 0.00000000000000i
1845.40941096886 + 0.00000000000000i
472.246223333173 + 0.00000000000000i
472.246351038889 + 0.00000000000000i
472.071455361579 + 1.54773006872165e-06i
472.071455361579 - 1.54773006872165e-06i
227.352615214860 + 0.00000000000000i
230.021473270564 + 0.00000000000000i
257.246014843452 + 0.00000000000000i
257.248713756431 + 0.00000000000000i
6.48933405561265 + 170.480224869684i
6.48933405561265 - 170.480224869684i
6.48796291317492 + 170.493802978534i
6.48796291317492 - 170.493802978534i
71.5819210922911 + 40.0405890598264i
71.5819210922911 - 40.0405890598264i
71.5820035755639 + 40.0406758486132i
71.5820035755639 - 40.0406758486132i
17.4525889747017 + 93.5698350741143i
17.4525889747017 - 93.5698350741143i
17.2414873428462 + 93.7448478993427i
17.2414873428462 - 93.7448478993427i
22.4007205149522 + 50.6774878785696i
22.4007205149522 - 50.6774878785696i
22.5218905614540 + 50.6104821981667i
22.5218905614540 - 50.6104821981667i
41.4397812819266 + 60.8390786801042i
41.4397812819266 - 60.8390786801042i
41.3615158377171 + 60.8231190915288i
41.3615158377171 - 60.8231190915288i
0.502311317645489 + 21.8489330691943i
0.502311317645489 - 21.8489330691943i
0.368133272354303 + 19.2410921507901i
0.368133272354303 - 19.2410921507901i
26.4864865629449 + 49.7679054241678i
26.4864865629449 - 49.7679054241678i
26.4864863791970 + 49.7679051716666i
26.4864863791970 - 49.7679051716666i
1.26065995539485 + 26.9781051746779i
1.26065995539485 - 26.9781051746779i
1.03372368593679 + 27.7765957022649i
1.03372368593679 - 27.7765957022649i
0.214078698064999 + 8.30599258420587i
0.214078698064999 - 8.30599258420587i
0.216363678737156 + 8.31033068427801i
0.216363678737156 - 8.31033068427801i
15.3205924011961 + 8.87343017677397i
15.3205924011961 - 8.87343017677397i
15.3123715306390 + 8.86444778799157i
15.3123715306390 - 8.86444778799157i
0.859131738964256 + 2.70498943991775i
0.859131738964256 - 2.70498943991775i
4.33195395197359 + 7.56852410116958i
4.33195395197359 - 7.56852410116958i
2.05752257059278 + 8.04806869613838i
2.05752257059278 - 8.04806869613838i
1.34774145893408 + 7.10197857616945i
1.34774145893408 - 7.10197857616945i
1.67478033669343 + 0.00000000000000i
1.63914794555619 + 0.00000000000000i
-1.27153691789202e-09 + 0.00000000000000i
0.0132663696577159 + 0.00000000000000i
2.67474850401787 + 4.40080075316935i
2.67474850401787 - 4.40080075316935i
1.26928634880750e-09 + 0.00000000000000i
0.00519642642094953 + 1.61371615688535i
0.00519642642094953 - 1.61371615688535i
0.868892400807678 + 0.00000000000000i
1.79757877145070 + 0.00000000000000i
1.49160196017972 + 0.00000000000000i
1.79757877145070 + 0.00000000000000i
1.79757877145070 + 0.00000000000000i
];

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2012-10-13 11:52 | 显示全部楼层
中用series两个的串联形式?我总是出错!!以及中的你给出了传递分子分母系数,必须先用tf函数将其转化为系统,feedback函数
 楼主| 发表于 2012-10-13 22:19 | 显示全部楼层

?不好意思,没看懂你的回复。
 楼主| 发表于 2012-10-13 23:17 | 显示全部楼层
想出来一个办法
d1=diag(D1);
d2=diag(D2);
dr1=real(d1);
di1=imag(d1);
dr2=real(d2);
di2=imag(d2);
de1=[dr1 di1];
de2=[dr2 di2];
[p1,pk1]=sortrows(de1,[2 1]);
[p2,pk2]=sortrows(de2,[-2 -1]);
搞定
 楼主| 发表于 2012-10-14 10:32 | 显示全部楼层
勘误:
[MA,KB]=qianchuli(V);%质量阵,刚度矩阵
[V1,D1]=eig(KB,-MA);%原系统特征向量及特征值
[V2,D2]=eig(KB.',MA.');%伴随系统特征向量及特征值
d1=diag(D1);
d2=diag(D2);
dr1=real(d1);
di1=imag(d1);
dr2=real(d2);
di2=imag(d2);
de1=[dr1 di1];
de2=[dr2 di2];
[d11,pk11]=sortrows(de1,2);
[d12,pk12]=sortrows(de2,-2);
[~,pk21]=sortrows(d11,1);
[~,pk22]=sortrows(d12,-1);
lv=74;%自由度个数
pt11=zeros(lv,lv);
pt12=zeros(lv,lv);
pt21=zeros(lv,lv);
pt22=zeros(lv,lv);
for ih=1:lv
    pm11=pk11(ih);
    pm12=pk12(ih);
    pm21=pk21(ih);
    pm22=pk22(ih);
    pt11(ih,pm11)=1;
    pt12(ih,pm12)=1;
    pt21(ih,pm21)=1;
    pt22(ih,pm22)=1;
end
pt1=pt21*pt11;%原系统转换矩阵
pt2=pt22*pt12;%伴随系统转换矩阵
p11=pt1*D1/pt1;
p11=diag(p11);%原系统转换后的特征值
p12=pt2*D2/pt2;
p12=diag(p12);%伴随系统转换后的特征值
Vt1=V1/pt1;%原系统转换后的特征向量
Vt2=V2/pt2;%伴随系统转换后的特征向量
发表于 2013-2-12 22:40 | 显示全部楼层
排序的算法,有相关的经典程序的
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-25 22:25 , Processed in 0.115694 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表