Product Tips & Techniques

Tips and Tricks on how to get the most about Maple and MapleSim

VerifyTools is a package that has been available in Maple for roughly 24 years, but until now it has never been documented, as it was originally intended for internal use only. Documentation for it will be included in the next release of Maple. Here is a preview:

VerifyTools is similar to the TypeTools package. A type is essentially a predicate that a single expression can either satisfy or not. Analogously, a verification is a predicate that applies to a pair of expressions, comparing them. Just as types can be combined to produce compound types, verifications can also be combined to produce compund verifications. New types can be created, retrieved, queried, or deleted using the commands AddType, GetType (or GetTypes), Exists, and RemoveType, respectively. Similarly in the VerifyTools package we can create, retrieve, query or delete verifications using AddVerification, GetVerification (or GetVerifications), Exists, and RemoveVerification.

The package command VerifyTools:-Verify is also available as the top-level Maple command verify which should already be familiar to expert Maple users. Similarly, the command VerifyTools:-IsVerification is also available as a type, that is,

VerifyTools:-IsVerification(ver);

will return the same as

type(ver, 'verification');

The following examples show what can be done with these commands. Note that in each example where the Verify command is used, it is equivalent to the top-level Maple command verify. (Also note that VerifyTools commands shown below will be slightly different compared to the Maple2024 version):

with(VerifyTools):

Suppose we want to create a verification which will checks that the length of a result has not increased compared to the expected result. We can do this using the AddVerification command:

AddVerification(length_not_increased, (a, b) -> evalb(length(a) <= length(b)));

First, we can check the existence of our new verification and get its value:

Exists(length_not_increased);

true

GetVerification(length_not_increased);

proc (a, b) options operator, arrow; evalb(length(a) <= length(b)) end proc

For named verifications, IsVerification is equivalent to Exists (since names are only recognized as verifications if an entry exists for them in the verification database):

IsVerification(length_not_increased);

true

On the other hand, a nontrivial structured verification can be checked with IsVerification,

IsVerification(boolean = length_not_increased);

true

whereas Exists only accepts names:

Exists(boolean = length_not_increased);

Error, invalid input: VerifyTools:-Exists expects its 1st argument, x, to be of type symbol, but received boolean = length_not_increased

The preceding command using Exists is also equivalent to the following type call:

type(boolean = length_not_increased, verification);

true

Now, let's use the new verification:

Verify(x + 1/x, (x^2 + 1)/x, length_not_increased);

true

Verify((x^2 + 1)/x, x + 1/x, length_not_increased);

false

Finally, let's remove the verification:

RemoveVerification(length_not_increased);

Exists(length_not_increased);

false

GetVerification(length_not_increased);

Error, (in VerifyTools:-GetVerification) length_not_increased is not a recognized verification

GetVerifications returns the list of all verifications known to the system:

GetVerifications();

[Array, FAIL, FrobeniusGroupId, Global, Matrix, MultiSet, PermGroup, RootOf, SmallGroupId, Vector, address, after, approx, array, as_list, as_multiset, as_set, attributes, boolean, box, cbox, curve, curves, dataframe, dataseries, default, default, dummyvariable, equal, evala, evalc, expand, false, float, function, function_bounds, function_curve, function_shells, greater_equal, greater_than, in_convex_polygon, indef_int, interval, less_equal, less_than, list, listlist, matrix, member, multiset, neighborhood, neighbourhood, normal, permute_elements, plot, plot3d, plot_distance, plotthing_compile_result, polynom, procedure, ptbox, range, rational, record, relation, reverse, rifset, rifsimp, rtable, set, sign, simplify, sublist, `subset`, subtype, superlist, superset, supertype, symbol, table, table_indices, testeq, text, true, truefalse, type, undefined, units, vector, verifyfunc, wildcard, xmltree, xvm]

Download VerificationTools_blogpost.mw

Austin Roche
Software Architect
Mathematical Software
Maplesoft

Circles inscribed between curves can be specified by a system of equations relative to the coordinates of the center of the circle and the coordinates of the tangent points. Such a system can have 5 or 6 equations and 6 variables, which are mentioned above.
In the case of 5 equations, we can immediately obtain an infinite set of solutions by selecting the ones we need from it. 
(See the attached text for more details.)
The 1st equation is responsible for the belonging of the point of tangency to one of the curves.
The 2nd equation is responsible for the belonging of the point of tangency to another curve.
In the 3rd equation, the points of tangency on the curves belong to the inscribed circle.
In the 4th and 5th equations, the condition is satisfied that the tangents to the curves are perpendicular to the radii of the circle at the points of contact.
The 6th equation serves either to find a specific inscribed circle or to find an infinite set of solutions. It is selected based on the type of curves and their mutual arrangement.

