MaplePrimes Commons General Technical Discussions

The primary forum for technical discussions.

 

Points on the coordinate plane

(Guidance manual for the 6th class)

Changing the initial coordinates and going through the entire program first, we get a new picture-task

 

    Point_on_co-plane.mws

 

And Another     Coordinate_plane.mws

 

 

 

Coordinate axis

6th class (in Russia)

Guidance manual for use at lessons (at school)

Coordinate_line_lesson.mws

(It is possible bad English)

I have recently taken a few comments and questions about moderation, and thought it would be worthwhile to clarify our policies.

Although financed and hosted by Maplesoft, MaplePrimes is a community-run site. Our members provide thoughtful posts, answer thousands of questions each year, and generally keep things running smoothly by removing spam and moderating content. Moderation and management capabilities are granted automatically based on a member's reputation, which is a measure of how their content is valued by other community-members. Once someone's reputation score reaches 500, moderation privileges are granted. There are currently 69 members who have moderation capabilities.

We have had this system running for years, and by and large, it works well. There are occasional problems, of course, and these have been dealt with on an as-needed basis, and will continue to be dealt-with going forward.

What is the intent of moderation?

Quite simply, moderation capabilities are provided to maintain a high-standard of content. We want our moderators to help maintain a well organized and technically-sound site, without altering the intent or context of the original post.

Common examples of acceptable moderation scenarios include:

  • Removing spam or messages that violate our community guidelines
  • Editing the tags, categories or product(s) associated with a question or post
  • Correcting incorrect technical content such as bad URLs included in a post or poor formatting
  • Correcting a typo or improper spelling is appropriate in limited scenarios when the mistake made the original message confusing. In general practice, however, it is best to not edit someone else's grammar or spelling.

 

What is moderation not for?

MaplePrimes members cover a very diverse range of backgrounds, languages, technical skill with Maplesoft products, and familiarity with MaplePrimes. It is therefore normal that posts and questions within MaplePrimes reflect this diversity.

In order to respect the author, as well as to maintain the context of the original question or post, there are some scenarios where moderation should not be employed. For example:

  • Many members are not fluent in English, yet the context of their message/question is very clear. In cases like this, correcting improper spelling or grammar (unless requested) is disrespectful and should be avoided. 
  • Do not edit or remove another person's code, even if it is incorrect or incomplete. Doing so can completely change the context of the message and makes the message very confusing for people who read that thread in the future.
  • Do not edit the context of a message to make it 'read better'. Even if your intentions are good, edits like these are can be seen as disrespectful, and in some cases, even inflammatory.

In general, I recommend following this rule: If you're not 100% certain that your edit will be helpful and appreciated by everyone, do not make it.

 

What can I do if I disagree with a moderator's changes?

MaplePrimes moderators are invaluable for keeping MaplePrimes running smoothly, and as mentioned above, they do a great job. From time to time, however, a change may be made that you disagree with. Often such changes are a result of a misunderstanding on the part of the moderator, or perhaps just an honest mistake.

In situations like these, my recommendation is to contact MaplePrimes administrators by flagging the post as 'other' and providing the details. We will then look into the issue and (hopefully) reach a speedy resolution. During this process, we will contact the poster and/or the moderator to discuss the changes. If needed, further actions can be taken, from further education up to and including suspending or removing moderator privileges. 

 

I hope this has been helpful, and I'm looking forward to your thoughts and suggestions in the comments below.

Bryon

 

Russian children work with Maple - view

http://geodromchik.blogspot.ru

//sites.google.com/site/geodromchic

 

Bug_in_integrate.mw

M_Iwaniuk

The mechanism of transport of the material of the sewing machine M 1022 class: mathematical animation.   BELORUS.mw 




I thought I would share some code for computing sparse matrix products in Maple.  For floating point matrices this is done quickly, but for algebraic datatypes there is a performance problem with the builtin routines, as noted in http://www.mapleprimes.com/questions/205739-How-Do-I-Improve-The-Performance-Of

Download spm.txt

The code is fairly straightforward in that it uses op(1,A) to extract the dimensions and op(2,A) to extract the non-zero elements of a Matrix or Vector, and then loops over those elements.  I included a sparse map function for cases where you want to map a function (like expand) over non-zero elements only.

