Skip to main content
14-Alexandrite
April 18, 2026
Question

ODEsolve problems again!

  • April 18, 2026
  • 6 replies
  • 447 views

Hi, I am trying to solve an ODE to model a “Ball and Cone” tuned mass damper. The equations simulate a ball mounted inside a pair of cones with mass on top. The ball oscillates up and down an inclined slope with a curved region at the apex between the up/down slopes. I am using Radau solver as it is a stiff equation. Adams/BDF “does not converge”. The 1st solve block uses a simplified simulation for base excitation of the TMD. Using Radau with modest levels of damping the first solve block result gives a discontinuous response which should not happen given the inclined slope is a tangent to the curved section at the apex. Any ideas how I can correct this discontinuity would be appreciated.

I tried using sigmoid transition functions (2nd solve block) for the step between inclined slope and radius but this gives a large number error.

The 3rd solve block includes an extra degree of freedom to simulate the tower on which the damper is mounted, which is the aim of the program. This won’t solve either with “too few IC’s”, when I believe I have the correct number for the 2 x 2nd order equations.

Any assistance will bring a smile to my face!

Thanks Ross

 

6 replies

25-Diamond I
April 18, 2026

Just a few remarks…

1)  You can speed up calculation if you define AA(t) as the second derivative of X(t) instead of being the first derivative of V(t).

2)  You have a typo in your third solve block. You typed Fo instead of F.0

3)  The first equation in your third solve block is not using function xu. So you could omit the second equation and only solve for x(t) 

In case you need xu as well you could follow up with a separate solve block for xu(t) once you have solved for x(t)
EDIT: I tried and got a “calculation does not converge” error

 

You actually can use two equations with two unknown functions in the solve block but you have to use the correct syntax:

We cannot extend the integration interval to more than 2 as this would throw an error (“This solution exceeds the maximum number of integration steps”). 

Plotting the function shows that we get a result quite different  from the above for the first second.
X(0)=0 is not respected, rather we see X(0)=52.6 and if we use more steps (like 100*Ns instead of just Ns) we even see X(0) to be up to 5000 and more!

The plot at the lower right compares the solution we get when we just solve for x(t) (X1, green) with the solution we get when we solve for x and xu in the same solve block.

 

Can’t explain the effects, just noticed them. Hope it may help you to fix the problem.

 

EDIT: Additional unexplainable strange effects with the last solve block (solving for both x and xu):

.) if the interval limit is changed from 2 to just 1 we get a result which matches pretty well the one we get when just solving for x(t) and we also see X(0)=0.

.) if the interval limit is changed from 2 to 1.5 wee see and error (again about exceeding the max. number of integration steps)

.) Is this the expected behaviour?

 

remslie14-AlexandriteAuthor
14-Alexandrite
April 18, 2026

Werner,

Your rapid response time is appreciated. Thanks for the tip on faster solve for AA(t).

My syntax errors catch me every time…. embarassing!

Since this is a coupled system I wish to solve for x and xu simultaneously. If I substitute x’’(t) into the xu’’(t) equation I now get “too many IC’s”!!! If I remove x(0)=0, still too many IC’s. If I remove both x(0)=0 and x’(0)=0 I still get too many IC’s. I’m not sure I will every understand the nuances of Odesolve! Iam sure there is a simple solution?

Regards,

Ross

25-Diamond I
April 18, 2026

Since this is a coupled system I wish to solve for x and xu simultaneously.

It’s not coupled. The first equation for x’’(t) is not using xu(t) or its derivatives.

Its just xu(t) which is depending on x(t) . So you can solve for x(t) first and only after that you may solve for xu(t) (which failed in my attempt, so I suspect that the second equation may need modifications).

As I had shown we get the same result for x(t) whether we solve for x(t) alone or for x(t) AND xu(t) simultaneously - at least starting with approx t=0.8, sometimes even from t=0 (if the interval just runs from 0 to 1 and not up to 2). I did not understand why the interval length of 1 and 2 worked, but 1.5 threw an error. Again I suspect the correctness of the second equation for xu(t). However, my technical understanding isn't sufficient to grasp this equation, let alone refine it.

 

