MaplePrimes - Maplesoft Blog
http://www.mapleprimes.com/maplesoftblog
en-us2019 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemSat, 23 Mar 2019 20:41:38 GMTSat, 23 Mar 2019 20:41:38 GMTThe latest posts on the Maplesoft Bloghttp://www.mapleprimes.com/images/mapleprimeswhite.jpgMaplePrimes - Maplesoft Blog
http://www.mapleprimes.com/maplesoftblog
Writing Derivatives at a Point Using Leibniz Notation
https://www.mapleprimes.com/maplesoftblog/210289-Writing-Derivatives-At-A-Point-Using?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p>Maple users often want to write a derivative evaluated at a point using Leibniz notation, as a matter of presentation, with appropriate variables and coordinates. For instance:</p>
<p style="text-align: center;"><img src="/view.aspx?sf=210289_post/Image_01.png"></p>
<p align="center"> </p>
<p>Now, Maple uses the D operator for evaluating derivatives at a point, but this can be a little clunky:</p>
<pre>
p := D[1,2,2,3](f)(a,b,c);
q := convert( p, Diff );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_02.png"></p>
<pre>
u := D[1,2,2,3](f)(5,10,15);
v := convert( u, Diff );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_03.png"></p>
<p>How can we tell Maple, programmatically, to print this in a nicer way? We amended the print command (see below) to do this. For example:</p>
<pre>
print( D[1,2,2,3](f)(a,b,c), [x,y,z] );
print( D[1,2,2,3](f)(5,10,15), [x,y,z] );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_04.png"></p>
<pre>
print( 'D(sin)(Pi/6)', theta );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_05.png"></p>
<p>Here's the definition of the custom version of print:</p>
<pre>
# Type to check if an expression is a derivative using 'D', e.g. D(f)(a) and D[1,2](f)(a,b).
TypeTools:-AddType(
'Dexpr',
proc( f )
if op( [0,0], f ) <> D and op( [0,0,0], f ) <> D then
return false;
end if;
if not type( op( [0,1], f ), 'name' ) or not type( { op( f ) }, 'set(algebraic)' ) then
return false;
end if;
if op( [0,0,0], f ) = D and not type( { op( [0,0,..], f ) }, 'set(posint)' ) then
return false;
end if;
return true;
end proc
):
# Create a local version of 'print', which will print expressions like D[1,2](f)(a,b) in a custom way,
# but otherwise print in the usual fashion.
local print := proc()
local A, B, f, g, L, X, Y, Z;
# Check that a valid expression involving 'D' is passed, along with a variable name or list of variable names.
if ( _npassed < 2 ) or ( not _passed[1] :: 'Dexpr' ) or ( not passed[2] :: 'Or'('name','list'('name')) ) then
return :-print( _passed );
end if;
# Extract important variables from the input.
g := _passed[1]; # expression
X := _passed[2]; # variable name(s)
f := op( [0,1], g ); # function name in expression
A := op( g ); # point(s) of evaluation
# Check that the number of variables is the same as the number of evaluation points.
if nops( X ) <> nops( [A] ) then
return :-print( _passed );
end if;
# The differential operator.
L := op( [0,0], g );
# Find the variable (univariate) or indices (multivariate) for the derivative(s).
B := `if`( L = D, X, [ op( L ) ] );
# Variable name(s) as expression sequence.
Y := op( X );
# Check that the point(s) of evaluation is/are distinct from the variable name(s).
if numelems( {Y} intersect {A} ) > 0 then
return :-print( _passed );
end if;
# Find the expression sequence of the variable names.
Z := `if`( L = D, X, X[B] );
return print( Eval( Diff( f(Y), Z ), (Y) = (A) ) );
end proc:
</pre>
<p>Do you use Leibniz Notation often? Or do you have an alternate method? We’d love to hear from you!</p>
<p>Maple users often want to write a derivative evaluated at a point using Leibniz notation, as a matter of presentation, with appropriate variables and coordinates. For instance:</p>
<p style="text-align: center;"><img src="/view.aspx?sf=210289_post/Image_01.png"></p>
<p align="center"> </p>
<p>Now, Maple uses the D operator for evaluating derivatives at a point, but this can be a little clunky:</p>
<pre>
p := D[1,2,2,3](f)(a,b,c);
q := convert( p, Diff );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_02.png"></p>
<pre>
u := D[1,2,2,3](f)(5,10,15);
v := convert( u, Diff );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_03.png"></p>
<p>How can we tell Maple, programmatically, to print this in a nicer way? We amended the print command (see below) to do this. For example:</p>
<pre>
print( D[1,2,2,3](f)(a,b,c), [x,y,z] );
print( D[1,2,2,3](f)(5,10,15), [x,y,z] );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_04.png"></p>
<pre>
print( 'D(sin)(Pi/6)', theta );</pre>
<p align="center"><img src="/view.aspx?sf=210289_post/Image_05.png"></p>
<p>Here's the definition of the custom version of print:</p>
<pre>
# Type to check if an expression is a derivative using 'D', e.g. D(f)(a) and D[1,2](f)(a,b).
TypeTools:-AddType(
'Dexpr',
proc( f )
if op( [0,0], f ) <> D and op( [0,0,0], f ) <> D then
return false;
end if;
if not type( op( [0,1], f ), 'name' ) or not type( { op( f ) }, 'set(algebraic)' ) then
return false;
end if;
if op( [0,0,0], f ) = D and not type( { op( [0,0,..], f ) }, 'set(posint)' ) then
return false;
end if;
return true;
end proc
):
# Create a local version of 'print', which will print expressions like D[1,2](f)(a,b) in a custom way,
# but otherwise print in the usual fashion.
local print := proc()
local A, B, f, g, L, X, Y, Z;
# Check that a valid expression involving 'D' is passed, along with a variable name or list of variable names.
if ( _npassed < 2 ) or ( not _passed[1] :: 'Dexpr' ) or ( not passed[2] :: 'Or'('name','list'('name')) ) then
return :-print( _passed );
end if;
# Extract important variables from the input.
g := _passed[1]; # expression
X := _passed[2]; # variable name(s)
f := op( [0,1], g ); # function name in expression
A := op( g ); # point(s) of evaluation
# Check that the number of variables is the same as the number of evaluation points.
if nops( X ) <> nops( [A] ) then
return :-print( _passed );
end if;
# The differential operator.
L := op( [0,0], g );
# Find the variable (univariate) or indices (multivariate) for the derivative(s).
B := `if`( L = D, X, [ op( L ) ] );
# Variable name(s) as expression sequence.
Y := op( X );
# Check that the point(s) of evaluation is/are distinct from the variable name(s).
if numelems( {Y} intersect {A} ) > 0 then
return :-print( _passed );
end if;
# Find the expression sequence of the variable names.
Z := `if`( L = D, X, X[B] );
return print( Eval( Diff( f(Y), Z ), (Y) = (A) ) );
end proc:
</pre>
<p>Do you use Leibniz Notation often? Or do you have an alternate method? We’d love to hear from you!</p>
210289Fri, 15 Mar 2019 18:28:14 ZTechnicalSupportTechnicalSupportAnnouncing Maple 2019
https://www.mapleprimes.com/maplesoftblog/210286-Announcing-Maple-2019?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p><img src="/view.aspx?sf=210286_post/LaunchBlogPost_Header.jpg"></p>
<p>Last year, I read a <a href="https://iopscience.iop.org/article/10.1086/375027/meta">fascinating paper</a> that presented evidence of an <a href="https://en.wikipedia.org/wiki/54_Piscium_b">exoplanet</a>, inferred through the “wobble” (or radial velocity) of the star it orbits, <a href="http://www.openexoplanetcatalogue.com/planet/HD%203651%20b/">HD 3651</a>. A periodogram of the radial velocity revealed the orbital period of the exoplanet – about 62.2 days.</p>
<p>I found the <a href="https://iopscience.iop.org/article/10.1086/375027/fulltext/57495.tb1.html">experimental data</a> and attempted to reproduce the periodogram. However, the data was irregularly sampled, as is most astronomical data. This meant I couldn’t use the standard Fourier-based tools from the <a href="https://www.maplesoft.com/products/maple/features/Signal_Processing.aspx">signal processing</a> package.</p>
<p>I started hunting for the techniques used in the spectral analysis of irregularly sampled data, and found that the <a href="https://en.wikipedia.org/wiki/Least-squares_spectral_analysis#The_Lomb%E2%80%93Scargle_periodogram">Lomb Scargle</a> approach was often used for astronomical data. I threw together some simple prototype code and successfully reproduced the periodogram in the paper.</p>
<p><img src="/view.aspx?sf=210286_post/Lomb_Scargle.png"></p>
<p> </p>
<p>After some (not so) gentle prodding, <a href="https://www.mapleprimes.com/users/epostma">Erik Postma</a>’s team wrote their own, far faster and far more robust, implementation.</p>
<p>This new functionality makes its debut in Maple 2019 (and the final worksheet is <a href="https://www.maplesoft.com/applications/view.aspx?SID=154528">here</a>.)</p>
<p>From a simple germ of an idea, to a finished, robust, fully documented product that we can put in front of our users – that, for me, is incredibly satisfying.</p>
<p>That’s a minor story about a niche I’m interested in, but these stories are repeated time and time again. Ideas spring from users and from those that work at Maplesoft. They’re filtered to a manageable set that we can work on. Some projects reach completion in under a year, while other, more ambitious, projects take longer.</p>
<p><strong>The result is software developed by passionate people invested in their work, and used by passionate people in universities, industry and at home.</strong></p>
<p>We always pack a lot into each release. Maple 2019 contains improvements for the most commonly used Maple functions that nearly everyone uses – such as <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=solve">solve</a>, <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a> and <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=int">int</a> – as well features that target specific groups (such as those that share my interest in signal processing!)</p>
<p>I’d like to to highlight a few new of the new features that I find particularly impressive, or have just caught my eye because <em>they’re cool</em>.</p>
<p>Of course, this is only a small selection of the shiny new stuff – everything is described in detail on the <a href="https://www.maplesoft.com/products/maple/new_features/">Maplesoft website</a>.</p>
<p><a href="https://www.mapleprimes.com/users/Edgardo%20Cheb-Terrab">Edgardo</a>, research fellow at Maplesoft, recently sent me a <a href="https://www.12000.org/my_notes/pde_in_CAS/pdse2.htm#x3-20002">recent independent comparison of Maple’s PDE solver versus those in Mathematica</a> (in case you’re not aware, he’s the senior developer for that function). He was excited – this test suite demonstrated that Maple was far ahead of its closest competitor, both in the number of PDEs solved, and the time taken to return those solutions.</p>
<p>He’s spent another release cycle working on <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=pdsolve">pdsolve</a> – it’s now more powerful than before. Here’s a PDE that Maple now successfully solves.</p>
<p><img src="/view.aspx?sf=210286_post/pdsolve.png"></p>
<p>Maplesoft tracks visits to our online help pages - <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a> is well-inside the top-ten most visited pages. It’s one of those core functions that nearly everyone uses.</p>
<p>For this release, R&D has made many improvements to <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a>. For example, Maple 2019 better simplifies expressions that contain powers, exponentials and trig functions.</p>
<p><img src="/view.aspx?sf=210286_post/simplify.png"></p>
<p>Everyone who touches Maple uses the same programming language. You could be an engineer that’s batch processing some data, or a mathematical researcher prototyping a new algorithm – everyone codes in the same language.</p>
<p>Maple now supports C-style increment, decrement, and assignment operators, giving you more concise code.</p>
<p><img src="/view.aspx?sf=210286_post/increment_decrement.png"></p>
<p>We’ve made a number of improvements to the interface, including a redesigned start page. My favorite is the display of large data structures (or rtables).</p>
<p>You now see the header (that is, the top-left) of the data structure.</p>
<p><img src="/view.aspx?sf=210286_post/matrix.png"></p>
<p>For an audio file, you see useful information about its contents.</p>
<p><img src="/view.aspx?sf=210286_post/audio.png"></p>
<p>I enjoy creating new and different types of visualizations using Maple's sandbox of flexible plots and plotting primitives.</p>
<p>Here’s a new feature that I’ll use regularly: given a name (and optionally a modifier), polygonbyname draws a variety of shapes.</p>
<p>In other breaking news, I now know what a Reuleaux hexagon looks like.</p>
<p><img src="/view.aspx?sf=210286_post/polygonbyname.png"></p>
<p>Since I can’t resist talking about another signal processing feature, FindPeakPoints locates the local peaks or valleys of a 1D data set. Several options let you filter out spurious peaks or valleys</p>
<p><img src="/view.aspx?sf=210286_post/findpeakpoints.png"></p>
<p>I’ve used this new function to find the <a href="https://www.maplesoft.com/applications/view.aspx?SID=154524">fundamental frequencies and harmonics of a violin note from its periodogram</a>.</p>
<p><img src="/view.aspx?sf=210286_post/violin.png"></p>
<p>Speaking of passionate developers who are devoted to their work, <a href="https://www.mapleprimes.com/users/Edgardo%20Cheb-Terrab">Edgardo</a> has written a new e-book that teaches you how to use tensor computations using Physics. You get this e-book when you install Maple 2019.</p>
<p><img src="/view.aspx?sf=210286_post/tensor_ebook.png"></p>
<p>The new LeastTrimmedSquares command fits data to an equation while not being signficantly influenced by outliers.</p>
<p>In this example, we:</p>
<ul>
<li>Artifically generate a noisy data set with a few outliers, but with the underlying trend Y =5 X + 50</li>
<li>Fit straight lines using CurveFitting:-LeastSquares and Statistics:-LeastTrimmedSquares</li>
</ul>
<p>LeastTrimmedSquares function correctly predicts the underlying trend.</p>
<p><img src="/view.aspx?sf=210286_post/leasttrimmedsquares.png"></p>
<p>We try to make every release faster and more efficient. We sometimes target key changes in the core infrastructure that benefit all users (such as the <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple17/ParallelGarbageCollector">parallel garbage collector in Maple 17</a>). Other times, we focus on specific functions.</p>
<p>For this release, I’m particularly impressed by this improved benchmark for factor, in which we’re factoring a sparse multivariate polynomial.</p>
<p><img src="/view.aspx?sf=210286_post/factor.png"></p>
<p>On my laptop, Maple 2018 takes 4.2 seconds to compute and consumes 0.92 GiB of memory.</p>
<p>Maple 2019 takes a mere 0.27 seconds, and only needs 45 MiB of memory!</p>
<p><a href="https://www.mapleprimes.com/maplesoftblog/208357-My-Favourite-Maple-Visualizations">I’m a visualization nut</a>, and I always get a vicarious thrill when I see a shiny new plot, or a well-presented application.</p>
<p>I was immediately drawn to this new Maple 2019 app – it illustrates the transition between day and night on a world map. You can even change the projection used to generate the map. Shiny!</p>
<p><img src="/view.aspx?sf=210286_post/day_night_terminator.png"></p>
<p> </p>
<p>So that’s my pick of the top new features in Maple 2019. Everyone here at Maplesoft would love to hear your comments!</p>
<p><img src="/view.aspx?sf=210286_post/LaunchBlogPost_Header.jpg"></p>
<p>Last year, I read a <a href="https://iopscience.iop.org/article/10.1086/375027/meta">fascinating paper</a> that presented evidence of an <a href="https://en.wikipedia.org/wiki/54_Piscium_b">exoplanet</a>, inferred through the “wobble” (or radial velocity) of the star it orbits, <a href="http://www.openexoplanetcatalogue.com/planet/HD%203651%20b/">HD 3651</a>. A periodogram of the radial velocity revealed the orbital period of the exoplanet – about 62.2 days.</p>
<p>I found the <a href="https://iopscience.iop.org/article/10.1086/375027/fulltext/57495.tb1.html">experimental data</a> and attempted to reproduce the periodogram. However, the data was irregularly sampled, as is most astronomical data. This meant I couldn’t use the standard Fourier-based tools from the <a href="https://www.maplesoft.com/products/maple/features/Signal_Processing.aspx">signal processing</a> package.</p>
<p>I started hunting for the techniques used in the spectral analysis of irregularly sampled data, and found that the <a href="https://en.wikipedia.org/wiki/Least-squares_spectral_analysis#The_Lomb%E2%80%93Scargle_periodogram">Lomb Scargle</a> approach was often used for astronomical data. I threw together some simple prototype code and successfully reproduced the periodogram in the paper.</p>
<p><img src="/view.aspx?sf=210286_post/Lomb_Scargle.png"></p>
<p> </p>
<p>After some (not so) gentle prodding, <a href="https://www.mapleprimes.com/users/epostma">Erik Postma</a>’s team wrote their own, far faster and far more robust, implementation.</p>
<p>This new functionality makes its debut in Maple 2019 (and the final worksheet is <a href="https://www.maplesoft.com/applications/view.aspx?SID=154528">here</a>.)</p>
<p>From a simple germ of an idea, to a finished, robust, fully documented product that we can put in front of our users – that, for me, is incredibly satisfying.</p>
<p>That’s a minor story about a niche I’m interested in, but these stories are repeated time and time again. Ideas spring from users and from those that work at Maplesoft. They’re filtered to a manageable set that we can work on. Some projects reach completion in under a year, while other, more ambitious, projects take longer.</p>
<p><strong>The result is software developed by passionate people invested in their work, and used by passionate people in universities, industry and at home.</strong></p>
<p>We always pack a lot into each release. Maple 2019 contains improvements for the most commonly used Maple functions that nearly everyone uses – such as <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=solve">solve</a>, <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a> and <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=int">int</a> – as well features that target specific groups (such as those that share my interest in signal processing!)</p>
<p>I’d like to to highlight a few new of the new features that I find particularly impressive, or have just caught my eye because <em>they’re cool</em>.</p>
<p>Of course, this is only a small selection of the shiny new stuff – everything is described in detail on the <a href="https://www.maplesoft.com/products/maple/new_features/">Maplesoft website</a>.</p>
<p><a href="https://www.mapleprimes.com/users/Edgardo%20Cheb-Terrab">Edgardo</a>, research fellow at Maplesoft, recently sent me a <a href="https://www.12000.org/my_notes/pde_in_CAS/pdse2.htm#x3-20002">recent independent comparison of Maple’s PDE solver versus those in Mathematica</a> (in case you’re not aware, he’s the senior developer for that function). He was excited – this test suite demonstrated that Maple was far ahead of its closest competitor, both in the number of PDEs solved, and the time taken to return those solutions.</p>
<p>He’s spent another release cycle working on <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=pdsolve">pdsolve</a> – it’s now more powerful than before. Here’s a PDE that Maple now successfully solves.</p>
<p><img src="/view.aspx?sf=210286_post/pdsolve.png"></p>
<p>Maplesoft tracks visits to our online help pages - <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a> is well-inside the top-ten most visited pages. It’s one of those core functions that nearly everyone uses.</p>
<p>For this release, R&D has made many improvements to <a href="https://www.maplesoft.com/support/help/maple/view.aspx?path=simplify">simplify</a>. For example, Maple 2019 better simplifies expressions that contain powers, exponentials and trig functions.</p>
<p><img src="/view.aspx?sf=210286_post/simplify.png"></p>
<p>Everyone who touches Maple uses the same programming language. You could be an engineer that’s batch processing some data, or a mathematical researcher prototyping a new algorithm – everyone codes in the same language.</p>
<p>Maple now supports C-style increment, decrement, and assignment operators, giving you more concise code.</p>
<p><img src="/view.aspx?sf=210286_post/increment_decrement.png"></p>
<p>We’ve made a number of improvements to the interface, including a redesigned start page. My favorite is the display of large data structures (or rtables).</p>
<p>You now see the header (that is, the top-left) of the data structure.</p>
<p><img src="/view.aspx?sf=210286_post/matrix.png"></p>
<p>For an audio file, you see useful information about its contents.</p>
<p><img src="/view.aspx?sf=210286_post/audio.png"></p>
<p>I enjoy creating new and different types of visualizations using Maple's sandbox of flexible plots and plotting primitives.</p>
<p>Here’s a new feature that I’ll use regularly: given a name (and optionally a modifier), polygonbyname draws a variety of shapes.</p>
<p>In other breaking news, I now know what a Reuleaux hexagon looks like.</p>
<p><img src="/view.aspx?sf=210286_post/polygonbyname.png"></p>
<p>Since I can’t resist talking about another signal processing feature, FindPeakPoints locates the local peaks or valleys of a 1D data set. Several options let you filter out spurious peaks or valleys</p>
<p><img src="/view.aspx?sf=210286_post/findpeakpoints.png"></p>
<p>I’ve used this new function to find the <a href="https://www.maplesoft.com/applications/view.aspx?SID=154524">fundamental frequencies and harmonics of a violin note from its periodogram</a>.</p>
<p><img src="/view.aspx?sf=210286_post/violin.png"></p>
<p>Speaking of passionate developers who are devoted to their work, <a href="https://www.mapleprimes.com/users/Edgardo%20Cheb-Terrab">Edgardo</a> has written a new e-book that teaches you how to use tensor computations using Physics. You get this e-book when you install Maple 2019.</p>
<p><img src="/view.aspx?sf=210286_post/tensor_ebook.png"></p>
<p>The new LeastTrimmedSquares command fits data to an equation while not being signficantly influenced by outliers.</p>
<p>In this example, we:</p>
<ul>
<li>Artifically generate a noisy data set with a few outliers, but with the underlying trend Y =5 X + 50</li>
<li>Fit straight lines using CurveFitting:-LeastSquares and Statistics:-LeastTrimmedSquares</li>
</ul>
<p>LeastTrimmedSquares function correctly predicts the underlying trend.</p>
<p><img src="/view.aspx?sf=210286_post/leasttrimmedsquares.png"></p>
<p>We try to make every release faster and more efficient. We sometimes target key changes in the core infrastructure that benefit all users (such as the <a href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple17/ParallelGarbageCollector">parallel garbage collector in Maple 17</a>). Other times, we focus on specific functions.</p>
<p>For this release, I’m particularly impressed by this improved benchmark for factor, in which we’re factoring a sparse multivariate polynomial.</p>
<p><img src="/view.aspx?sf=210286_post/factor.png"></p>
<p>On my laptop, Maple 2018 takes 4.2 seconds to compute and consumes 0.92 GiB of memory.</p>
<p>Maple 2019 takes a mere 0.27 seconds, and only needs 45 MiB of memory!</p>
<p><a href="https://www.mapleprimes.com/maplesoftblog/208357-My-Favourite-Maple-Visualizations">I’m a visualization nut</a>, and I always get a vicarious thrill when I see a shiny new plot, or a well-presented application.</p>
<p>I was immediately drawn to this new Maple 2019 app – it illustrates the transition between day and night on a world map. You can even change the projection used to generate the map. Shiny!</p>
<p><img src="/view.aspx?sf=210286_post/day_night_terminator.png"></p>
<p> </p>
<p>So that’s my pick of the top new features in Maple 2019. Everyone here at Maplesoft would love to hear your comments!</p>
210286Thu, 14 Mar 2019 15:33:15 ZSamir KhanSamir KhanThe Maple Conference is Back!
https://www.mapleprimes.com/maplesoftblog/210173-The-Maple-Conference-Is-Back?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p>It is my pleasure to announce the return of the <a href="https://www.maplesoft.com/mapleconference/">Maple Conference</a>! On October 15-17<sup>th</sup>, in Waterloo, Ontario, Canada, we will gather a group of Maple enthusiasts, product experts, and customers, to explore and celebrate the different aspects of Maple.</p>
<p>Specifically, this conference will be dedicated to exploring Maple’s impact on education, new symbolic computation algorithms and techniques, and the wide range of Maple applications. Attendees will have the opportunity to learn about the latest research, share experiences, and interact with Maple developers.</p>
<p>In preparation for the conference we are welcoming paper and extended abstract submissions. We are looking for presentations which fall into the broad categories of “Maple in Education”, “Algorithms and Software”, and “Applications of Maple” (a more extensive list of topics can be found <a href="https://www.maplesoft.com/mapleconference/">here</a>).</p>
<p>You can learn more about the event, plus find our call-for-papers and abstracts, here: <a href="https://www.maplesoft.com/mapleconference/">https://www.maplesoft.com/mapleconference/</a></p>
<p>It is my pleasure to announce the return of the <a href="https://www.maplesoft.com/mapleconference/">Maple Conference</a>! On October 15-17<sup>th</sup>, in Waterloo, Ontario, Canada, we will gather a group of Maple enthusiasts, product experts, and customers, to explore and celebrate the different aspects of Maple.</p>
<p>Specifically, this conference will be dedicated to exploring Maple’s impact on education, new symbolic computation algorithms and techniques, and the wide range of Maple applications. Attendees will have the opportunity to learn about the latest research, share experiences, and interact with Maple developers.</p>
<p>In preparation for the conference we are welcoming paper and extended abstract submissions. We are looking for presentations which fall into the broad categories of “Maple in Education”, “Algorithms and Software”, and “Applications of Maple” (a more extensive list of topics can be found <a href="https://www.maplesoft.com/mapleconference/">here</a>).</p>
<p>You can learn more about the event, plus find our call-for-papers and abstracts, here: <a href="https://www.maplesoft.com/mapleconference/">https://www.maplesoft.com/mapleconference/</a></p>
210173Fri, 15 Feb 2019 14:26:38 ZKatKatHow MapleSim Helped Canada’s Paralympic Curling Team
https://www.mapleprimes.com/maplesoftblog/210089-How-MapleSim-Helped-Canadas-Paralympic?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p>Recently, my research team at the University of Waterloo was approached by Mark Ideson, the skip for the Canadian Paralympic men’s curling team, about developing a curling end-effector, a device to give wheelchair curlers greater control over their shots. A gold medalist and multi-medal winner at the Paralympics, Mark has a passion to see wheelchair curling performance improve and entrusted us to assist him in this objective. We previously worked with Mark and his team on a research project to model the wheelchair curling shot and help optimize their performance on the ice. The end-effector project was the next step in our partnership.</p>
<p>The use of technology in the sports world is increasing rapidly, allowing us to better understand athletic performance. We are able to gather new types of data that, when coupled with advanced engineering tools, allow us to perform more in-depth analysis of the human body as it pertains to specific movements and tasks. As a result, we can refine motions and improve equipment to help athletes maximize their abilities and performance. As a professor of Systems Design Engineering at the University of Waterloo, I have overseen several studies on the motor function of Paralympic athletes. My team focuses on modelling the interactions between athletes and their equipment to maximize athletic performance, and we rely heavily on Maple and MapleSim in our research and project development.</p>
<p>The end-effector project was led by my UW students Borna Ghannadi and Conor Jansen. The objective was to design a device that attaches to the end of the curler’s stick and provides greater command over the stone by pulling it back prior to release. Our team modeled the end effector in Maple and built an initial prototype, which has undergone several trials and adjustments since then. The device is now on its 7<sup>th</sup> iteration, which we felt appropriate to name the Mark 7, in recognition of Mark’s inspiration for the project. The device has been a challenge, but we have steadily made improvements with Mark’s input and it is close to being a finished product.</p>
<p><img src="/view.aspx?sf=210089_post/IMG_0623.jpg"></p>
<p>Currently, wheelchair curlers use a device that keeps the stone static before it’s thrown. Having the ability to pull back on the stone and break the friction prior to release will provide great benefit to the curlers. As a curler, if you can only push forward and the ice conditions aren’t perfect, you’re throwing at a different speed every time. If you can pull the stone back and then go forward, you’ve broken that friction and your shot is far more repeatable. This should make the game much more interesting.</p>
<p>For our team, the objective was to design a mechanism that not only allowed curlers to pull back on the stone, but also had a release option with no triggers on the curler’s hand. The device we developed screws on to the end of the curler’s stick, and is designed to rest firmly on the curling handle. Once the curler selects their shot, they can position the stone accordingly, slide the stone backward and then forward, and watch the device gently separate from the stone.</p>
<p><img src="/view.aspx?sf=210089_post/IMG_0677.jpg"></p>
<p>For our research, the increased speed and accuracy of MapleSim’s multibody dynamic simulations, made possible by the underlying symbolic modelling engine, Maple, allowed us to spend more time on system design and optimization. MapleSim combines principles of mechanics with linear graph theory to produce unified representations of the system topology and modelling coordinates. The system equations are automatically generated symbolically, which enables us to view and share the equations prior to a numerical solution of the highly-optimized simulation code.</p>
<p>The Mark 7 is an invention that could have significant ramifications in the curling world. Shooting accuracy across wheelchair curling is currently around 60-62%, and if new technology like the Mark 7 is adopted, that number could grow to 70 or 75%. Improved accuracy will make the game more enjoyable and competitive. Having the ability to pull back on the stone prior to release will eliminate some instability for the curlers, which can help level the playing field for everyone involved. Given the work we have been doing with Mark’s team on performance improvements, it was extremely satisfying for us to see them win the bronze medal in South Korea. We hope that our research and partnership with the team can produce gold medals in the years to come.</p>
<p> </p>
<p>Recently, my research team at the University of Waterloo was approached by Mark Ideson, the skip for the Canadian Paralympic men’s curling team, about developing a curling end-effector, a device to give wheelchair curlers greater control over their shots. A gold medalist and multi-medal winner at the Paralympics, Mark has a passion to see wheelchair curling performance improve and entrusted us to assist him in this objective. We previously worked with Mark and his team on a research project to model the wheelchair curling shot and help optimize their performance on the ice. The end-effector project was the next step in our partnership.</p>
<p>The use of technology in the sports world is increasing rapidly, allowing us to better understand athletic performance. We are able to gather new types of data that, when coupled with advanced engineering tools, allow us to perform more in-depth analysis of the human body as it pertains to specific movements and tasks. As a result, we can refine motions and improve equipment to help athletes maximize their abilities and performance. As a professor of Systems Design Engineering at the University of Waterloo, I have overseen several studies on the motor function of Paralympic athletes. My team focuses on modelling the interactions between athletes and their equipment to maximize athletic performance, and we rely heavily on Maple and MapleSim in our research and project development.</p>
<p>The end-effector project was led by my UW students Borna Ghannadi and Conor Jansen. The objective was to design a device that attaches to the end of the curler’s stick and provides greater command over the stone by pulling it back prior to release. Our team modeled the end effector in Maple and built an initial prototype, which has undergone several trials and adjustments since then. The device is now on its 7<sup>th</sup> iteration, which we felt appropriate to name the Mark 7, in recognition of Mark’s inspiration for the project. The device has been a challenge, but we have steadily made improvements with Mark’s input and it is close to being a finished product.</p>
<p><img src="/view.aspx?sf=210089_post/IMG_0623.jpg"></p>
<p>Currently, wheelchair curlers use a device that keeps the stone static before it’s thrown. Having the ability to pull back on the stone and break the friction prior to release will provide great benefit to the curlers. As a curler, if you can only push forward and the ice conditions aren’t perfect, you’re throwing at a different speed every time. If you can pull the stone back and then go forward, you’ve broken that friction and your shot is far more repeatable. This should make the game much more interesting.</p>
<p>For our team, the objective was to design a mechanism that not only allowed curlers to pull back on the stone, but also had a release option with no triggers on the curler’s hand. The device we developed screws on to the end of the curler’s stick, and is designed to rest firmly on the curling handle. Once the curler selects their shot, they can position the stone accordingly, slide the stone backward and then forward, and watch the device gently separate from the stone.</p>
<p><img src="/view.aspx?sf=210089_post/IMG_0677.jpg"></p>
<p>For our research, the increased speed and accuracy of MapleSim’s multibody dynamic simulations, made possible by the underlying symbolic modelling engine, Maple, allowed us to spend more time on system design and optimization. MapleSim combines principles of mechanics with linear graph theory to produce unified representations of the system topology and modelling coordinates. The system equations are automatically generated symbolically, which enables us to view and share the equations prior to a numerical solution of the highly-optimized simulation code.</p>
<p>The Mark 7 is an invention that could have significant ramifications in the curling world. Shooting accuracy across wheelchair curling is currently around 60-62%, and if new technology like the Mark 7 is adopted, that number could grow to 70 or 75%. Improved accuracy will make the game more enjoyable and competitive. Having the ability to pull back on the stone prior to release will eliminate some instability for the curlers, which can help level the playing field for everyone involved. Given the work we have been doing with Mark’s team on performance improvements, it was extremely satisfying for us to see them win the bronze medal in South Korea. We hope that our research and partnership with the team can produce gold medals in the years to come.</p>
<p> </p>
210089Wed, 23 Jan 2019 21:45:20 ZJohn McPheeJohn McPheeSome Interesting Applications from 2018
https://www.mapleprimes.com/maplesoftblog/210069-Some-Interesting-Applications-From-2018?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p>Throughout the course of a year, Maple users create wildly varying applications on all sorts of subjects. To mark the end of 2018, I thought I’d share some of the 2018 submissions to the Maple Application Center that I personally found particularly interesting.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154509">Solving the 15-puzzle</a>, by Curtis Bright. You know those puzzles where you have to move the pieces around inside a square to put them in order, and there’s only one free space to move into? I’m not good at those puzzles, but it turns out Maple can help. This is one of collection of new, varied applications using Maple’s SAT solvers (if you want to <a href="https://www.maplesoft.com/applications/view.aspx?SID=154483">solve the world’s hardest Sudoku</a>, Maple’s SAT solvers can help with that, too).</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154451">Romeo y Julieta: Un clasico de las historias de amor... y de las ecuaciones diferenciales</a> [Romeo and Juliet: A classic story of love..and differential equations], by Ranferi Gutierrez. This one made me laugh (and even more so once I put some of it in google translate, which is more than enough to let you appreciate the application even if you don’t speak Spanish). What’s not to like about modeling a high drama love story using DEs?</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154469">Prediction of malignant/benign of breast mass with DNN classifier</a>, by Sophie Tan. Machine learning can save lives.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154489">Hybrid Image of a Cat and a Dog</a>, by Samir Khan. Signal processing can be more fun that I realized. This is one of those crazy optical illusions where the picture changes depending on how far away you are.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154386">Beyond the 8 Queens Problem</a>, by Yury Zavarovsky. In true mathematical fashion, why have 8 queens when you can have <em>n</em>? (If you are interested in this problem, you can also see a <a href="https://www.maplesoft.com/applications/view.aspx?SID=154482">different solution that uses SAT solvers</a>.)</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154430">Gödel's Universe</a>, by Frank Wang. Can’t say I understood much of it, but it involves Gödel, Einstein, and Hawking, so I don’t need to understand it to find it interesting.</p>
<p>Throughout the course of a year, Maple users create wildly varying applications on all sorts of subjects. To mark the end of 2018, I thought I’d share some of the 2018 submissions to the Maple Application Center that I personally found particularly interesting.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154509">Solving the 15-puzzle</a>, by Curtis Bright. You know those puzzles where you have to move the pieces around inside a square to put them in order, and there’s only one free space to move into? I’m not good at those puzzles, but it turns out Maple can help. This is one of collection of new, varied applications using Maple’s SAT solvers (if you want to <a href="https://www.maplesoft.com/applications/view.aspx?SID=154483">solve the world’s hardest Sudoku</a>, Maple’s SAT solvers can help with that, too).</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154451">Romeo y Julieta: Un clasico de las historias de amor... y de las ecuaciones diferenciales</a> [Romeo and Juliet: A classic story of love..and differential equations], by Ranferi Gutierrez. This one made me laugh (and even more so once I put some of it in google translate, which is more than enough to let you appreciate the application even if you don’t speak Spanish). What’s not to like about modeling a high drama love story using DEs?</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154469">Prediction of malignant/benign of breast mass with DNN classifier</a>, by Sophie Tan. Machine learning can save lives.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154489">Hybrid Image of a Cat and a Dog</a>, by Samir Khan. Signal processing can be more fun that I realized. This is one of those crazy optical illusions where the picture changes depending on how far away you are.</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154386">Beyond the 8 Queens Problem</a>, by Yury Zavarovsky. In true mathematical fashion, why have 8 queens when you can have <em>n</em>? (If you are interested in this problem, you can also see a <a href="https://www.maplesoft.com/applications/view.aspx?SID=154482">different solution that uses SAT solvers</a>.)</p>
<p><a href="https://www.maplesoft.com/applications/view.aspx?SID=154430">Gödel's Universe</a>, by Frank Wang. Can’t say I understood much of it, but it involves Gödel, Einstein, and Hawking, so I don’t need to understand it to find it interesting.</p>
210069Tue, 15 Jan 2019 17:00:03 ZeithneeithneHow to Complete the Square in Maple
https://www.mapleprimes.com/maplesoftblog/210053-How-To-Complete-The-Square-In-Maple?ref=Feed:MaplePrimes:Maplesoft%20Blog
<p>A common question to our tech support team is about completing the square for a univariate polynomial of even degree, and how to do that in Maple. We’ve put together a solution that we think you’ll find useful. If you have any alternative methods or improvements to our code, let us know!</p>
<div>
<pre>
restart;
# Procedure to complete the square for a univariate
# polynomial of even degree.
CompleteSquare := proc( f :: depends( 'And'( polynom, 'satisfies'( g -> ( type( degree(g,x), even ) ) ) ) ), x :: name )
local a, g, k, n, phi, P, Q, r, S, T, u:
# Degree and parameters of polynomial.
n := degree( f, x ):
P := indets( f, name ) minus { x }:
# General polynomial of square plus constant.
g := add( a[k] * x^k, k=0..n/2 )^2 + r:
# Solve for unknowns in g.
Q := indets( g, name ) minus P:
S := map( expand, { solve( identity( expand( f - g ) = 0, x ), Q ) } ):
if numelems( S ) = 0 then
return NULL:
end if:
# Evaluate g at the solution, and re-write square term
# so that the polynomial within the square is monic.
phi := u -> lcoeff(op(1,u),x)^2 * (expand(op(1,u)/lcoeff(op(1,u),x)))^2:
T := map( evalindets, map( u -> eval(g,u), S ), `^`(anything,identical(2)), phi ):
return `if`( numelems(T) = 1, T[], T ):
end proc:
# Examples.
CompleteSquare( x^2 + 3 * x + 2, x );
CompleteSquare( a * x^2 + b * x + c, x );
CompleteSquare( 4 * x^8 + 8 * x^6 + 4 * x^4 - 246, x );
m, n := 4, 10;
r := rand(-10..10):
for i from 1 to n do
CompleteSquare( r() * ( x^(m/2) + randpoly( x, degree=m-1, coeffs=r ) )^2 + r(), x );
end do;
# Compare quadratic examples with Student:-Precalculus:-CompleteSquare()
# (which is restricted to quadratic expressions).
Student:-Precalculus:-CompleteSquare( x^2 + 3 * x + 2 );
Student:-Precalculus:-CompleteSquare( a * x^2 + b * x + c );
</pre>
<p>For a higher-order example:</p>
<pre>
f := 5*x^4 - 70*x^3 + 365*x^2 - 840*x + 721;
g := CompleteSquare( f, x ); # 5 * ( x^2 - 7 * x + 12 )^2 + 1
h := evalindets( f, `*`, factor ); 4 * (x-3)^2 * (x-4)^2 + 1
p1 := plot( f, x=0..5, y=-5..5, color=blue ):
p2 := plots:-pointplot( [ [3,1], [4,1] ], symbol=solidcircle, symbolsize=20, color=red ):
plots:-display( p1, p2 );
</pre>
<p>tells us that the minimum value of the expression is 1, and it occurs at x=3 and x=4.</p>
<p><img src="/view.aspx?sf=210053_post/square.png"></p>
</div>
<p>A common question to our tech support team is about completing the square for a univariate polynomial of even degree, and how to do that in Maple. We’ve put together a solution that we think you’ll find useful. If you have any alternative methods or improvements to our code, let us know!</p>
<div>
<pre>
restart;
# Procedure to complete the square for a univariate
# polynomial of even degree.
CompleteSquare := proc( f :: depends( 'And'( polynom, 'satisfies'( g -> ( type( degree(g,x), even ) ) ) ) ), x :: name )
local a, g, k, n, phi, P, Q, r, S, T, u:
# Degree and parameters of polynomial.
n := degree( f, x ):
P := indets( f, name ) minus { x }:
# General polynomial of square plus constant.
g := add( a[k] * x^k, k=0..n/2 )^2 + r:
# Solve for unknowns in g.
Q := indets( g, name ) minus P:
S := map( expand, { solve( identity( expand( f - g ) = 0, x ), Q ) } ):
if numelems( S ) = 0 then
return NULL:
end if:
# Evaluate g at the solution, and re-write square term
# so that the polynomial within the square is monic.
phi := u -> lcoeff(op(1,u),x)^2 * (expand(op(1,u)/lcoeff(op(1,u),x)))^2:
T := map( evalindets, map( u -> eval(g,u), S ), `^`(anything,identical(2)), phi ):
return `if`( numelems(T) = 1, T[], T ):
end proc:
# Examples.
CompleteSquare( x^2 + 3 * x + 2, x );
CompleteSquare( a * x^2 + b * x + c, x );
CompleteSquare( 4 * x^8 + 8 * x^6 + 4 * x^4 - 246, x );
m, n := 4, 10;
r := rand(-10..10):
for i from 1 to n do
CompleteSquare( r() * ( x^(m/2) + randpoly( x, degree=m-1, coeffs=r ) )^2 + r(), x );
end do;
# Compare quadratic examples with Student:-Precalculus:-CompleteSquare()
# (which is restricted to quadratic expressions).
Student:-Precalculus:-CompleteSquare( x^2 + 3 * x + 2 );
Student:-Precalculus:-CompleteSquare( a * x^2 + b * x + c );
</pre>
<p>For a higher-order example:</p>
<pre>
f := 5*x^4 - 70*x^3 + 365*x^2 - 840*x + 721;
g := CompleteSquare( f, x ); # 5 * ( x^2 - 7 * x + 12 )^2 + 1
h := evalindets( f, `*`, factor ); 4 * (x-3)^2 * (x-4)^2 + 1
p1 := plot( f, x=0..5, y=-5..5, color=blue ):
p2 := plots:-pointplot( [ [3,1], [4,1] ], symbol=solidcircle, symbolsize=20, color=red ):
plots:-display( p1, p2 );
</pre>
<p>tells us that the minimum value of the expression is 1, and it occurs at x=3 and x=4.</p>
<p><img src="/view.aspx?sf=210053_post/square.png"></p>
</div>
210053Thu, 10 Jan 2019 15:33:49 ZTechnicalSupportTechnicalSupport