MapleSim Add-Ons Questions and Posts

These are Posts and Questions associated with the product, MapleSim Add-Ons

I'm excited to announce the creation of a new LinkedIn group, Maple Software Community! This group is dedicated to discussions about the use of Maple software and is designed to be a valuable resource for undergraduate and graduate students, researchers, and all Maple enthusiasts.

By joining this community, you'll have the opportunity to:

  • Learn about upcoming events and workshops that can enhance your skills.
  • Stay informed on the latest projects that leverage Maple software.
  • Engage in discussions that explore the many uses of Maple across various fields.
  • Connect with Maple ambassadors and users worldwide who are eager to share their knowledge and experience.

Whether you're a seasoned user or just starting out with Maple, your contributions to this group are welcome and encouraged. Let's build a thriving community together!


Looking forward to seeing you there! 

Maple Software Community

I’m excited to announce that we’ve just launched MapleSim 2024.

The new release has tools that are designed to drive innovation, and overall save you time when creating and developing simulations.

At Maplesoft we are looking to continually enhance our engineering software with new features based on customer feedback, and I’m pleased to share some of the fruits of that labor, and thank the developers, product management team, and  customers that contributed.

The new offering  helps engineers to

  • Rapidly Tune Parameters
  • Explore Design Concepts
  • Expand Modeling Capabilities

For example, the new Rerun panel allows you to significantly cut the time between simulations as you quickly apply different parameter values, initial conditions and even simulation settings between runs. It does this by skipping the formulation steps when there are no structural changes made to the model, and you can even see the plots and results of the different iterations side by side.
You can see it in action in this short demo video.

There is now support for the latest Modelica feature set, so you can import Modelica Libraries that make use of MSL 4.0.0 features, and adds a range of new modeling components to the standard MapleSim libraries (electrical, 1-D mechanical, signal block and more).

 

MapleSim 2024 also includes more components in the Hydraulic library to support modeling of flow restrictions and adds a Scripting button to add and organize Maple worksheets.

We’ve also applied a whole series of updates to our MapleSim add-on products, including:

  • The MapleSim Web Handling Library has new tools for modeling heavier webs, winding of multiple rolls on the same drum, and adding a Switching Nip Roller to swing the web contact points between rollers.
  • The MapleSim Connector for FMI can now import and export FMI 3.0.
  • The MapleSim CAD Toolbox supports recent software releases from NX™, SOLIDWORKS®, Solid Edge®, Parasolid®, and other CAD tools.
  • The MapleSim Heat Transfer Library has gained a new T-junction component for the Water subpackage to improve flow/pressure-drop calculations for systems with branches.

We have an upcoming webinar for you to see the new 2024 features in MapleSim Web Handling Library – you can sign up to register here.

You can find out more about the other new features at the MapleSim What’s New web page, and as always, we are happy to hear your comments and product suggestions.

And if you are new to MapleSim and would like to try building and running a model yourself, you can request a free trial, or contact Maplesoft sales team with any questions.

Hi,

I am trying to convert from MapleSim to Simulink Matlab by using the S-function code Generation connector, but I got the above message when I uploaded the selected subsystem and I have no idea how can I fix it. Please help me

Anybody find Import CAD closes MapleSim 2022.2 when just opening file chooser when attempting to import CAD file?

Regards,
Bill

battery_charging_circuit.msim

I am trying to design a charge circuit for Li battery, but i don't think it is a good idea to discharge the battery by a resistor or a cuurent source. So, how can i set the parameters to make the battery discharged initially?

We are currently in the process of updating the support FAQs at https://faq.maplesoft.com. We’ve been working on updating the existing content for clarity, and have added several new articles already.

 

The majority of our FAQs are from questions people ask us in Technical Support by support request form, but we’d also like to like to add content from other sources.

Since we have such a great community here at MaplePrimes, we wanted to reach out and ask if there are any articles or questions that you'd like to see added to our FAQ.

 

We look forward to hearing your feedback!

Hello,

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.

Önder

Hi Dears,

