Symbolic Math in Maple vs. Mathcad – Maplesoft

Maple

Single User Licenses
Multi-User Licenses
Upgrade
What's New  |  Features  |  Online Demos  |  Compare  |  Training  |  Community  |  Free Trial  |  Buy Maple
Symbolic Math in Mathcad® vs Maple



Both Mathcad and Maple have their own unique design principles. However, Maple’s symbolic math engine is far more powerful, and is allied with an easy-to-use interface.

Here, we describe a few applications of symbolic math in Maple. These are applications for which Mathcad fails to give answers, or simply does not have the functionality to even attempt the analysis.

ODE Solving

Maple offers the world’s most powerful differential equation solvers.

Here, we solve the Euler-Bernoulli equation – a 4th order differential equation - for modeling the bending of a beam.


Euler-Bernoulli equation

deEIⅆ4ⅆx4wx=qx:




Initial and boundary conditions

ibcw0=0,wL=0,D@@2w0=0,D@@2wL=0:




Distributed load and point load

qxQ1Heavisidexa+FDiracxb:




Solve the differential equation for beam deflection

deSoldsolvede,ibc,wx:deflectionsimplifyrhsdeSol,symbolic

 

 Mathcad does not offer any tools for solving ODEs symbolically.

PDE Solving

Independent benchmarks show that Maple is the world’s best tool for solving PDEs. 

Here, we solve the heat equation. The answer is in terms of the error function, erf.

pde tux&comma;t&plus;1&equals;&mu; 2x2ux&comma;t&colon;  ivux&comma;1&equals;&lcub;0x11x<1&colon; pdsolvepde&comma;iv assuming &mu;&gt;0&comma; t&gt;0


ux&comma;t=32erf1+x2μt12t

Mathcad offers no tools for solving PDEs symbolically.


Solve Equations


Maple has the most powerful symbolic solvers of any math system – here’s why:

Special functions

For example, Maple has a broad database of special functions. These are normally only encountered in advanced mathematical analysis; a few examples are LambertW, Fresnel, Bessel and Appell. Maple lets you use these special functions without any specific training; this helps you rearrange and solve equations that are not possible in Mathcad.

Here, we rearrange the photovoltatic diode equation for the forward current – the result employs the LambertW function.


Mathcad only.

Rearrange complicated trigonometric relationships

Modeling the kinematics of a multibody system often results in complicated trigonometric relationships. Deriving the position constraints means you need to rearrange these equations to give the joint angles. This is a tough problem, especially for more complex systems.

Next, we solve for the position constraints of a 2-DOF robot arm to give the joint angles.



 

posConscosθ1Tx&plus;sinθ2&plus;sinθ1Tysinθ1Tx1cosθ2&plus;cosθ1Ty&colon;solsolveposCons1&comma;posCons2&comma;θ1&comma;θ2&comma;explicit

sol &theta; 1 = arctan Tx 2 Ty 2 + Tx 2 Ty + Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 Ty Tx 2 + Ty 2 Tx &comma; Tx 2 Ty + Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 Tx 2 + Ty 2 &comma; &theta; 2 = arctan 2 Tx 2 2 Ty 2 Tx 2 Ty + Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 4 Tx Tx 2 + Ty 2 + Tx 2 Ty + Ty 3 2 Tx &comma; Tx 2 2 + Ty 2 2 1 , &theta; 1 = arctan Tx 2 Ty 2 Tx 2 Ty Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 Ty Tx 2 + Ty 2 2 Tx &comma; Tx 2 Ty Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 2 Tx 2 + Ty 2 &comma; = arctan 2 Tx 2 2 Ty 2 Tx 2 Ty Ty 3 + Tx 6 2 Tx 4 Ty 2 Tx 2 Ty 4 + 4 Tx 4 + 4 Tx 2 Ty 2 4 Tx Tx 2 + Ty 2 + Tx 2 Ty + Ty 3 2 Tx &comma; Tx 2 2 + Ty 2 2 1

Mathcad will not rearrange these equations symbolically.

Control Systems Design

Maple offers tools for symbolic control systems modeling. Here, we find the symbolic controllability matrix for a dc motor described by two differential equations.

 

eq_sym Li&period;t&plus;Rit&equals;vtK&theta;&period;t&comma;  J&theta;..t&plus;b&theta;&period;t&plus;Ks&theta;t&equals;Kit&colon;  sys_symDynamicSystems:-StateSpaceeq_sym&comma;inputvariable&equals;vt&comma;outputvariable&equals;&theta;t&comma;it&colon;  DynamicSystems:-ControllabilityMatrixsys_sym


1LRL2R2L3K2L2J00KJL0KJLKRJL2bKJ2L


Mathcad offers no tools for symbolic control systems design.

Code Generation

Maple can generate C code from symbolic math results. Maple factors out common subexpressions; this makes the code far more numerically efficient than hand-written code.


t1 = Tx * Tx;
t2 = Ty * Ty;

t5 = t1 * t1;
t9 = t2 * t2;
t15 = sqrt(0.4e1 * t2 * t1 - t5 * t1 - t9 * t1 - 0.2e1 * t2 * t5 + 0.4e1 * t5);
t16 = Ty * t1 + t2 * Ty + t15;
t19 = 0.1e1 / (t1 + t2);
t25 = atan2(0.1e1 / Tx * (t19 * Ty * t16 - t1 - t2), t19 * t16);


Mathcad has no code translation tools.