조회 수: 16(최근 30일)

Bjorn Gustavsson
8 Jul 2020

Yeah, I think that should be the correct test. In the modeling you do you have rather big difference in spring constant. When I test with this simplified version:

f_assyspring = @(t,y) [y(2);-y(1)*(1+1*double(sign(y(1))==sign(y(2))))];

t = linspace(0,50,3001);

y0 = [1,1];

[T2,Y2] = ode45(f_assyspring,t,y0);

subplot(2,1,1)

ph = plot(T2,Y2);

axis([0 20 -2 2])

grid on

legend(ph,'y-displacement','y-velocity')

subplot(2,1,2)

plot(T2,gradient(Y2(:,2),T2))

axis([0 20 -2 2])

legend('y-acceleration')

grid on

The solution behaves OK - in a mathematical sense.

However, from a physical point-of-view, this physical model decays rapidly - because it dissipates energy at the turning-points when there is a switch to the smaller spring-constant - at that point the simple Hooksian sping has a lot of stored energy (proportional to |ky^2| IIRC). By switching spring-constant there the difference in stored energy is magiced-away - which feels dodgy to me, for dampers I can see that it would be possible to have different leveles of dissipation in different directions.

Bjorn Gustavsson
6 Jul 2020

ODE45 takes a function, f(t,y), describing the differential equation.

You have a differential equation something like this

where k has one value if the spring moves in one direction (dy/dy < 0) and another value when the spring moves in the other direction - how you connect those forces at the points where the velocity is zero I do not know.

ODE45 takes functions describing first-order odes, so the way to implement equations of motions is to convert the second-order ODE to 2 coupled first-order odes. That way we get something like this:

function dydtdvdt = your_ode(t,y)

k_p = 12; % Or whatever your spring-constants over mass are...

k_n = 10;

if y(2) > 0

a = -k_p * y(1);

else

a = -k_n * y(1);

end

dydtdvdt = [y(2);

a];

end

Then you call ODE45 with this function the time-period of interest and the initial conditions (y(0) and v(0)), and then you get the numerical solution to your ODE. If you have a damper you'll have to add that force-term too.

HTH

Bjorn Gustavsson
8 Jul 2020

So that characteristic you should be able to implement as a combination of checks on the velocity, and the sign of y, you get four cases to check for.

However, this model will have an assymetry around the turning-points where changes sign. That is where the |ky| will be at its maximum. How you see this connected to the physics of the springs is up to you, but to me it looks peculiar.

ODE45 uses a 4-5 version of Runge-Kutta, so the Wikipedia-page should be a good introduction. If you need to get into the details the function is implemented in plain .m-code so you can read it, there are also references to publications in the ode45.m file.

Opportunities for recent engineering grads.

Apply Today
## 댓글 수: 5

## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926414

⋮## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926414

## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926465

⋮## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926465

## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926582

⋮## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926582

## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926645

⋮## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926645

## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926660

⋮## 이 댓글에 대한 바로 가기 링크

https://kr.mathworks.com/matlabcentral/answers/559952-asymmetric-spring-with-two-different-stiffnesses#comment_926660

Sign in to comment.