# Bouc-Wen参数仿真.rar

• Holf
了解作者
• WINDOWS
开发工具
• 5KB
文件大小
• rar
文件格式
• 0
收藏次数
• 10 积分
下载积分
• 39
下载次数
• 2017-10-23 19:55
上传日期

Bouc-Wen参数仿真.rar
• Bouc-Wen参数仿真
• CompareN.m
1.1KB
• BoucWenSim.m
528B
• CompareBetaGamma.m
2.9KB
• CompareGamma.m
1.2KB
• CompareAlpha.m
1.1KB
• CompareBeta.m
1.2KB

function CompareBetaGamma(beta,gamma) rmpath ..\CommFiles addpath ..\CommFiles bSetGamma = false; bSetBeta = false; if nargin < 1 clear all close all clc bSetGamma = true; bSetBeta = true; end %% Bouc-Wen模型 % Bouc-Wen模型由两部分组成： % 1) 非记忆部分——g(x,dx/dt) % 2) 记忆部分——z(x) % 其中z(x)用以下所示的微分方程表达: % dz/dt = -beta*abs(dx/dt)*z^n - gamma*dx/dt*abs(z)^n+alpha*dx/dt (n=1,3,5) % dz/dt = -beta*abs(dx/dt)*abs(z)*z^(n-1) - gamma*dx/dt*z^n+alpha*dx/dt (n=2,4,6) % 定义各参数 alpha = 1;n=1; if bSetGamma gamma = [ 0.4, 0.6, 0.6, -0.6, -0.6, 0.2, 0.5, 0.4]; end if bSetBeta beta = [ 0.6, 0.4, 0.6, 0.4, 0.6, 0.8, 0.5, 0.6]; end LenGamma = length(gamma); %% 绘图准备 hFig = figure('Name','Beta与Gamma对曲线形状的影响'); hold on whitebg(hFig,'black'); grid on szStyle = {'w-','y-','g-','r-','c-','m-'}; szTitle = { 'beta+gamma>0,beta-gamma>0' 'beta+gamma>0,beta-gamma<0' 'beta+gamma>0,beta-gamma=0' 'beta+gamma<0,beta-gamma>0' 'beta+gamma=0,beta-gamma>0' 'beta+gamma=constant' }; %画2行3列的图 RowCnt = 2;ColCnt = 3; Width = 0.3; %每幅图宽度占整个图的百分比 Height = 0.4; %每幅图高度占整个图的百分比 SpaceCol = (1 - ColCnt * Width) / (ColCnt + 1); %图之间的列间隙占的百分比 SpaceRow = (1 - RowCnt * Height) / (RowCnt + 1); %图之间的行间隙占的百分比 PlotPos = cell(RowCnt,ColCnt); PlotPosSize = size(PlotPos); StartL = SpaceCol; %每行第一幅图的Left值 StartB = 1 - SpaceRow - Height; %第一行的Bottom值 for i = 1:PlotPosSize(1) for j = 1:PlotPosSize(2) PlotPos{i,j} = [StartL,StartB,Width,Height]; StartL = StartL + Width + SpaceCol; end StartL = SpaceCol; StartB = StartB - SpaceRow - Height; end %% 仿真 options = odeset('RelTol',1e-4,'AbsTol',1e-7); tspan = [0:0.05 * pi:6 * pi]; A = [0.5,1,2]; initial = 0; hPlots = zeros(1,length(A)); szLegend = cell(1,length(A)); for i = 1:PlotPosSize(1) * PlotPosSize(2) subplot('Position',PlotPos{i}); grid on hold on if i == PlotPosSize(1) * PlotPosSize(2) for j = 1:length(beta) - PlotPosSize(1) * PlotPosSize(2) + 1 for k = 1:length(A) [t,y] = OdeSim('ode45',@zHysteresis,tspan,initial,options,alpha,beta(i + j - 1),gamma(i + j - 1),n,A(k)); x = Excitation(t,A(k)); idxStart = find(t >= 4 * pi,1); hPlots(j) = plot(x(idxStart:end),y(idxStart:end),szStyle{j}); end szLegend{j} = ['beta=',num2str(beta(i + j - 1)),',gamma=',num2str(gamma(i + j - 1))]; end else for j = 1:length(A) [t,y] = OdeSim('ode45',@zHysteresis,tspan,initial,options,alpha,beta(i),gamma(i),n,A(j)); x = Excitation(t,A(j)); idxStart = find(t >= 4 * pi,1); hPlots(j) = plot(x(idxStart:end),y(idxStart:end),szStyle{j}); szLegend{j} = ['x = ',num2str(max(x))]; end end legend(hPlots,szLegend,'Location','Northwest') title(szTitle{i}); end end

相关推荐