Bouc wen model in simscape model

16 visualizzazioni (ultimi 30 giorni)
HUANG ZI YOU
HUANG ZI YOU il 10 Mar 2022
Modificato: Alexander S il 22 Feb 2024
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

Risposte (1)

Lokesh
Lokesh il 13 Gen 2024
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 Commenti
Alexander S
Alexander S il 22 Feb 2024
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
Alexander S
Alexander S il 22 Feb 2024
Modificato: Alexander S il 22 Feb 2024
This works now.

Accedi per commentare.

Categorie

Scopri di più su Foundation and Custom Domains in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by