Bouc wen model in simscape model

16 次查看(过去 30 天)
I am trying to build the Bouc wen model in simscape.
But when I run the model in simulink, the error message shows up.
Found nonlinear expression involving time derivatives. |In bouc_wen_model (line 33)
component bouc_wen_model
nodes
r = foundation.mechanical.translational.translational;
c = foundation.mechanical.translational.translational;
end
parameters
fy = {1800000,'N'}; %yield force
uy = {0.01,'m'}; %yield displacement
a = 0.1; %post yield ratio
n = 2;
beta = 0.1;
gama = 0.9;
end
branches
f : r.f -> c.f;
end
variables
x = { value = { 0, 'm'}, priority = priority.high }; % Deformation
f = {0,'N'};
v = {0,'m/s'};
z = {value = { 0, '1'}, priority = priority.high};
end
equations
f == a*(fy/uy)*x+(1-a)*fy*z;
z.der == (1-((abs(z))^n)*(beta+sign(x.der*z)*gama))*x.der/uy;
v == r.v-c.v;
v == x.der;
end
end

回答(1 个)

Lokesh
Lokesh 2024-1-13
Hi,
I see that you are encountering an issue with your Simscape model.The error message "Found nonlinear expression involving time derivatives" indicates that there is an issue with the way time derivatives are used in your Simscape equations.
In your case, the problematic line seems to be:
z.der == (1-((abs(z))^n)*(beta+sign(x.der*z)*gama))*x.der/uy;
It appears that you are trying to include a nonlinear function of the derivative "x.der" and the variable "z" in the expression for "z.der". Simscape requires that the derivatives be isolated and not involved in nonlinear expressions. To fix the issue, you can introduce an intermediate variable to represent the nonlinear term and then differentiate that variable.
Here's an example of how you might restructure your equations:
component bouc_wen_model
nodes
r = foundation.mechanical.translational.translational;
c = foundation.mechanical.translational.translational;
end
parameters
fy = {1800000,'N'}; %yield force
uy = {0.01,'m'}; %yield displacement
a = 0.1; %post yield ratio
n = 2;
beta = 0.1;
gama = 0.9;
end
branches
f : r.f -> c.f;
end
variables
x = { value = { 0, 'm'}, priority = priority.high }; % Deformation
f = {0,'N'};
v = {0,'m/s'};
z = {value = { 0, '1'}, priority = priority.high}; % Hysteresis variable
w = {0, '1'}; % Intermediate variable for nonlinear term
end
equations
f == a*(fy/uy)*x + (1-a)*fy*z;
% Define the nonlinear term using an intermediate variable 'w'
w == (1-((abs(z))^n)*(beta+gama*sign(x.der*z)));
% Now, differentiate 'w' to find 'z.der'
z.der == w*x.der/uy;
v == r.v - c.v;
v == x.der;
end
end
In this revised code,an intermediate variable w is used to capture the nonlinear term involving "z" and "x.der". The derivative "z.der" is then computed using "w" and "x.der/uy", which avoids nonlinear operations on the derivative itself.
Please refer to the following MathWorks documentation to know more about ‘der’ in simscape:
I hope this resolves your query.
Best Regards,
Lokesh
  2 个评论
Alexander S
Alexander S 2024-2-22
Thank you for this response, the code you posted still has the same error due to the nonlinear expression sign(x.der). This could be solved by replacing x.der with v.
component bouc_wen_hysteresis
nodes
r = foundation.mechanical.translational.translational; % r:left
c = foundation.mechanical.translational.translational; % c:right
end
parameters
fy = {1800000,'N'}; %yield force
uy = {0.01,'m'}; %yield displacement
a = 0.1; %post yield ratio
n = 2;
beta = 0.1;
gama = 0.9;
end
branches
f : r.f -> c.f;
end
variables
x = { value = { 0, 'm'}, priority = priority.high }; % Deformation
f = {0,'N'};
v = {0,'m/s'};
z = {value = { 0, '1'}, priority = priority.high}; % Hysteresis variable
w = {0, '1'}; % Intermediate variable for nonlinear term
end
equations
f == a*(fy/uy)*x + (1-a)*fy*z;
% Define the nonlinear term using an intermediate variable 'w'
w == (1-((abs(z))^n)*(beta+gama*sign(v*z)));
% Now, differentiate 'w' to find 'z.der'
z.der == w*x.der/uy;
v == r.v - c.v;
v == x.der;
end
end

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Foundation and Custom Domains 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by