In this example, we search for a subset of the solution set using the Draghilev method by solving the first five equations of the system: we inscribe circles in two "angles" formed by the intersection of the exponent and the ellipse.
The text of this example, its solution in the form of a picture,"big" option and pictures of similar examples.

INSCRIBED_CIRCLES.mw


 


Addition 09/01/24, 
One curve for the first two equations in coordinates x1,x2 and x3,x4
f1:=
 x1^2 - 2.5*x1*x2 + 3*x2^2 - 1;
f2:=
 x3^2 - 2.5*x3*x4 + 3*x4^2 - 1;

This is a reminder that presentation applications for the Maple Conference are due July 17, 2024.

The conference is a a free virtual event and will be held on October 24 and 25, 2024.

We are inviting submissions of presentation proposals on a range of topics related to Maple, including Maple in education, algorithms and software, and applications. We also encourage submission of proposals related to Maple Learn. You can find more information about the themes of the conference and how to submit a presentation proposal at the Call for Participation page.

I encourage all of you here in the Maple Primes community to consider joining us for this event, whether as a presenter or an attendee!

Kaska Kowalska
Contributed Program Co-Chair

 

The Proceedings of the Maple Conference 2023 is now out, at

mapletransactions.org

The presentations these are based on (and more) can be found at https://www.maplesoft.com/mapleconference/2023/full-program.aspx#schedule .

There are several math research papers using Maple, an application paper by an undergraduate student, an engineering application paper, and an interesting geometry teaching paper.

Please have a look, and don't forget to register for the Maple Conference 2024.

We have just released an update to Maple. Maple 2024.1 includes improvements to the math engine, PDF export, the Physics package, command completion, and more. As always, we recommend that all Maple 2024 users install this update. In particular, please note that this update includes fixes to ODESteps and simplifying integrals, as reported on Maple Primes. Thanks for helping us, and other users, by letting us know!

At the same time, we have also released an update to MapleSim. MapleSim 2024.1.1 includes improvements to FMU import/export, plotting, co-simulation, and more, as well as enhancements to the Web Handling Library.

These updates are available through Tools>Check for Updates in Maple or MapleSim, and are also available from the Download Product Updates section of our web site, where you can find more details.

This post summarizes links for those who have not studied numerical integration methods from scratch and are interested in simulation settings in MapleSim (like me).

The MapleSim help pages simulation settings and advanced simulation settings give first guidance for the trained user but do not provide explanations or links for the terms used in the description of the settings (as for example: stiffness, constraint stabilization, constraint projection, events and event iteration,...).

It can easily be overlooked that Maple help pages provide further information for most of the terms. Under the assumption that MapleSim uses the same terminology as Maple, I recommend to first have a look at Maple help topics before consulting the web or other resources. Since searching and retrieving can be time consuming, I made a list of helpful links.

There are still some open points. I would be happy for more links and help in filling these gaps.

 

How Maple simulates

?MapleSimUserGuide,Chapter04:
section 4.1 How MapleSim Simulates a Model

?tasks,generatingCode

Ein Bild, das Text, Screenshot, Diagramm, Design enthält.

Automatisch generierte Beschreibung

 

Solvers

An overview of solvers: ?dsolve,numeric

Differential Algebraic Equation introduction: ?MaplePortal,DAE

Overview of numeric differential-algebraic equation solvers (index reduction, constraint drift, projection):
 ?examples/numeric_DAE and ?dsolve,numeric,DAE_extension

Stiffness and stiff solvers

Stiffness and stiff IVPs: ?dsolve,Stiffness

Events

?dsolve,numeric,Events

Time events and state events

Event handling:

?MapleSimUserGuide,Chapter04:
section 4.1 How MapleSim Simulates a Model

Event iteration:

?MapleSimUserGuide,Chapter05:
section 5.5 Selecting the Code Generation Options

Iteration, hysteresis, Intermediate steps: ?tasks,generatingCode

Hysteresis:

Hysteresis in value or also in time?

Do variable solvers adapt the value of event hysteresis during runtime?

 

