How does one switch on/off a load or driver based on a measure value.
Simple scenario is we don't know precisely when a limit will be reached and I might want a spring/damper to stop working (pretend something has broken) or another piece of mechanism to begin it's motion.
The conditions appear to be dependent on time domains only.
Will we get flexible beams in mechanism?
I can do this in Mechanica motion,
This can be done! I've applied it hundreds of times (even back in "Mechanica Motion" for you long-time, hard core users!) - the trick is creating a "User Defined" measure that acts as an "on-off" flag. Say you wish to stop a spring from working if the displacement of a body it's connected to moves beyond a certain location, for example >10. This position is monitored by a measure you already have called "dist". Now, create a "User Defined" measure (call it "spring_limit") that has a relation in it to check for the value of this existing measure that is your contiional parameter, "dist", and create the function like this:
dist <= 10
Now, anytime that the value of "dist" is less than or equal to 10, the value for "spring_limit" will equal 1 (one). If the condition is "false" (dist > 10), the value of "spring_limit" will equal 0 (zero). You then use this flag to multiply it by a user defined force which represents your spring, and if the distance of the body goes beyond 10, the value of your spring force will be zero. Your user defeined spring force fucntion may look like this:
spring_limit * K * dist
Where "K" is your spring constant. This approach will allow you to create some very complicated forcing functions.
BTW - I'm curious how you did this in MM.
... I was hoping for a nerdy day, got pulled away onto dull stuff, back now.
In MM I did this in a similar manner except I added in the use of the 'minimum' function to the conditional statement so that when it went to zero it stayed zero. Most of the forces were polynomial point to point.
The problem with the method you describe is that if 'dist' drops again, the spring becomes active again. In my mechanism I need it to 'break', permanently regardless of later motion.
The 'minimum' function stores the smallest value of the function regardless of what happens later. I don't think there is a 'minimum' function in Mechanism.
Is there a 'minimum' function in Mechanism Dynamics?
Or is there another way to permanently switch something off as a result of meeting a condition (regardless of the time that condition is met) ?
I've not had time yet to find an old example or make a sample one, but I've used counters before in a user defeined measure that would count occurances and flag other items to be active or inactive. Have a measure set a flag from one to zero if the object goes beyond the maximum distance AND count how many times this will occur. You can also use flags on the velocity of an object to check its direction as well to help set the flag(s) needed. If the count flag is at least one, multiply your user defined spring by zero (or another flag based on this situation) and the object will never be connected to the spring.
Does this spark an ideas? I'll try an example and share it when I get time to work it out.