I studied the concept of Grobner bases and some algorithm for computing them. I understood that the computation of grobner bases is related to the term ordering. Also, I knew that LEX ordering is very expensive. So, it is good idea to use the Grobner basis conversion algorithms such as FGLM and Grobner walk algorithm. Now, I want to know concerning the complexity of these algorithm (Buchbergers algorithm, F4 and F5 algorithm, FGLM algorithm and Grobner walk). I hope my question be appropriate in this site,

Thank you in advance.

I am looking forward to hearing from you.

 

sols[11][1] = [1,1];

sols[11][2] = [1,2];

sols[11][3] = [5,10];

...etc

animate(plot, sols[11][A], A=1..20, frames = 20);

Error bad index into Vector

animate(plot, [sols[11]], A=1..20, frames = 20);

this writing can be ploted, but when i play animation, can not see it draw step by step

Hi I was wondering if theres a way to smoothen a signal in maplesim.
I was trying to create a simple moving average but it doesnt seem to be able to create a feed back loop?
Much appreciate any help, or if there are other ways within maplesim to do it.

thanks
pjf

Hi all, 

Is it possible, and how, to disable the automatic completion in the "Advanced Search / keyword" field ?

Underlying this question is my looking for informations about cmaple (beyond what the help page displays : if I can't find any I will ask some specific ones later). But every time I type "cmaple" in the keyword textfield, it is replaced by "campée" (which is a french word ... I guess english people will obtain something different)

Maplesoft regularly hosts live webinars on a variety of topics. Below you will find details on some upcoming webinars we think may be of interest to the MaplePrimes community.  For the complete list of upcoming webinars, visit our website.

 

Hollywood Math (with more new examples!)

Over its storied and intriguing history, Hollywood has entertained us with many mathematical moments in film. John Nash in “A Beautiful Mind,” the brilliant janitor in “Good Will Hunting,” the number theory genius in “Pi,” and even Abbott and Costello are just a few of the Hollywood “mathematicians” that come to mind.

Although the widespread presentation of mathematics on the silver screen is not always entirely accurate, it does serve as a great introduction to the study of mathematics in general. During this webinar Maplesoft will present a number of examples of mathematics in film. See relevant, exciting examples that you can use to engage your students.At the end of the webinar you’ll be given an opportunity to download an application containing all of the Hollywood examples that we demonstrate.

To join us for the live presentation, please click here to register.

 

Applications of Symbolic Computation in Control Design

You may already use Maple and/or MapleSim within your organization to solve various problems, but did you know that they have capabilities for control design as well? In one of our upcoming featured webinars for this month, we will explore the Control Design toolbox including the ability to extract symbolic equations of plant models, perform symbolic linearization, design symbolic controllers, and generate very fast code for HIL testing.

The following examples will be demonstrated:

• PID Control

• LQR, Kalman filter design

• Gain scheduling

• Feedback linearization

To join us for the live presentation, please click here to register.

Hi MaplePrime-ers!

I've been using the Maple(17) toolbox in Matlab(2012b) to quickly enumerate systems of equations by: (i) solving them symbolically, (ii) using unapply to make them functions, (iii) then supplying the points (driver equations) to get the system solution.  Speed is a must, because there may be 3 million+ systems to solve.  Symbolics is also very important because I am evaluating topology, so the structure of the equations may change, and therefore a functional approach will not work.

I have had success (seen in the first code snippet).  I would like similiar behaviour in the second code snippet, but sometimes I get 'solutions may be lost' as an error message,  or 'Error, (in unapply) variables must be unique and of type name'

The system of equations include:  Linear equations, 5th order polynomials, absolute functions, and pieceiwse functions.

Here is code with a topology that solves:

#Interconnection Equations
eq2[1] := FD_T + EM2_T = 0;
eq2[2] := ICE_T + GEN_T = 0;
eq2[3] := EM2_A + GEN_A + BAT_A = 0;
eq2[4] := -FD_W + EM2_W = 0;
eq2[5] := -ICE_W + GEN_W = 0;
eq2[6] := -EM2_V + GEN_V = 0;
eq2[7] := -EM2_V + BAT_V = 0;

#ICE
eq_c[1] := ICE_mdot_g=((671.5) + (-21.94)*ICE_T + (0.1942)*ICE_W + (0.5113)*ICE_T^2 + (-0.01271)*ICE_T*ICE_W + ( -0.0008761)*ICE_W^2 + (-0.006071)*ICE_T^3 + (9.867e-07)*ICE_T^2*ICE_W + (5.616e-05)*ICE_T*ICE_W^2 + (1.588e-06)*ICE_W^3 + (3.61e-05)*ICE_T^4 + (8.98e-07)*ICE_T^3*ICE_W + (-2.814e-07)*ICE_T^2*ICE_W^2 + (-8.121e-08)*ICE_T*ICE_W^3 + ( -8.494e-08 )*ICE_T^5 + (-2.444e-09)*ICE_T^4*ICE_W + (-9.311e-10)*ICE_T^3*ICE_W^2 + ( 5.835e-10)*ICE_T^2*ICE_W^3 ) *1/3600/1000 * ICE_T * ICE_W;

#BAT
eq_c[2] := BAT = 271;

#EM2
EM2_ReqPow_eq := (-148.3) + (4.267)*abs(EM2_W) + (12.77)*abs(EM2_T) + (-0.0364)*abs(EM2_W)^2 + ( 1.16)*abs(EM2_W)*abs(EM2_T) + (-0.258)*abs(EM2_T)^2 + ( 0.0001181)*abs(EM2_W)^3 + (-0.0005994)*abs(EM2_W)^2*abs(EM2_T) + ( 0.0001171)*abs(EM2_W)*abs(EM2_T)^2 + (0.001739 )*abs(EM2_T)^3 + (-1.245e-07 )*abs(EM2_W)^4 + ( 1.2e-06)*abs(EM2_W)^3*abs(EM2_T) + ( -1.584e-06)*abs(EM2_W)^2*abs(EM2_T)^2 + ( 4.383e-07)*abs(EM2_W)*abs(EM2_T)^3 + (-2.947e-06)*abs(EM2_T)^4;
eq_c[3] := EM2_P = piecewise( EM2_T = 0, 0, EM2_W = 0, 0, EM2_W*EM2_T < 0,-1 * EM2_ReqPow_eq, EM2_ReqPow_eq);
eq_c[4] := EM2_A = EM2_P/EM2_V;

#GEN
GEN_ReqPow_eq:= (-5.28e-12) + ( 3.849e-14)*abs(GEN_W) + (-71.9)*abs(GEN_T) + (-1.168e-16)*abs(GEN_W)^2 +(1.296)*abs(GEN_W)*abs(GEN_T) + (2.489)*abs(GEN_T)^2 + (1.451e-19)*abs(GEN_W)^3 + (0.0001326)*abs(GEN_W)^2*abs(GEN_T) + (-0.008141)*abs(GEN_W)*abs(GEN_T)^2 + (-0.004539)*abs(GEN_T)^3 +(-6.325e-23)*abs(GEN_W)^4 + (-2.091e-07)*abs(GEN_W)^3*abs(GEN_T) + ( 3.455e-06)*abs(GEN_W)^2*abs(GEN_T)^2 + ( 2.499e-05)*abs(GEN_W)*abs(GEN_T)^3 + (-5.321e-05)*abs(GEN_T)^4;
eq_c[5] := GEN_P = piecewise( GEN_T = 0, 0, GEN_W = 0, 0, GEN_W*GEN_T < 0,-1 * GEN_ReqPow_eq, GEN_ReqPow_eq);
eq_c[6] := GEN_A = GEN_P/GEN_V;

#ASSUMPTIONS
assume(BAT_V::nonnegative);
assume(FD_W::nonnegative);

#FINAL EQUATIONS

sys_eqs2 := convert(eq2,set) union {eq_c[1],eq_c[2],eq_c[3],eq_c[4],eq_c[5],eq_c[6]};

#Selecting which variables to solve for:

drivers2:= { ICE_T,ICE_W,FD_T,FD_W};
symvarnames2:=select(type,indets(convert(sys_eqs2,list)),name);
notdrivers2:=symvarnames2 minus drivers2;


#Symbolic solve

sol2:=solve(sys_eqs2,notdrivers2) assuming real:
symb_sol2:=unapply(sol2,convert(drivers2,list)):


#Enumerate (there will generally be about 40, not 6)

count := 0;
for i1 from 1 to 40 do
     for i2 from 1 to 40 do
          for i3 from 1 to 40 do
               for i4 from 1 to 40 do
                    count := count + 1;
                    solsol2(count) := symb_sol2(i1,i2,i3,i4);
               od;
          od;
     od;
od;
count;



This works great!  I would like simliar output in my second code snippet, but this time with more inputs to symb_sol.  However, if I try and change the interconnection equations a little, and add a piecewise function, and another driver... (differences in bold)

#Interconnection Equations
eq1[1] := FD_T+EM2_T = 0;
eq1[2] := ICE_T+GBb_T = 0;
eq1[3] := GEN_T+GBa_T = 0;
eq1[4] := EM2_A+GEN_A+BAT_A = 0;
eq1[5] := -FD_W+EM2_W = 0;
eq1[6] := -GEN_W+GBa_W = 0;
eq1[7] := -ICE_W+GBb_W = 0;
eq1[8] := -EM2_V+GEN_V = 0;
eq1[9] := -EM2_V+BAT_V = 0;

#ICE
eq_c[1] := ICE_mdot_g=((671.5) + (-21.94)*ICE_T + (0.1942)*ICE_W + (0.5113)*ICE_T^2 + (-0.01271)*ICE_T*ICE_W + ( -0.0008761)*ICE_W^2 + (-0.006071)*ICE_T^3 + (9.867e-07)*ICE_T^2*ICE_W + (5.616e-05)*ICE_T*ICE_W^2 + (1.588e-06)*ICE_W^3 + (3.61e-05)*ICE_T^4 + (8.98e-07)*ICE_T^3*ICE_W + (-2.814e-07)*ICE_T^2*ICE_W^2 + (-8.121e-08)*ICE_T*ICE_W^3 + ( -8.494e-08 )*ICE_T^5 + (-2.444e-09)*ICE_T^4*ICE_W + (-9.311e-10)*ICE_T^3*ICE_W^2 + ( 5.835e-10)*ICE_T^2*ICE_W^3 ) *1/3600/1000 * ICE_T * ICE_W;

#BAT
eq_c[2] := BAT = 271;

#EM2
EM2_ReqPow_eq := (-148.3) + (4.267)*abs(EM2_W) + (12.77)*abs(EM2_T) + (-0.0364)*abs(EM2_W)^2 + ( 1.16)*abs(EM2_W)*abs(EM2_T) + (-0.258)*abs(EM2_T)^2 + ( 0.0001181)*abs(EM2_W)^3 + (-0.0005994)*abs(EM2_W)^2*abs(EM2_T) + ( 0.0001171)*abs(EM2_W)*abs(EM2_T)^2 + (0.001739 )*abs(EM2_T)^3 + (-1.245e-07 )*abs(EM2_W)^4 + ( 1.2e-06)*abs(EM2_W)^3*abs(EM2_T) + ( -1.584e-06)*abs(EM2_W)^2*abs(EM2_T)^2 + ( 4.383e-07)*abs(EM2_W)*abs(EM2_T)^3 + (-2.947e-06)*abs(EM2_T)^4;
eq_c[3] := EM2_P = piecewise( EM2_T = 0, 0, EM2_W = 0, 0, EM2_W*EM2_T < 0,-1 * EM2_ReqPow_eq, EM2_ReqPow_eq);
eq_c[4] := EM2_A = EM2_P/EM2_V;

#GEN
GEN_ReqPow_eq:= (-5.28e-12) + ( 3.849e-14)*abs(GEN_W) + (-71.9)*abs(GEN_T) + (-1.168e-16)*abs(GEN_W)^2 +(1.296)*abs(GEN_W)*abs(GEN_T) + (2.489)*abs(GEN_T)^2 + (1.451e-19)*abs(GEN_W)^3 + (0.0001326)*abs(GEN_W)^2*abs(GEN_T) + (-0.008141)*abs(GEN_W)*abs(GEN_T)^2 + (-0.004539)*abs(GEN_T)^3 +(-6.325e-23)*abs(GEN_W)^4 + (-2.091e-07)*abs(GEN_W)^3*abs(GEN_T) + ( 3.455e-06)*abs(GEN_W)^2*abs(GEN_T)^2 + ( 2.499e-05)*abs(GEN_W)*abs(GEN_T)^3 + (-5.321e-05)*abs(GEN_T)^4;
eq_c[5] := GEN_P = piecewise( GEN_T = 0, 0, GEN_W = 0, 0, GEN_W*GEN_T < 0,-1 * GEN_ReqPow_eq, GEN_ReqPow_eq);
eq_c[6] := GEN_A = GEN_P/GEN_V;

#GB
FiveSpeedGearbox_R := proc(ig)
local i ,eq;
i[1]:=3.32;
i[2]:=2;
i[3]:=1.36;
i[4]:=1.01;
i[5]:=0.82;
eq:= piecewise(ig=1,i[1],ig=2, i[2],ig=3,i[3],ig=4,i[4],ig=5,i[5],1);
return eq(ig);
end proc;


eq_c[7] := GBb_T = -1/GB_R * GBa_T;
eq_c[8] := GBb_W = GB_R * GBa_W;
eq_c[9] := GB_R = FiveSpeedGearbox_R(ig);

 

#System Equations
sys_eqs := convert(eq1,set) union convert(eq_c,set);

 

 #Solve for variables
symvarnames:=select(type,indets(convert(sys_eqs,list)),name);
drivers:= {ig, ICE_T,ICE_W,FD_T,FD_W};
not_drivers := symvarnames minus drivers;

#Assumptinons

assume(BAT_V::nonnegative);
assume(FD_W::nonnegative);

sol:=(solve(sys_eqs,not_drivers) assuming real);

symb_sol:=unapply(sol,convert(drivers,list)): ---> Error, (in unapply) variables must be unique and of type name

Subsequent parts don't work...

count := 0;
for i1 from 1 to 40 do
     for i2 from 1 to 40 do
          for i3 from 1 to 40 do
               for i4 from 1 to 40 do
                    for i5 from 1 to 40 do
                         count := count + 1;
                         solsol2(count) := symb_sol2(i1,i2,i3,i4,5);
                    od;
               od; 
          od;
     od;
od;
count;

While running the last line sol:, 1 of 2 things will happen, depending on the solver. Maple17 will take a long time (30+ minutes) to solve, then report nothing, or sol will solve, but will report "some solutions have been lost".

Afterwards, evaluating symb_sol(0,0,0,0,0) will return a viable solution (real values for each of the variables).  Whereas evaluating symb_sol(0,X,0,0,0), where X <> 0, will return and empty list [].

Does anyone know how to (i) speed up the symbolic solve time?  (ii) Return ALL of the solutions?

 

Thanks in advance for reading this.  I've really no idea why this isn't working.  I've also attached two worksheets with the code: noGB.mw   withGB.mw

 Adam

MapleSim 6.4 includes more powerful tools for creating custom components, performance enhancements, and enhancements to the model generators for Simulink® and FMI. 

We have also made important updates to the MapleSim Control Design Toolbox. This toolbox now offers a more complete set of algorithms for PID control, new commands for computing closed-loop transfer functions, and numerous improvements to existing commands. These enhancements allow engineers to design a greater variety of controllers and controller-observer systems while taking advantage of the greater flexibility and analysis options available through the use of symbolic parameters. 

See What’s New in MapleSim 6.4 and What’s New in the MapleSim Control Design Toolbox for details.

 

eithne

Hello,

I have a model in MapleSim for which I've generated the optimized C code using the connector toolbox, and I'd like to work with it directly. I was wondering if there is any documentation or examples of how to do this? I haven't been able to find any online.

Thanks! 

1 2 Page 1 of 2