Skip to main content
10-Marble
December 18, 2023
Solved

Combining ODE with a IF function

Dear all,

 

May I ask if anyone knows how to combine this 'if' function with these differential equations? k3 is a spring where the stiffness depends on the position of mass 3. In the attachment, I managed to achieve this in Python, but I didn't manage to do this in Mathcad.

 

Could someone help me so that I know for next time?"

 

Thanks in advance.

Werner_E
Werner_EAnswer
25-Diamond I
December 18, 2023

Hope this helps:

Werner_E_0-1702907626200.png

 

3 replies

Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
December 18, 2023

Hope this helps:

Werner_E_0-1702907626200.png

 

Translate
10-Marble
December 20, 2023

Dear Werner_E

 

Thank you it worked perfectly and I have only one remaining question. If I want to add the damping coefficient as add on in a function depending on speed it won't allow me to do this. It is not required for now but if i want to add this how do you handle this?

 

Thank you in advance

 

 

Translate
Werner_E
25-Diamond I
December 20, 2023

c3 and k3 are now functions dependent on the current value of x3(t).

So you must change every occurrence of c3 to c3(x3(t)) and the same for k3

 

Translate