solving a 1 DoF MSS-Spring-Damper when the spring stiffness is a function of displacement
4 views (last 30 days)
Show older comments
Hello guys,
I'm trying to solve a 1 DoF SMD system whith an external force (as a function of time) and a step spring stiffness as a function of the displacement.
Actually, after reaching a specific displacement, there would be a secondary spring (in parallel) so the total stiffness is afunction of displacement.
Any help would be appreciated.
2 Comments
Answers (1)
Sam Chak
on 18 Feb 2023
If the system is stiff, then you can try using the ode15s() solver.
In the following example, the external force f(t) is assumed a unit step function.

% Parameters
m = 1;
b = 2;
k1 = 1;
k2 = 1;
xd = 0.5;
% Settings
% x(1) is the position of the spring
% x(2) is the time derivative of x(1)
odefun = @(t, x) [x(2);
(heaviside(t) - b*x(2) - k1*x(1) - k2*((x(1) - xd).*heaviside(x(1) - xd)))/m];
tspan = [0 15];
x0 = [0 0];
% Solving and plotting
[t, x] = ode15s(odefun, tspan, x0);
plot(t, x), grid on
xlabel('t'), ylabel('\bf{x}')
legend('x_1', 'x_2', 'location', 'east')
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!