# sparse matrix vector product
spmv := proc(A::Matrix,V::Vector)
local m,n,Ae,Ve,Vi,R,e;
n, m := op(1,A);
if op(1,V) <> m then error "incompatible dimensions"; end if;
Ae := op(2,A);
Ve := op(2,V);
Vi := map2(op,1,Ve);
R := Vector(n, storage=sparse);
for e in Ae do
n, m := op(1,e);
if member(m, Vi) then R[n] := R[n] + A[n,m]*V[m]; end if;
end do;
return R;
end proc:
# sparse matrix product
spmm := proc(A::Matrix, B::Matrix)
local m,n,Ae,Be,Bi,R,l,e,i;
n, m := op(1,A);
i, l := op(1,B);
if i <> m then error "incompatible dimensions"; end if;
Ae := op(2,A);
Be := op(2,B);
R := Matrix(n,l,storage=sparse);
for i from 1 to l do
Bi, Be := selectremove(type, Be, (anything,i)=anything);
Bi := map2(op,[1,1],Bi);
for e in Ae do
n, m := op(1,e);
if member(m, Bi) then R[n,i] := R[n,i] + A[n,m]*B[m,i]; end if;
end do;
end do;
return R;
end proc:
# sparse map
smap := proc(f, A::{Matrix,Vector})
local B, Ae, e;
if A::Vector then
B := Vector(op(1,A),storage=sparse):
else
B := Matrix(op(1,A),storage=sparse):
end if;
Ae := op(2,A);
for e in Ae do
B[op(1,e)] := f(op(2,e),args[3..nargs]);
end do;
return B;
end proc:


As for how it performs, here is a demo inspired by the original post.

n := 674;
k := 6;
A := Matrix(n,n,storage=sparse):
for i to n do
  for j to k do
    A[i,irem(rand(),n)+1] := randpoly(x):
  end do:
end do:
V := Vector(n):
for i to k do
  V[irem(rand(),n)+1] := randpoly(x):
end do:
C := CodeTools:-Usage( spmv(A,V) ):  # 7ms, 25x faster
CodeTools:-Usage( A.V ):  # 174 ms
B := Matrix(n,n,storage=sparse):
for i to n do
  for j to k do
    B[i,irem(rand(),n)+1] := randpoly(x):
  end do:
end do:
C := CodeTools:-Usage( spmm(A,B) ):  # 2.74 sec, 50x faster
CodeTools:-Usage( A.B ):  # 2.44 min
# expand and collect like terms
C := CodeTools:-Usage( smap(expand, C) ):

The method of solving underdetermined systems of equations, and universal method for calculating link mechanisms. It is based on the Draghilev’s method for solving systems of nonlinear equations. 
When calculating link mechanisms we can use geometrical relationships to produce their mathematical models without specifying the “input link”. The new method allows us to specify the “input link”, any link of mechanism.

Example.
Three-bar mechanism.  The system of equations linkages in this mechanism is as follows:

f1 := x1^2+(x2+1)^2+(x3-.5)^2-R^2;
f2 := x1-.5*x2+.5*x3;
f3 := (x1-x4)^2+(x2-x5)^2+(x3-x6)^2-19;
f4 := sin(x4)-x5;
f5 := sin(2*x4)-x6;

Coordinates green point x'i', i = 1..3, the coordinates of red point x'i', i = 4..6.
Set of x0'i', i = 1..6 searched arbitrarily, is the solution of the system of equations and is the initial point for the solution of the ODE system. The solution of ODE system is the solution of system of equations linkages for concrete assembly linkage.
Two texts of the program for one mechanism. In one case, the “input link” is the red-green, other case the “input link” is the green-blue.
After the calculation trajectories of points, we can always find the values of other variables, for example, the angles.
Animation displays the kinematics of the mechanism.
MECAN_3_GR_P_bar.mw 
MECAN_3_Red_P_bar.mw

(if to use another color instead of color = "Niagara Dark Orchid", the version of Maple <17)

Method_Mechan_PDF.pdf






You, I, and others like us, are the beneficiaries of decades of software evolution.

From its genesis as a research project at the University of Waterloo in the early 80s, Maple has continually evolved to meet the challenges of technical computing.

There has been a spate of Questions posted in the past week about computing eigenvalues. Invariably, the Questioners have computed some eigenvalues by applying fsolve to a characteristic polynomial obtained from a floating-point matrix via LinearAlgebra:-Determinant. They are then surprised when various tests show that these eigenvalues are not correct. In the following worksheet, I show that the eigenvalues computed by the fsolve@Determinant method (when applied to a floating-point matrix) are 100% garbage for dense matrices larger than about Digits x Digits. The reason for this is that computing the determinant introduces too much round-off error into the coefficients of the characteristic polynomial. The best way to compute the eigenvalues is to use LinearAlgebra:-Eigenvalues or LinearAlgebra:-Eigenvectors. Furthermore, very accurate results can be obtained without increasing Digits.

 