Baumgarte constraint stabilization, unconstrained dynamics, constrained dynamics

?MapleSim,Multibody,Dynamic_Exports
(in combination with ?MapleSim,Multibody,Kinematic_Exports)

?examples/numeric_DAE

?tasks,generatingCode

?MapleSimUserGuide,Chapter05:
section 5.5 Selecting the Code Generation Options

Error control

              ?dsolve,numeric,Error_Control

              Absolute error: ?dsolve,numeric,IVP

              Relative error: (relative to what?)

Index1 error control and Index1 Tollerance: see solvers

Scaling

scalemethod (this does not seem to exist in Maple)

 

Examples (Multibody)

Events

                            Catapult
                            (from MapleSim>Help>Examples>Physical Domains>Multibody)
                            contact events

                          Catapult_-_Events.msim

                            Throwing a ball
                            (from MapleSim>Help>Examples>Physical Domains>Multibody)

                            conditional events (with boolean logic)

                          Throwing_a_Ball_-_Events.msim

              Solvers

              Conservation of energy of a pendulum depends on solvers.
                           Euler increases energy, implict Euler dissipates energy.

             Pendulum_for_solver_comparision.msim

           

Constraint dirft/projection

              2-d rigid slider crank

               (from MapleSim>Help>Examples>Physical Domains>Multibody)

              projection off leads to assembly desintegration after 2000 s simulation

             2D_Rigid_Slider_Crank_-_constraint_projection.msim

                         A stiff solver improves constraint drift, but only delays desintegration

                         Baumgarte constraint stabilization prevents simulation error but shows dislocated rigid body frames

 

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.

We've just launched Maple Flow 2024!

You're in the driving seat with Maple Flow - each new feature has a straight-line connection to a user-driven demand to work faster and more efficiently.

Head on over here for a rundown of everything that's new, but I thought I'd share my personal highlights here.

If your result contains a large vector or matrix, you can now scroll to see more data. You can also change the size of the matrix to view more or fewer rows and columns.

You can resize rows and columns if they're too large or small, and selectively enable row and column headers.

If the vector or matrix in your result contains a unit, you can now rescale units with the Context Panel (for the entire matrix) or inline (for individual entries).

A few releases ago, we introduced the Variables palette to help you keep track of all the user-defined parameters at point of the grid cursor.

You can now insert variables into the worksheet from the Variables palette. Just double-click on the appropriate name.

Maple Flow already features command completion - just type the first few letters of a command, and a list of potential completions appears. Just pick the completion you need with a quick tap of the Tab key.

We've supercharged this feature to give potential arguments for many popular functions. Type a function name followed by an opening bracket, and a list appears.

In case you've missed it, the argument completion list also features (when they make sense) user-defined variables.

You can now link to different parts of the same worksheet. This can be used to create a table of contents that lets you jump to different parts of larger worksheets.

This page lists everything that's new in the current release, and all the prior releases. You might notice that we have three releases a year, each featuring many user-requested items. Let me know what you want to see next - you might not have to wait that long!

It can happen when an operation is interrupted by  that Maple does not return to  and still shows .

This can give the false impression that the Maple server in charge of the evaluation did not get the message to stop whatever it was doing.

By giving Maple an impossible task to solve analytically

f1 := x1 - x1*sin(x1 + 5*x2) - x2*cos(5*x1 - x2);
f2 := x2 - x2*sin(5*x1 - 3*x2) + x1*cos(3*x1 + 5*x2);
solve({f1, f2});

I have noticed in the Windows Task Manager that freeing allocated memory can take much longer than one might think.

In one case it took 30 minutes to free 24 Gb of total allocated memory (21 Gb of it in RAM/physical memory). In this case the interrupt button became active (turned from grey to red ) two times and memory continued piling up  again.

Lessons learned for me:

  • The task manager is not only a valuable indicator for task activity but also for the interruption/memory freeing process.
  • Before killing a whole Maple session and potentially losing the last state of a worksheet it can pay off to wait and repeatedly interrupt an operation.

 

Suggestion: When the maple server gets an interrupt request, it could report to the GUI that it is in an interruption state and is no longer evaluating input. For example changing the message in the status bar from Evaluating... to Interrupting...

This post is to help anyone who is just as frustrated about typesetting in plots
as I was before I solved my problem. (Note: the technique works with the version

2020 and newer and may work with earlier versions.)

 

