MapleSim Questions and Posts

These are Posts and Questions associated with the product, MapleSim


I'm writting a Modelica External component which use a C function, like this :

model SAMS.BlockUdpReceiver
    parameter Integer relativeSockId = 0 "Relative socket id (0..10)";
    parameter Integer stateUdp = 2 "state of receiver 1=receive data from udp ; 2=state from recorder config file";
    parameter Real step_time = 0.05 "sample time in second";
    parameter Integer nbDouble = 3 "number of double value to send";

    function udpReceiveDataMapleSim
        input Integer relativeSockId;
        input Integer stateUdp;
        input Real step_time;
        input Real currentTime;
        input Integer nbDouble;
        output Real dataToReceived[nbDouble];
    external "C"udpReceiveDataMapleSim(SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.relativeSockId, SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.stateUdp, SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.step_time, SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.currentTime, SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.nbDouble, SAMS.BlockUdpReceiver.udpReceiveDataMapleSim.dataToReceived)
            annotation (
                Library = "F:/SAMSSVN/workspaceMaple/SamsLibrary/x64/Debug/SamsDll.dll",
                __Maplesoft_callconv = "stdcall");
    end udpReceiveDataMapleSim;

    Modelica.Blocks.Interfaces.RealOutput dataReceived[nbDouble] annotation (Placement(
        visible = true,
            origin = {120, 50},
            extent = {
                {-20, -20},
                {20, 20}},
            rotation = 0),
            origin = {110, 50},
            extent = {
                {-10, -10},
                {10, 10}},
            rotation = 0)));
    when {initial(), sample(0, step_time)} then
        dataReceived = udpReceiveDataMapleSim(relativeSockId, stateUdp, step_time, time, nbDouble);
    end when;

    annotation (
        Diagram(coordinateSystem(extent = {
            {-100, -100},
            {100, 100}})),
        experiment(__Maplesoft_engine = 2),
end SAMS.BlockUdpReceiver;

I want MapleSim to call C function at initial() time and with a sampled period of step_time.

But, the function is called at each simulation step (here at 0.4 ms)

for demonstrate it, I print a log file each time the function is called.
this is a part of the result :

id Receiver =11 ; CurrentTime = 0.151200 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.151200 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.151200 while t_step=0.002000

id Receiver =11 ; CurrentTime = 0.151600 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.151600 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.151600 while t_step=0.002000

id Receiver =11 ; CurrentTime = 0.152000 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.152000 while t_step=0.002000
id Receiver =11 ; CurrentTime = 0.152000 while t_step=0.002000

Why C function is called so many time (3 times in a step), and why is called for each simulation step (0.4ms) instead of each 2 ms ?

Maybe I make a bug in my Modelica code ? or not ?

thanks for any reply.


Where I can found inverted pendulum on maple sim or good book?thanks

We’ve just released a major new version of MapleSim. The MapleSim 2017 family of products provides new and improved model development and analysis tools, expands modeling scope, introduces new deployment options, and strengthens toolchain connectivity.  Here are some highlights:

  • The new Initialization Diagnostics App further simplifies the initialization task by helping you determine how your initial values are computed and what you need to do to adjust them.
  • The new Modal Analysis App helps you explore and understand the natural vibration modes of your mechanism, so you can determine how to reduce the vibration in the final product. 
  • Over 100 new components include expansions to the Electrical and Magnetic libraries.
  • A new Modelica® code editor makes it easier to create Modelica-based custom components.
  • The MapleSim Heat Transfer Library from CYBERNET, a new add-on component library, provides a comprehensive view into heat transfer effects in your model, enabling you to refine your  design to improve performance and avoid overheating.
  • The new MapleSim Explorer product provides a cost-effective deployment solution that allows you to make MapleSim models available to more people in your organization.


There’s more, of course.  See What’s New in MapleSim for lots more details.


I have recently reinstalled the MapleSim 6.4 but the probe windows do not appeaar anymore.

The image below shows that there are 3 probes (none are disabled) and when I run the simulation nothing happens.,

please help me on check my schmitt2.msim schmitt's trigger 

I use Maple & MapleSim 2016. I linked my MapleSim model to Maple worksheet and ran it in the Maple.
After that, I wanted to make the compiled one by using "GetCompiledProc" command in Maple.
I know that this command helps making compiled model with some user-specified parameters.
However, if I try to compile my MapleSim Model, error message appears and process stops.

Error message: (In GetCompiledProc) numeric exception: division by zero

Is there anyone how to avoid this error? I cannot find any solution for my problem.
For the security problem, I cannot upload my MapleSim model.

I appreciate any idea or tip you may have.

Is it possible to edit 3D work space directly in maplesim? How?

Can we add a static (fixed) cylinder around a piston (translating cylinder) in the 3D workspace?

Can we draw in maple drawing and add it to maplesim 3D space?

Thanks for these basic yet unclear to for the past many months.

Ramakrishnan V

I have an excel macro file (enable macro or save as macro and run) in which the colour of cells keep changing by a macro named macro2.

Can we achieve it in maple or maple sim?

Any one please suggest a way for me to try out.



Ramakrishnan V

I dragged into model space prismatic FixedFrame and RigidBody components and prismatic joint along y axis. I also set mass m = 1 kg. The manual says set K_S = K_S and K_K_d in inspector parameter setting. It did not work out. So i set values 12 and 0.1 for K_S and K_d. I sreated subsystem sub of rigidBody and followed the following instructions,

Quote" PrismaticJoint.PlacethePrismaticjointandRigidBodyinasubsystemcalledsub.Thisallowsthe EquationTemplatetogenerateequationsspecificallyfortheselectedsubsystem.
3. ClickTemplates( )intheMainToolbarandselecttheEquationstemplate. 4. IntheAttachmentfield,provideaworksheetnameandclickCreateAttachment.Your MapleSimmodelopensinaMapleworksheet,withtheSubsystemSelectionwindow.

ClickLoadSelectedSubsystem.Thesubcomponentparameterandvariablesload automaticallyintheParameterandVariableManipulationareas"

After this i wanted to modify the equations. I could not. The same equation is reassigned.

Parameter and variable rows - are as shown in manual, but a blank row not available for user's use. But how do i get the variable x(t) there and rename it?

Thanks for an example of this chapter with an application of its use., if available with anyone?

Ramakrishnan V

I have made a program to plot y(t) vs x(t). Can you please modify to plot y vs x data from an excel file.

Given x in A column and y in B column in 5 rows.

Example data: [[1,1],[2,4],[3,9],[4,16],[5,26]]



Ramakrishnan V

I followed the basic example RLS circuit first. It worked out well for R = 24 ohms, L = 160 mHand C = 200 microF. Signal is step input h = 1 and  t0 =  0.1 s. Simulation td = 0.5 s

When I extended it for DC motor, the output for torque (tou) and speed (w) not plotted for h = 1  t0 =  1s and simulation td = 5 s for the same parameters as above the output required (shown in manual) is not coming. Is it because default values shown were different? Then how do i change? I am enclosing the file for view and help.




Ramakrishnan V


I have an industrial robot model and I need to define constraints for the revolute joints. For example, R2 joint is only allowed to move between -165 to 165 degrees. Could you please tell me how I can impose these constraints?

Thank you.


Hi, i don't know what happened but every time that I run the simulation appears this: 

invalid input: Multibody:-GetMultibodyData expects its 4th argument, lsProbes, to be of type list(list), but received registerMultibodyVariable

If anyone can solve this problem, I am going to be very grateful. Thanks


Dear All,

This is probably an easy issue to solve.

I have imported an .xls file using the 1D lookup table.

I need the signal to be executed for 4 seconds which is also how long my simulation duration is.

So I set the Ramp height and rise time to 4s. For some reason when I display the signal using a probe it gives me the constant value of the first row of my Excel sheet. I need help to solve this! I have provided some visuals below.

Thank you for your time!


First 9 10 11 12 13 14 15 Last Page 11 of 40