The correct and incorrect ways to compute floating-point eigenvalues

Carl Love 2016-Jan-18

restart:

Digits:= 15:

macro(LA= LinearAlgebra):

n:= 2^5:  #Try also 2^3 and 2^4.

A:= LA:-RandomMatrix(n):

A is an exact matrix of integers; Af is its floating-point counterpart.

Af:= Matrix(A, datatype= float[8]):

P:= LA:-CharacteristicPolynomial(A, x):

P is the exact characteristic polynomial with integer coefficients; Pf is the floating-point characteristic polynomial computed by the determinant method.

Pf:= LA:-Determinant(Af - LA:-DiagonalMatrix([x$n])):

RP:= [fsolve(P, complex)]:

RP is the list of floating-point eigenvalues computed from the exact polynomial; RPf is the list of eigenvalues computed from Pf.

RPf:= [fsolve(Pf, complex)]:

RootPlot:= (R::list(complexcons))->
     plot(
          [Re,Im]~(R), style= point, symbol= cross, symbolsize= 24,
          axes= box, color= red, labels= [Re,Im], args[2..]
     )
:

RootPlot(RP);

RootPlot(RPf);

We see that the eigenvalues computed from the determinant are completely garbage. The characteristic polynomial might as well have been x^n - a^n for some positive real number a > 1.

 

Ef is the eigenvalues computed from the floating-point matrix Af using the Eigenvalues command.

Ef:= convert(LA:-Eigenvalues(Af), list):

RootPlot(Ef, color= blue);

We see that this eigenvalue plot is visually indistinguishable from that produced from the exact polynomial. This is even more obvious if I plot them together:

plots:-display([RootPlot(Ef, color= blue), RootPlot(RP)]);

Indeed, we can compare the two lists of  eigenvalues and show that the maximum difference is exceedingly small.

 

The following procedure is a novel way of sorting a list of complex numbers so that it can be compared to another list of almost-equal complex numbers.

RootSort:= (R::list(complexcons))-> sort(R, key= abs*map2(`@`, signum+2, Re+Im)):


max(abs~(RootSort(RP) -~ RootSort(Ef)));

HFloat(1.3258049636636544e-12)

 

 

``

 

Download Eigenvalues.mw

The Joint Mathematics Meetings are taking place this week (January 6 – 9) in Seattle, Washington, U.S.A. This will be the 99th annual winter meeting of the Mathematical Association of America (MAA) and the 122nd annual meeting of the American Mathematical Society (AMS).

Maplesoft will be exhibiting at booth #203 as well as in the networking area. Please stop by our booth or the networking area to chat with me and other members of the Maplesoft team, as well as to pick up some free Maplesoft swag or win some prizes.

Given the size of the Joint Math Meetings, it can be challenging to pick which events to attend. Hopefully we can help by suggesting a few Maple-related talks and events:

Maplesoft is hosting a catered reception and presentation ‘Challenges of Modern Education: Bringing Math Instruction Online’ on Thursday, January 7th at 18:00 in the Cedar Room at the Seattle Sheraton. You can find more details and registration information here: www.maplesoft.com/jmm

Another not to miss Maple event is “30 Years of Digitizing Mathematical Knowledge with Maple”, presented by Edgardo Cheb-Terrab, on Thursday, January 7 at 10:00 in Room 603 of the Convention Center.


Here’s a list of Maple-related events and talks:


Exploration of Mathematics Teaching and Assessment through Maple-Software Projects of Art Diagram Design as Undergraduate Student Research Projects

Wednesday, Jan 6, 10:20, Room 2B, Convention Center

Lina Wu

 

30 Years of Digitizing Mathematical Knowledge with Maple

Thursday, Jan 7, 10:00, Room 603, Convention Center

Edgardo Cheb-Terrab

 

MAA Poster Session – Collaborative Research: Maplets for Calculus

Thursday, Jan 7, 14:00, Hall 4F, 4th Floor, Convention Center

 

Challenges of Modern Education: Bringing Math Instruction Online

Thursday, Jan 7, 18:00, Cedar Room, 2nd Floor, Sheraton Center

 

Using Maple to Promote Modelling in Differential Equations

Friday, Jan 8, 10:40, Room 617, Convention Center