Why? Because there is no obvious help in Maple showing what works. (And if folks

can improve what I have posted,  please do so. At least when someone executes

a search for this type of problem, they might see the best approach.)

Goal: typeset a name of a function in any text of a plot.

Approach: According to help, '?plot, typesetting',  one should use the
option(procedure?) typeset.   For example:

"restart;   plots:-setoptions(size = [400, 200]):    `f__1`(x) :=cos(x)*(e)^(-(x^(2))/(4)) :    p1 := plot(`f__1`(x), x = -5..5,                         legend = typeset("function ", `f__1`(x) )  );"

 

 

However, what I want in the legend is the expression "`f__1`(x),"not the evaluated

expression. Entering the name with single quotes around the expression leads to this:

 

p1 := plot(f__1(x), x = -5 .. 5, legend = typeset("function ", 'f__1(x)'))

 

 

which is great, except that when I wish to redisplay the plot

 

plots:-display(p1)

 

the expression f__1(x)is evaluated.

 

According to the code completion capability of Maple, the procedure

"Typesetting:-Typeset" exists, and it does not evaluate the function:

 

p1 := plot(f__1(x), x = -5 .. 5, legend = Typesetting:-Typeset(f__1(x))); plots:-display(p1)

 

 

except there is no help regarding this procedure.

 

It appears that the procedure operates only on one item.

 

Solution: Hence, the ultimate solution for my problem is to still use the typeset 

option, but Typeset any expression.

 

p1 := plot(f__1(x), x = -5 .. 5, legend = typeset("function ", Typesetting:-Typeset(f__1(x)))); plots:-display(p1)

 

 

Again, if you can contribute to this post, I would appreciate it.


 

Download MaplePrimies_-_Typesetting_in_plots.mw

Time is running out for users of Mathcad® 15 worksheets.
Engineers who need to retain their historical Mathcad project files are faced with a looming deadline to move the content to another file format.

The good news is that Mathcad 15 users can turn to Maple Flow as an effective replacement design calculation tool. Maple Flow is an advanced calculation tool with a free-form layout that makes it easy for engineers to brainstorm, develop, and document their project designs.

Maplesoft now has an efficient migration solution for moving critical Mathcad content to Maple Flow worksheets. This gives engineers a path to safeguard their critical reference designs, mathematical analyses, and engineering test results.

Why are engineers moving from Mathcad 15?
In 2025, some changes are expected that will severely restrict access to Mathcad 15 software. Here’s some background:

  • PTC announced that Mathcad 15 is end-of-sale effective December 2021, restricting license activations for new users.
  • Those existing Mathcad 15 customers who bought multiyear license extensions will see them expire by December 2025. After that, those with subscription licenses will not be able to open the app, and will not be able to access their historic design documents.
  • One of the significant issues engineers are encountering is that the new version of the software is not directly compatible with their historical Mathcad documents. PTC no longer has the right to distribute software versions with a third-party component, and has opted to use a different symbolic calculation engine in Mathcad Prime® that cannot read and edit the legacy files.
  • Another issue is that the Mathcad 15 software does not support Windows 11, so is typically run on Windows 10, a platform that Microsoft will not be supporting after October 2025.
  • Without a reliable way to keep accessing their project work in the Mathcad 15 format, engineers are looking for an alternative design worksheet platform.

As a result, engineers with large repositories of these design files now face converting all the worksheets to a new format or risk losing access to valuable design reports, and the possible regulatory consequences.

Maple Flow as a replacement for Mathcad 15
Engineers who want a long-term stable environment for their critical project work can change their design workflow to use Maple Flow for everyday calculation tasks.

The advanced math features and formatting options in Maple Flow make it a good fit for creating (and updating) design documentation and hand calculations, where engineers combine mathematical equations and variables that change regularly, and show the results in a report.

Maple Flow has a short learning curve, and the range of example templates in the Application Center and the customized training all help users quickly get up to speed with Maple Flow commands and formatting features.

How can I migrate Mathcad 15 content to Maple Flow?
Maplesoft has created a series of migration strategies for users of Mathcad software to transition to Maple Flow for ongoing calculation needs or to meet compliance requirements.

For engineers with a handful of worksheets, or where the calculations only span a few pages, it is relatively quick to reenter the calculations directly in Maple Flow. Some steps will need to be updated to the equivalent Maple Flow function, and there is also the opportunity to use features that are not available in Mathcad 15 (or its successor Mathcad Prime), such as advanced signal processing tools, thermodynamic data, and functionality for the analysis of linear systems.

