Modeling an eccentric shaft with Simscape

5 次查看(过去 30 天)
I am trying to model an eccentric shaft in the simscape mechanical domain, i.e. a linear displacement varying sinusoidally with a frequency proportional to the angular displacement of a shaft. I have written a component for this (see below) that seems to be working, however it is very slow to solve. Does anyone have any advice on how to make this model run more efficiently, or if there is a different method that would achieve the same thing? I have also tried using just a linear velocity source, however the displacement was drifting over time and causing the simulation to crash.
Thanks,
Martin
component EccentricShaft
nodes
A = foundation.mechanical.rotational.rotational; % A:left
P = foundation.mechanical.translational.translational; % P:right
end
parameters
offset = { 0, 'rad'}; % Initial angular position
initPos = {0, 'm'}; % Initial linear position
eccentricity = { 0.05, 'm'}; %Shaft Eccentricity
initV = {0, 'm/s'}; %Initial linear velocity
initomega = {0,'rad/s'}; %Initial angular velocity
end
variables(Access = private)
V = {value = initV, priority = priority.high}; % V:Left
X = {value = initPos, priority = priority.high}; % X:Left
F = { 0, 'N' }; % F:Left
theta = {value = offset, priority = priority.high} % theta:Right
omega = {value = initomega, priority = priority.high}; % omega:Right
tau = { 0, 'N*m'}; % tau:Right
end
branches
tau : A.t -> *;
F : P.f -> *;
end
equations
assert(eccentricity>0)
X - eccentricity/2*(1-cos(theta)) == 0;
V == P.v;
omega == A.w;
X.der == V;
theta.der == omega;
F*V - omega*tau == 0;
end
end

回答(1 个)

Olalowo Olaleye
Olalowo Olaleye 2019-9-19
A more diligent and concise approach must be used here.

类别

Help CenterFile Exchange 中查找有关 Creating Custom Components and Libraries 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by