If I substitute x’’(t) into the xu’’(t) equation I now get “too many IC’s”!!! If I remove x(0)=0, still too many IC’s. If I remove both x(0)=0 and x’(0)=0 I still get too many IC’s.

I am not sure what the problem is and what you substitute where. Did you succeed in duplicating what I had shown in this picture and did you work from that on?

Note that you have to fix the type with F.0 and change the syntax when using odesolve for a system of equations.

The above worked and gave the results shown in the previous answer.

Changing t.end from  “2” to “1” even gave the very same (upon optical inspection) result than solving just for x(t) alone without using the second equation for xu”(t).

But as already said the whole thing is quite instable and confusing as changing the “2” to “1.5” gave an error.

In contrast, there seems to be no problem or limit with the upper t-bound when we use only the equation for x"(t).
This is one reason to be wary of the equation for xu.

Here what I get for an upper bound of t=200

 

19-Tanzanite
April 20, 2026

There seems to be a mismatch between your copied text equations and your H and G functions.  The former are:

 

The terms in the red and blue boxes are not just 1 and 0, but your H and G functions are.  

Unfortunately, correcting this doesn’t solve your discontinuity problem!

 

remslie14-AlexandriteAuthor
14-Alexandrite
April 21, 2026

Alan, Werner,

  1. Thank you both for your assistance. Alan, I can’t imagine what I was thinking when I formulated the G and H funtions in the ODE. A real brain fade! When you adjust G and H to be a function of just xu(t) you start to get answers that look quite believable.

The ability to solve is very sensitive to IC’s and length of time interval. The solves seem to cope when there is a minimum xu= d which is the transition point between G and H. There is still a discontinuity which grows in magnitude towards the end of the integration interval and I suspect this is what is triggering the crash in the solve for larger tend.

I cannot seem to get a solution longer than 11 seconds. I am interested in the solution when the initial transients have died out. Is there any way you know how I can increase the interval to say 60 seconds or beyond, so I can look at the results between say 55 to 60 seconds? When I try xu(55)=d, xu’(55)=0 it still triggers a transient that outlasts the 5 second window.

Cheers

Ross

19-Tanzanite
April 21, 2026

I’ve reformulated the equations as in the attached. They get to 60 seconds ok.  No idea if the results are meaningful though!

 

  

 

19-Tanzanite
April 21, 2026

Hmm, just noticed that I assumed d was a time, whereas it should be a distance!  The acceleration function therefore needs to be changed as follows:

This alters the outputs of course, but it still evaluates for 60 seconds, with the following result:

 

 

remslie14-AlexandriteAuthor
14-Alexandrite
April 21, 2026

Alan,

Thanks for that re-formulation of the problem. I am not sure this approach works for the more recent (and final) version of the problem “Roller and Cone TMD_Rev2c” (attached above) where the extra DOF equation is included for x(t) as follows;

your thoughts would be appreciated.

Regards

Ross

remslie14-AlexandriteAuthor
14-Alexandrite
April 21, 2026

Alan,

Thanks for that re-formulation. I am not sure this will work for the latest (and final) version of the problem in “Roller and Cone TMD_Rev2c” (attached above) which includes an extra DOF for x(t).

Your comment would be appreciated.

Regards,

Ross

19-Tanzanite
April 22, 2026

Sure it works (with a small extension) - see the attached.  

 

remslie14-AlexandriteAuthor
14-Alexandrite
April 25, 2026

Alan,

Thanks again for your reply. With that solution I have probed a few test cases and realized I believe I need an additional term in Accn1(X,V,t) to couple the 2 DOFs. If I may, I will keep this post open for another couple of days in case I encounter further problems.

Best Regards,

Ross

Catalina
Community Moderator
May 14, 2026

Hi ​@remslie 

 

I wanted to see if you got the help you needed. 

 

If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question. 

 

Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks, 

Catalina | PTC Community Moderator