For engineering firms with large repositories of legacy Mathcad 15 files, Maplesoft has developed a convenient path to migrate batches of content into Maple Flow. Maplesoft Engineering Services guide customers through the migration process and apply an efficient Migration Assistant to move the equations, variable definitions, units, layout, and other supported features from Mathcad 15 worksheets to Maple Flow. The content is mapped to the equivalent Maple Flow functionality, so that calculations can be run and developed further. This allows project worksheets and templates to be recreated with the least investment in time.

This image shows a calculation section before and after batch migration into Maple Flow format:

Ongoing support from Maplesoft

Maple Flow was first launched in 2021 and was developed to give engineers a single tool that can perform mathematical analysis and present results in a professional-looking format. There is built-in support for natural mathematical notation and tracking units, and the development roadmap continues to follow a user-focused approach, so new usability enhancements are regular and relevant.

The current release of Maple Flow gives engineers a path to avoid losing legacy calculations and designs previously stuck in Mathcad 15 worksheets and reuse the content for ongoing project work.

If you would like assistance from Maplesoft with migrating large repositories of design worksheets, please contact Maplesoft Sales.

[This is a contributed article by Alex Beilby, Technical Marketing Mgr, Maplesoft]

[Right-click on image and open in new tab to see larger]

To Scan Math with the Maple Calculator and show solution steps in Maple:

1. first scan some math with the calculator

2. Maple calculator immediately shows the solution if that is what you are looking for:

3. Calculator gives options to show the solution steps in the calculator itself ( footprint button in top-right) 

4. Or to upload the math to the MapleCloud (cloud icon with up arrow)

5. Once the math is uploaded, MapleCloud can be loaded on a desktop computer and the file opened from your account's Maple Calculator group of files:

6. Again, the solution and some more details are visible on Maple Cloud:

7. To open this math in Maple, click the blue button to Download the file.

The downloaded file can then be loaded in Maple:

8. The Maple commands to solve this math are shown, and the result. 

To show steps in Maple at this point, convert the math to inert form, then run the Student:-Calculus1:-ShowSolution() command on it:

Ex := Int(3.(x^2), x = 0 .. 7)

Int(3*x^2, x = 0 .. 7)

(1)

Integrate

 

The solution to this integral is:

int(3*x^2, x = 0 .. 7)

343

(1.1)

Student:-Calculus1:-ShowSolution(Ex)

"[[,,"Integration Steps"],[,,(&int;)[0]^73 x^2 &DifferentialD;x],["&EmptyVerySmallSquare;",,"1. Apply the" "constant multiple" "rule to the term" &int;3 x^2 &DifferentialD;x],[,"?","Recall the definition of the" "constant multiple" "rule"],[,,&int;[] f(x) &DifferentialD;x=[] (&int;f(x) &DifferentialD;x)],[,"?","This means:"],[,,&int;3 x^2 &DifferentialD;x=3 (&int;x^2 &DifferentialD;x)],[,,"We can rewrite the integral as:"],[,,3 ((&int;)[0]^7x^2 &DifferentialD;x)],["&EmptyVerySmallSquare;",,"2. Apply the" "power" "rule to the term" &int;x^2 &DifferentialD;x],[,"?","Recall the definition of the" "power" "rule, for n" "<>" "-1"],[,,&int;x^[] &DifferentialD;x=[]],[,"?","This means:"],[,,&int;x^2 &DifferentialD;x=[]],[,"?","So,"],[,,&int;x^2 &DifferentialD;x=(x^3)/3],[,"?","Apply limits of definite integral"],[,,[]-([])],[,,"We can rewrite the integral as:"],[,,343]]6""

(2)

Download MapleCalculatorMathCloudUpload.mw

Plots of physical quantities has significantly improved with Maple 2022. The updated useunits option makes unit conversion errors in plots very unlikely. A lot of time is saved when creating plots of physical quantities where values and units must be correct.

One final source of user errors remains: The manual entry of incorrect units in labels.

Below is a way to avoid such errors by computing labels with units for three prevalent axis labeling schemes.


Other desireable labels are given as a suggestion for future plot label enhancements where plot commands could provide formating functionality.

The rendering on this website adds double brakets ⟦ ⟧ wherever units are used. You have to open the document to see how Maple renders.

