## My Maple Summer of Code

by: Maple 2016

Walking into the big blue Maplesoft office on August 3rd was a bit nerve wracking. I had no idea who anyone was, what to expect, or even what I would be doing. As I sat in the front hall waiting for someone to receive me, I remember thinking, “What have I gotten myself into?”. Despite my worries on that first day, interning at Maplesoft has been a great experience! I never knew that I would be able to learn so much about programming and working in a company in such a short amount of time. Although Maple was a programming language that was foreign to me a couple weeks ago, I feel like I’m relatively well versed in it now. Trying to learn a new language in this short timespan hasn’t been easy, but I think that I picked it up quickly, even if I’ve had my fair share of frustrations.

Chaos Game example on Rosetta Code

At Maplesoft, I’ve been contributing to the Rosetta Code project by writing short programs using Maple. The Rosetta Code project is dedicated to creating programming examples for many different tasks in different programming languages. My summer project has been to create solutions using Maple for as many tasks as possible and to post these to Rosetta Code; the goal being to have the list of tasks without Maple implementation shrink with each passing day. It’s nice to feel like I’m leaving a mark in this world, even if it is in such a small corner of the internet.

Flipping Bits example on Rosetta Code/MapleCloud

The following is the code for the Fibonacci n-step number sequences task

`numSequence := proc(initValues :: Array)`
`	local n, i, values;	n := numelems(initValues);	values := copy(initValues);	for i from (n+1) to 15 do		values(i) := add(values[i-n..i-1]);	end do;	return values;end proc: initValues := Array([1]):for i from 2 to 10 do	initValues(i) := add(initValues):	printf ("nacci(%d): %a\n", i, convert(numSequence(initValues), list));end do:printf ("lucas: %a\n", convert(numSequence(Array([2, 1])), list));`