Patrice G Tiffany; Rosemary C Farley

 

If you are presenting at Joint Math and would like to advertise your Maple-related talk, please feel free to comment below, or send me a message with your event and I’ll add it to the list above.

 

See you in Seattle!

Daniel

Maple Product Manager

As the year draws to a close, we start looking forward to a new year and a new release of Maple. With every new release comes many new features and updates to explore.

We are looking for several new beta testers with a good working knowledge of Maple; We need your input, your ideas, and your experience with our products to help us improve the software and get it ready for general release.

There are many benefits to becoming a beta tester:

  • You’ll get to use the new software before anyone else does.
  • You’ll help us make our software better in ways that work for you.
  • Your suggestions could determine the future direction of the software.
  • You’ll get feedback right from the development team.

If you are interested in becoming a beta tester for the next version of Maple, please email: beta (at) maplesoft.com for more information.

As the year draws to a close, we start looking forward to a new year and a new release of Maple. With every new release comes many new features and updates to explore.

We are looking for several new beta testers with a good working knowledge of Maple; We need your input, your ideas, and your experience with our products to help us improve the software and get it ready for general release.

There are many benefits to becoming a beta tester:

  • You’ll get to use the new software before anyone else does.
  • You’ll help us make our software better in ways that work for you.
  • Your suggestions could determine the future direction of the software.
  • You’ll get feedback right from the development team.

If you are interested in becoming a beta tester for the next version of Maple, please email: beta (at) maplesoft.com for more information.

This is a post that I wrote for the Altair Innovation Intelligence blog.

I have a grudging respect for Victorian engineers. Isambard Kingdom Brunel, for example, designed bridges, steam ships and railway stations with nothing but intellectual flair, hand-calculations and painstakingly crafted schematics. His notebooks are digitally preserved, and make for fascinating reading for anyone with an interest in the history of engineering.

His notebooks have several characteristics.

  • Equations are written in natural math notation
  • Text and diagrams are freely mixed with calculations
  • Calculation flow is clear and well-structured

Hand calculations mix equations, text and diagrams.

 

Engineers still use paper for quick calculations and analyses, but how would Brunel have calculated the shape of the Clifton Suspension Bridge or the dimensions of its chain links if he worked today?

If computational support is needed, engineers often choose spreadsheets. They’re ubiquitous, and the barrier to entry is low. It’s just too easy to fire-up a spreadsheet and do a few simple design calculations.

 Spreadsheets are difficult to debug, validate and extend.

 

Spreadsheets are great at manipulating tabular data. I use them for tracking expenses and budgeting.

However, the very design of spreadsheets encourages the propagation of errors in equation-oriented engineering calculations

  • Results are difficult to validate because equations are hidden and written in programming notation
  • You’re often jumping about from one cell to another in a different part of the worksheet, with no clear visual roadmap to signpost the flow of a calculation

For these limitations alone, I doubt if Brunel would have used a spreadsheet.

Technology has now evolved to the point where an engineer can reproduce the design metaphor of Brunel’s paper notebooks in software – a freeform mix of calculations, text, drawings and equations in an electronic notebook. A number of these tools are available (including Maple, available via the APA website).

 Modern calculation tools reproduce the design metaphor of hand calculations.

 

Additionally, these modern software tools can do math that is improbably difficult to do by hand (for example, FFTs, matrix computation and optimization) and connect to CAD packages.

For example, Brunel could have designed the chain links on the Clifton Suspension Bridge, and updated the dimensions of a CAD diagram, while still maintaining the readability of hand calculations, all from the same electronic notebook.

That seems like a smarter choice.

Would I go back to the physical notebooks that Brunel diligently filled with hand calculations? Given the scrawl that I call my handwriting, probably not.

Has anyone tried to run the following in Maple command-line mode (i.e. in terminal window, type "maple" to start it without the graphic interface),

"

expr1:=t1+t2+t3+t4+t5+t6+t7+t8+t9+t10+t11+t12+t13+t14+t15+t16+t17+t18+t19+t20+t21+t22+t0-t0+t23;
expr2:=t1+t2+t3+t4+t5+t6+t7+t8+t9+t10+t11+t12+t13+t14+t15+t16+t17+t18+t19+t20+t21+t22+t0-t0+t23;
print(expr1-expr2);

"

Surprisingly, I didn't get "0" with my Maple 17 (under Linux platform) or 18 (under Mac OSX platform). Can anyone help me confirm this?

2 3 4 5 6 7 8 Last Page 4 of 75