NULL

Simple plot example: Solar irradiance in space

G__0 := 1361*Unit('W'/'m'^2)

1361*Units:-Unit(W/m^2)

(1)

G__0*sin(2*Pi*t/(24*Unit('h')))

1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h))

(2)

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'))

 

This plot has inconsistent axis labeling:

• 

The vertical axis has units but no name

• 

The horizontal axis has a name and units but they are not easily distinguishable. Misinterpretation is possible. Due to the close spacing the label could be read as a product of the dimension "time squared" (the time t times hours h is of the dimension time squared). Or the reader confounds name and units. (The use of italic fonts for names and roman fonts for units might not be noticeable and is a convention that is not used everywhere.)

 

The above labeling should be improved for communication, documentation or publication purposes.

 

A quick attempt using strings and the options useuints and labels.

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = ['d', kW/m^2], labels = ["Time t in days", "Exposure G in kV/m^2"])

 

Axes are now consistent and can be interpreted unambiguously. Formatting can still be improved.

 

Unfortunately, using the options useunits (for unit conversion) and labels this way introduces a new source of user error when labels are entered with the wrong units.

 

A way to address this and to ensure unit error-free plotting of expressions of physical quantities is the following:

 

Step1: Define two lists, one for the units to display and the other for the names to display

a := [Unit('s'), Unit('W'/'cm'^2)]; b := [t, G]

[t, G]

(3)

Step2: Compute labels from the lists

This step avoids the labeling error: No manual entry of units in labels required.

c := [b[1]/a[1], typeset(b[2]/a[2])]; d := [typeset(b[1], "  ", "&lobrk;", a[1], "&robrk;"), typeset(b[2], "  &lobrk;", a[2], "&robrk;")]; e := [typeset(b[1], "  ", "(", a[1], ")"), typeset(b[2], "  (", a[2], ")")]

[typeset(t, "  ", "(", Units:-Unit(s), ")"), typeset(G, "  (", Units:-Unit(W/cm^2), ")")]

(4)

NULL

 

Dimensionless labels

 Double brackets

Parenthesis

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = c)

 

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = d)

 

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = e)

 

The axis values equal physical quantities divided by their units. The algebraic equation G*cm^2/W = 0.8e-1, for example, is physically speaking correct. Most functions of Maple can process dimensionless expression of the kind G*cm^2/W if G is given with appropriate physical units.

This way of using physical quantities is consistent with ISO 80000.  

Used in Maple to enter units in 2D-Math input mode

Can be confounded with functional notation. Units are therefore often written as a whole word (e.g. seconds instead of s).

 

 

NULL

The time to produce the above three plots was about 10 Minutes. The most part was spent to get the typesetting of the second and third plot correct.

 

What takes significant more time (more a question of hours when Typesetting is used for the first time) are

 

Labels with "/ cm^(2) "or 1/cm^2 formatting.

 

This formatting might be preferred but is unfortunately again not free from user errors. (I would probably use it if there was a simple and safe way).

f := [b[1]/a[1], b[2]/`#mrow(mo("W "),mo(" "),mo(" / "),msup(mo("cm"),mn("2")))`]; g := [typeset(b[1], "  ", "&lobrk;", a[1], "&robrk;"), typeset(b[2], "  &lobrk;", (`@`(`@`(Units:-Unit, numer), op))(a[2]), "/", (`@`(`@`(Units:-Unit, denom), op))(a[2]), "&robrk;")]; h := [typeset(b[1], "  ", "(", Unit('s'), ")"), typeset(b[2], "  (", `#mrow(mo("W"),mo(" "),msup(mo("cm"),mn("-2")))`, ")")]

[typeset(t, "  ", "(", Units:-Unit(s), ")"), typeset(G, "  (", `#mrow(mo("W"),mo(" "),msup(mo("cm"),mn("-2")))`, ")")]

(5)

 

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = f)

 

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = g)

 

plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = h)

 

NULL

 

 

 

Remarks

• 

For two reasons, I have not given an example with the often used square brackets [ ] because:
    
    Maple uses square brackets already for lists and indexing purposes,
    and ISO 80000 uses square brackets as an operator that extracts the unit from a physical quantity (e.g.       [G] = Unit('W'/'cm'^2)).

• 

Adding a unit to each value at axes ticks would definitely be a nice labeling feature for simple units.