Maple was a great software to program with and a fairly straightforward language to learn. Having previously programmed in Java, I found Maple similar enough that transitioning wasn’t too difficult. In fact, every once in a while when I didn`t know what to do for a task, I would take a look at the Java example in Rosetta Code and it would point me in a direction or give me some hints. While the two languages are similar, there are still many differences. For example, I liked the fact that in Maple, lists started at an index of 1 rather than 0 and arrays could an arbitrary starting index. Although it was different from what I was used to, I found that it made many things much less confusing. Another thing I liked was that the for loop syntax was very simple. I never once had to run through in my head how many times something would loop for. There were such a wide variety of commands in Maple. There was a command for practically anything, and if you knew that it existed and how to use it, then so much power could be at your fingertips. This is where the help system came in extremely handy. With a single search you might find that the solution to the exact problem you were trying to solve already existed as a Maple command. I always had a help window open when I was using Maple.

Multiplication Tables example on Rosetta Code

Spending my summer coding at Maplesoft has been fun, sometimes challenging, but an overall rewarding experience. Through contributing to the Rosetta Code project, I’ve learned so much about computer programming, and it certainly made the 45 minute drive out to Waterloo worth it!

Yili Xu,

## Quantum Mechanics: Schrödinger vs Heisenberg pictu...

by: Maple

The presentation below is on undergrad Quantum Mechanics. Tackling this topic within a computer algebra worksheet in the way it's done below, however, is an exciting novelty and illustrates well the level of abstraction that is now possible using the Physics package.

Quantum Mechanics: Schrödinger vs Heisenberg picture

Pascal Szriftgiser1 and Edgardo S. Cheb-Terrab2

(1) Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France

(2) Maplesoft

Within the Schrödinger picture of Quantum Mechanics, the time evolution of the state of a system, represented by a Ket , is determined by Schrödinger's equation:

where H, the Hamiltonian, as well as the quantum operators  representing observable quantities, are all time-independent.

Within the Heisenberg picture, a Ket  representing the state of the system does not evolve with time, but the operators representing observable quantities, and through them the Hamiltonian H, do.

Problem: Departing from Schrödinger's equation,

 a) Show that the expected value of a physical observable in Schrödinger's and Heisenberg's representations is the same, i.e. that

 b) Show that the evolution equation of an observable  in Heisenberg's picture, equivalent to Schrödinger's equation,  is given by:

where in the right-hand-side we see the commutator of  with the Hamiltonian of the system.

Solution: Let  and  respectively be operators representing one and the same observable quantity in Schrödinger's and Heisenberg's pictures, and H be the operator representing the Hamiltonian of a physical system. All of these operators are Hermitian. So we start by setting up the framework for this problem accordingly, including that the time t and Planck's constant are real. To automatically combine powers of the same base (happening frequently in what follows) we also set combinepowersofsamebase = true. The following input/output was obtained using the latest Physics update (Aug/31/2016) distributed on the Maplesoft R&D Physics webpage.

 >
 >
 (1)

Let's consider Schrödinger's equation

 >
 (2)

Now, H is time-independent, so (2) can be formally solved:  is obtained from the solution  at time , as follows:

 >
 (3)
 >
 (4)

To check that (4) is a solution of (2), substitute it in (2):

 >
 (5)

Next, to relate the Schrödinger and Heisenberg representations of an Hermitian operator O representing an observable physical quantity, recall that the value expected for this quantity at time t during a measurement is given by the mean value of the corresponding operator (i.e., bracketing it with the state of the system ).

So let  be an observable in the Schrödinger picture: its mean value is obtained by bracketing the operator with equation (4):

 >
 (6)

The composed operator within the bracket on the right-hand-side is the operator O in Heisenberg's picture,

 >
 (7)

Analogously, inverting this equation,

 >
 (8)

As an aside to the problem, we note from these two equations, and since the operator  is unitary (because H is Hermitian), that the switch between Schrödinger's and Heisenberg's pictures is accomplished through a unitary transformation.

Inserting now this value of  from (8) in the right-hand-side of (6), we get the answer to item a)

 >
 (9)

where, on the left-hand-side, the Ket representing the state of the system is evolving with time (Schrödinger's picture), while on the the right-hand-side the Ket is constant and it is , the operator representing an observable physical quantity, that evolves with time (Heisenberg picture). As expected, both pictures result in the same expected value for the physical quantity represented by .

To complete item b), the derivation of the evolution equation for , we take the time derivative of the equation (7):

 >
 (10)

To rewrite this equation in terms of the commutator  , it suffices to re-order the product  H   placing the exponential first:

 >
 (11)
 >
 (12)

Finally, to express the right-hand-side in terms of   instead of , we take the commutator of the equation (8) with the Hamiltonian

 >
 (13)

Combining these two expressions, we arrive at the expected result for b), the evolution equation of a given observable  in Heisenberg's picture

 >
 (14)

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft
Editor, Computer Physics Communications

## Maple T.A. course materials – Engineering Mechanics...

by:

Hanze University of Applied Sciences Groningen has created 105 questions related to engineering mechanics for structures (statics/construction). These 105 randomised questions with graphics are used for first year students in civil engineering, structural engineering, architectural engineering and building engineering.

The topics of the course modules are as follows:
- Force Vectors (10)
- Support Reactions (26)
- Internal Forces (31)
- Stress (21)
- Trusses (17)

All questions have a translation button which makes it easy to switch from English to any other language. The questions are first shown in Dutch [NL] but by clicking [UK] in the Preview, the English version is shown. The text can easily be edited and changed into the language of choice in the Maple T.A. question editor. Only the button needs adjustment in the question source.

60 questions are “exercises“ which means that these questions have extended feedback. The remaining questions (45) are “tests” meaning that the questions include no feedback.

Cone.zip - construction exercises (60 questions)

Cont.zip - construction tests (45 questions)

Jonny
Maplesoft Product Manager, Online Education Products

## System-level physical modeling and simulation:...

Bruce Jenkins is President of Ora Research, an engineering research and advisory service. Maplesoft commissioned him to examine how systems-driven engineering practices are being integrated into the early stages of product development, the results of which are available in a free whitepaper entitled System-Level Physical Modeling and Simulation. In this series of blog posts, Mr. Jenkins discusses the results of his research.

This is the second entry in the series.

My last post, Strategies for accelerating the move to simulation-led, systems-driven engineering, described my firm’s research project to investigate the contemporary state of adoption and application of systems modeling software technologies, and their attendant methods and work processes, in the engineering design of off-highway equipment and mining machinery.

In this project, I conducted in-depth, structured but open-ended interviews with some half-dozen expert practitioners at leading manufacturers, including both engineering management and senior discipline leads. These interviews identified the following key technological factors as well as business and competitive issues driving adoption and use of systems modeling tools and methods at current levels:

• Fuel economy and emissions mandates, powertrain electrification and autonomous operation requirements
• Software’s ability to drive down product cost of ownership and delivery times
• Traditional development processes often fail to surface system-level issues until fabrication or assembly, or even until operational deployment
• Detailed analysis tools such as FEA and CFD focus on behaviors at the component level, and are not optimal for studies of the complete system
• Engineering departments/groups enjoy greater freedom in systems modeling software selection and purchase decisions than in enterprise-controlled CAD/PDM/PLM decisions
• Good C/VP-level visibility of systems modeling tools, especially in off-highway equipment

At the same time, there was widespread agreement among all the experts interviewed that these tools and methods are not being brought to bear with anywhere near the breadth or depth that practitioner advocates would like, and that they believe would be greatly beneficial to their organizations and industries.

In probing why this is, the interviews revealed an array of factors constraining broader adoption at present. These range from legacy engineering culture issues, through human resource limitations and constraints imposed by business models and corporate cultures, to entrenched shortcomings in how long-established systems modeling software toolsets have been deployed and applied to the product development process:

• Legacy engineering culture constraints
• Conservatism of mining machinery product development culture
• Engineering practices in long-standardized industries grounded in handbook formulas and rules of thumb
• Perceived lack of time in schedule to do systems modeling
• Human resource constraints
• Low availability of engineers with systems modeling skills
• Shortage of engineers trained in systems thinking
• Legacy engineering processes compound shortage of systems-thinking engineers
• Industry downturns put constraints on professional staff development
• Culture of seeking to mitigate cost and risk by staying with legacy designs instead of advancing and innovating the product
• Corporate awareness of need to innovate in mining machinery gets stifled at engineering level
• Low C/VP-level visibility of systems modeling tools in mining machinery
• Engineering organization constraints on innovating/modernizing their systems modeling technology infrastructure
• Power users wedded to legacy systems modeling tools
• Weak integration at many/most points of the engineering digital toolset chain
• Implementing systems modeling software as a sales configuration/costing aid seen as taking too much time

My next post will detail practitioners’ visions, strategies and best practices for accelerating and institutionalizing the implementation and usage of systems modeling tools and practices in their organizations.

Bruce Jenkins, Ora Research
oraresearch.com

## Cannot submit SCRs

Maple , MaplePrimes

In order to change Maple for the better, I use to submit SCRs. However, as i was kindly
informed by Bryon (a copy of his e-letter on demand), MaplePrimes are under reconstruction and do not
work properly. At least my three messages sent through the Contact button were lost.
I have  unsuccessfully tried to reach beta.maplesoft.com (see the result of ping in the screen screen.29.08.16.docx).

## Defining a quantum operator as a tensor – And...

by: Maple 2016

Hi,

In the following example I introduce some commutation rules that are standard in Quantum Mechanics. A major feature of the Maple Physics Package, is that it is possible to define tensors as Quantum Operators. This is of great interest because powerful tensor simplification rules can then be used in Quantum Mechanics. For an example, see the commutation rules of the components of the angular momentum operator in ?Physics,Examples. Here, I focus on a possible issue: when destroying all quantum operators, the pre-defined commutation rules still apply, which should not be the case. As shown in the post, this is link to the fact that these operators are also tensors.

 >
 (1)

 >

First, set a 3D Euclidian space

 >
 (2)

Define two rank 1 tensors

 >
 (3)

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics).

 >
 (4)

As expected:

 >
 (5)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed. This is useful if, for instance, one needs to compare some the result with the commutative case.

 >
 (6)

As expected, there are no quantum operators anymore...

 >
 (7)

...so that the following expressions should commute (result should be true)

 >
 (8)

Result should be 0

 >
 (9)
 >
 (10)
 >

Below is just a copy & paste of the above section. The only difference, is that "" has been commented, so that and  are not a tensor. In that case, everything behaves as expected (but of course, the interesting feature of tensors is not available).

 >

First, set a 3D Euclidian space

 >
 (11)

#Define two rank 1 tensors

 >

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics)

 >
 (12)

As expected:

 >
 (13)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed.

 >
 (14)

As expected, there are no quantum operators anymore...

 >
 (15)

...so that the following expressions should commute (result should be true)

 >
 (16)

Result should be 0

 >
 (17)
 >
 (18)
 >

## Strategies for accelerating the move to simulation...

Bruce Jenkins is President of Ora Research, an engineering research and advisory service. Maplesoft commissioned him to examine how systems-driven engineering practices are being integrated into the early stages of product development, the results of which are available in a free whitepaper entitled System-Level Physical Modeling and Simulation. In the coming weeks, Mr. Jenkins will discuss the results of his research in a series of blog posts.

This is the first entry in the series.

Discussions of how to bring simulation to bear starting in the early stages of product development have become commonplace today. Driving these discussions, I believe, is growing recognition that engineering design in general, and conceptual and preliminary engineering in particular, face unprecedented pressures to move beyond the intuition-based, guess-and-correct methods that have long dominated product development practices in discrete manufacturing. To continue meeting their enterprises’ strategic business imperatives, engineering organizations must move more deeply into applying all the capabilities for systematic, rational, rapid design development, exploration and optimization available from today’s simulation software technologies.

Unfortunately, discussions of how to simulate early still fixate all too often on 3D CAE methods such as finite element analysis and computational fluid dynamics. This reveals a widespread dearth of awareness and understanding—compounded by some fear, intimidation and avoidance—of system-level physical modeling and simulation software. This technology empowers engineers and engineering teams to begin studying, exploring and optimizing designs in the beginning stages of projects—when product geometry is seldom available for 3D CAE, but when informed engineering decision-making can have its strongest impact and leverage on product development outcomes. Then, properly applied, systems modeling tools can help engineering teams maintain visibility and control at the subsystems, systems and whole-product levels as the design evolves through development, integration, optimization and validation.

As part of my ongoing research and reporting intended to help remedy the low awareness and substantial under-utilization of system-level physical modeling software in too many manufacturing industries today, earlier this year I produced a white paper, “System-Level Physical Modeling and Simulation: Strategies for Accelerating the Move to Simulation-Led, Systems-Driven Engineering in Off-Highway Equipment and Mining Machinery.” The project that resulted in this white paper originated during a technology briefing I received in late 2015 from Maplesoft. The company had noticed my commentary in industry and trade publications expressing the views set out above, and approached me to explore what they saw as shared perspectives.

From these discussions, I proposed that Maplesoft commission me to further investigate these issues through primary research among expert practitioners and engineering management, with emphasis on the off-highway equipment and mining machinery industries. In this research, focused not on software-brand-specific factors but instead on industry-wide issues, I interviewed users of a broad range of systems modeling software products including Dassault Systèmes’ Dymola, Maplesoft’s MapleSim, The MathWorks’ Simulink, Siemens PLM’s LMS Imagine.Lab Amesim, and the Modelica tools and libraries from various providers. Interviewees were drawn from manufacturers of off-highway equipment and mining machinery as well as some makers of materials handling machinery.

At the outset, I worked with Maplesoft to define the project methodology. My firm, Ora Research, then executed the interviews, analyzed the findings and developed the white paper independently of input from Maplesoft. That said, I believe the findings of this project strongly support and validate Maplesoft’s vision and strategy for what it calls model-driven innovation. You can download the white paper here.

Bruce Jenkins, Ora Research
oraresearch.com

## why did that russian guy refuse a million dollars...

by:

just reading this story... a large quantity of information does not add up for me, like he denies it is his work and was done by hamilton? also its blasted across the net that he his proof is valid, so he cant say he doesnt want fame because its been all over the internet, and the sheer lack of logic of refusing money based on a moral code of conduct? then give it to charity, pay for a dozen scholarships but what the money is dirty?

pretty sure this whole thing is a pile of crap made up by someone.

by: Maple

 >
 (1)
 >
 (2)
 >

## CONGRUENT FUNCTIONS OF THE FRACTIONAL PART OVER...

by: Maple

A more honest and specific version of lemma 3.

CONGRUENT_FUNCTIONS_OF_THE_FRACTIONAL_PART_OVER_Q_LEMMA_4.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/CONGRUENT_FUNCTIONS_OF_THE_FRACTIONAL_PART_OVER_Q_LEMMA_4.mw .

by: Maple 2016

Using a mouse's back/forward buttons or alt+ left arrow/ alt+right arrow did not work in Maple 2015 and they still don't work in Maple 2016.

Also, if you select anywhere in the search bar, it automatically selects all the words.  I sometimes (most the time) want to change only one word.

Im using x64 Windows 10 and it also did it when running Windows 8/8.1 .   Does anybody else have this problem?

Can it be fixed please if not?

## Make Maple touch friendly!

by: Maple 2016 , MapleSim 2016

If you try and scroll a page up or down, it just selects the content.  How hard would it be to fix this?

## Householder Reflections

by: Maple

In a recent blog post, I found a single rotation that was equivalent to a sequence of Givens rotations, the underlying message being that teaching, learning, and doing mathematics is more effective and efficient when implemented with a tool like Maple. This post has the same message, but the medium is now the Householder reflection.

Given the vector x = , the Householder matrix H = I - 2 uuT reflects x to y = Hx, where I is the appropriate identity matrix, u = (x - y) / ||x - y|| is a unit normal for the plane (or hyperplane) across which x is reflected, and y necessarily has the same norm as x. The matrix H is orthogonal but its determinant is -1, making it a reflection instead of a rotation.

Starting with x and uH can be constructed and the reflection y calculated. Starting with x and yu and H can be determined. But what does any of this look like? Besides, when the Householder matrix is introduced as a tool for upper triangularizing a matrix, or for putting it into upper Hessenberg form, a recipe such as the one stated in Table 1 is the starting point.

In other words, the recipe in Table 1 reflects x to a vector y in which all entries below the kth are zero. Again, can any of this be visualized and rendered more concrete? (The chair who hired me into my first job averred that there are students who can learn from the general to the particular. Maybe some of my classmates in graduate school could, but in 40 years of teaching, I've never met one such student. Could that be because all things are known through the eyes of the beholder?)

In the attached worksheet, Householder matrices that reflect x = <5, -2, 1> to vectors y along the coordinate axes are constructed. These vectors and the reflecting planes are drawn, along with the appropriate normals u. In addition, the recipe in Table 1 is implemented, and the recipe itself examined. If you look at the worksheet, I believe you will agree that without Maple, the explorations shown would have been exceedingly difficult to carry out by hand.

Attached: RHR.mw

## Application of first order equations

Maple 2016

It is very important that you learn to pose and solve equations in practical problems. Ernest Mach, a famous scientist of the nineteenth century, said that algebra is characterized by a lightening of mind, because the solution of a problem, after building the equation, you can "forget" all the practical situation to focus on the mathematical expression; everything that is not necessary to solve the problem no longer interfere with your mind. Another famous scientist, Isaac Newton, wrote that the language of algebra is the equation. To see a problem concerning abstract relations of numbers or amounts, simply translate the problem of colloquial language to the algebraic language. Here I leave the application for first order equations developed in 2016 Maple.

(In Spanish)

Lenin Araujo Castillo

## Prime number subset code using set and list conversion...

by: Maple

hello i was just looking back on some stuff i did a few months back and although im aware there is a function for generating the prime subset up to a given number already featured in a package in mape im just curious to know how this one measures up in terms of computational efficiency etc.

anyway, this is code, if anyone has the time to give it a try and let me know what they think ie faster more logical way about it any feed back is appreciated cheers.

restart;
interface(showassumed = 0, rtablesize = infinity);
with(plots); with(numtheory); with(Statistics); with(LinearAlgebra); with(RandomTools); with(codegen, makeproc); with(combinat); with(Maplets[Elements]);
unprotect(real, rational, integer, complex);
alias(P[In] = CurveFitting[PolynomialInterpolation]); alias(L[In] = CurveFitting[LeastSquares]); alias(R[In] = CurveFitting[RationalInterpolation]); alias(S[In] = CurveFitting[Spline]); alias(B[In] = CurveFitting[BSplineCurve]); alias(L[In] = CurveFitting[ThieleInterpolation], rho = frac); alias(`&Nscr;` = Count); alias(`&Dopf;` = numtheory:-divisors); alias(sigma = numtheory:-sigma); alias(`&Fscr;` = ListTools['Flatten']); alias(`&Sopf;` = seq);
delta := proc (x, y) options operator, arrow; piecewise(x = y, 1, x <> y, 0) end proc;
`&Mopf;` := proc (X, Y) options operator, arrow; map(X, Y) end proc;
`&Cscr;`[S, L] := proc (X) options operator, arrow; convert(X, 'list') end proc;
`&Cscr;`[L, S] := proc (X) options operator, arrow; convert(X, 'set') end proc;
`&Popf;` := proc (N) options operator, arrow; `minus`({`&Sopf;`(k*delta(`&Nscr;`(`&Fscr;`(`&Cscr;`[S, L](`&Mopf;`(`&Cscr;`[S, L], `&Mopf;`(`&Dopf;`, `&Dopf;`(k)))))), 3), k = 1 .. N)}, {0}) end proc;
N -> `minus`({(k delta(&Nscr;(&Fscr;(&Cscr;[S, L]((&Cscr;[S, L])

&Mopf; (&Dopf; &Mopf; (&Dopf;(k)))))), 3)) &Sopf; (k = 1 .. N)},

{0})
n[P] := proc (N) options operator, arrow; `&Nscr;`(`&Cscr;`[S, L](`&Popf;`(N)))-1 end proc;

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/prime_subset_up_to_N.mw .