RecurDyn/CoLink
is a complete CAE solution for design and simulation of
multi-body dynamic (MBD) and control systems with Embedded Ch.
RecurDyn is developed by
FunctionBay, Inc., a global leader in CAE solutions.
It is a enterprise CAE software for
design and simulation of
multi-body dynamics,
FEM, finite element analysis, control, computational fluid dynamics, and optimization.
Embedded Ch is used in RecurDyn for scripting and numerical computing.
With Embedded Ch, RecurDyn/CoLink
can be used to design and simulate controllers of dynamic systems
containing both rigid and flexible bodies in C/C++ scripts and blocks.
Below is a detailed example illustrating its applications.
Problem definition:
Inverse problem of an optic block.
A laser beam is come into an optic block with an incidence angle. Its refracted ray of light arrives on substrate. One needs to know the rotational velocity profile of the optic block for the movement of refracted ray at a constant velocity.
Solution: Although it can be resolved with multi body dynamics modeling with bodies, and constraints, it is much easier to get the solution with Ch-script function.
The RecurDyn model is modeled with two bodies, one translational joint with predefined motion(constant velocity), and one revolute joint. The motion of revolute joint takes the calculated result from ch function. The RecurDyn 3D model is shown below.
To use Ch function in RecurDyn. It is available in RecurDyn/CoLink.
RecurDyn/CoLink model consists of one ch function block, and one RecurDyn plan block with one plant input and output.
The RecurDyn/CoLink model is shown below.
(Click to enlarge)
The key function to solve this problem is the function
fsolve() the Ch numerical library. This function solves the equation
Where,
t = thickness (known),
n = index of refraction (known)
L = it is predefined motion in RecurDyn model
With this condition, and
the function fsolve(), we can get 'θ'.
It is the motion of revolute joint.
The script in the Ch function block is shown below.
#include
#include
#include
...
void func(double x[], double f[])
{
...
f[0]= position - t*(tan(x[0]) - sin (x[0])/sqrt(n*n-sin(x[0])*sin(x[0])) );
...
}
int ChFunction(double* y, double* u)
{
'''
status=fsolve(x, func, x0);
'''
}
As a result of this simulation, we can get motion of resolute joint in radians or degrees
as shown below. At the same time, we can also get the joint velocity and acceleration profiles
from RecurDyn.
|