• 

Programmatically analyzing the units defined in list a above and converting them in a generic way to a typesetting structure is not possible with a few high-level commands.

 

• 

For inline quotients like in 1/2, an additional backslash must be entered in 2D-Math: \/  

Unit('W')/Unit('cm')^2

Units:-Unit(W)/Units:-Unit(cm)^2

(6)

     This will not prevent evaluation to a normal quotient but the input can be used to create an atomic variable (select with mouse -> 2-D Math -> Atomic Variable)

`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`

`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`

(7)

     This makes labeling much easier as compared to typesetting commands (compare to the above statements).

f := [b[1]/a[1], b[2]/`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`]

[t/Units:-Unit(s), G/`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`]

(8)

In any case it is a good idea to read ?plot,typesetting before experimenting with typesetting.

 

Axes_with_unit_labels.mw

My personal preference is for dimensionless labels.

Note:

The solution to avoid labeling errors works only for Maple 2022 and higher.

Some plot commands do not support plotting with units, or they do not fully support it yet.

 

A new “Sudoku Puzzle” document is now on Maple Learn! Sudoku is one of the world’s most popular puzzle games and it is now ready to play on our online platform. 

This document is a great example of how Maple scripts can be used to create complex and interactive content. Using Maple’s built-in DocumentTools:-Canvas package, anyone can build and share content in Maple Learn. If you are new to scripting, a great place to start is with one of the scripting templates, which are accessible through the Build Interactive Content help page. In fact, I built the Sudoku document script by starting from the “Clickable Plots” template.

A Sudoku puzzle is a special type of Latin Square. The concept of a Latin Square was introduced to the mathematical community by Leonard Euler in his 1782 paper, Recherches sur une nouvelle espèce de Quarrés, which translates to “Research on a new type of square”. A Latin Square is an n by n square array composed of n symbols, each repeated exactly once in every row and column. The Sudoku board is a Latin Square where n=9, the symbols are the digits from 1 to 9,  and there is an additional requirement that each 3 by 3 subgrid contains each digit exactly once. 

Mathematical research into Sudoku puzzles is still ongoing. While the theory about Latin Squares is extensive, the additional parameters and relative novelty of Sudoku means that there are still many open questions about the puzzle. For example, a 2023 paper from Peter Dukes and Kate Nimegeers examines Sudoku boards through the lenses of graph theory and linear algebra.

The modern game of Sudoku was created by a 74-year-old Indiana retiree named Howard Garnes in 1979 and published under the name “Number Place”. The game had gained popularity in Japan by the mid-1980s, where it was named “Sudoku,” an abbreviation of the phrase “Sūji wa dokushin ni kagiru,” which means “the numbers must be single”.

Today, Sudoku is a worldwide phenomenon. This number puzzle helps players practice using their logical reasoning, short-term memory, time management, and decision-making skills, all while having fun. Furthermore, research from the International Journal of Geriatric Psychiatry concluded that doing regular brain exercises, like solving a Sudoku, is correlated with better brain health for adults over 50 years old. Additionally, research published in the BMJ medical journal suggests that playing Sudoku can help your brain build and maintain cognition, meaning that mental decline due to degenerative conditions like Alzheimer’s would begin from a better initial state, and potentially delay severe symptoms. However, playing Sudoku will by no means cure or prevent such conditions.

If you are unfamiliar with the game of Sudoku, need a refresher on the rules, or want to improve your approach, the “Sudoku Rules and Strategies” document is the perfect place to start. This document will teach you essential strategies like Cross Hatching:

And Hidden Pairs:

After reading through this document, you will have all the tools you need to start solving puzzles with the “Sudoku Puzzle” document on Maple Learn. 

Have fun solving!

We have just released an update to Maple 2023 to address a couple of issues.

  • We’ve had a few reports of people encountering “Kernel connection has been lost” errors, and this update should fix that problem.
  • We fixed a problem involving entering math (specifically, the right curly bracket, } ) using an international keyboard.

If you are experiencing kernel connection problems or use Maple with an international keyboard, you should install this update.

This update is available through Tools>Check for Updates in Maple, and is also available from the Maple 2023.2.1 download page. MapleSim users can get this update from the MapleSim Check for Updates or from the MapleSim 2023.2.1 download page, where you will also find an update to the MapleSim Ropes and Pulleys Library.

1 2 3 4 5 6 7 Last Page 2 of 65