MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Probability distributions can be used to predict many things in life: how likely you are to wait more than 15 minutes at a bus stop, the probability that a certain number of credit card transactions are fraudulent, how likely it is for your favorite sports team to win at least three games in a row, and many more. 

    Different situations call for different probability distributions. For instance, probability distributions can be divided into two main categories – those defined by discrete random variables and those defined by continuous random variables. Discrete probability distributions describe random variables that can only take on countable numbers of values, while continuous probability distributions are for random variables that take values from continuums, such as the real number line.

    Maple Learn’s Probability Distributions section provides introductions, examples, and simulations for a variety of discrete and continuous probability distributions and how they can be used in real life. 

    One of the distributions highlighted in Maple Learn’s Example Gallery is the binomial distribution. The binomial distribution is a discrete probability distribution that models the number of n Bernoulli trials that will end in a success.

    This distribution is used in many real-life scenarios, including the fraudulent credit card transactions scenario mentioned earlier. All the information needed to apply this distribution is the number of trials, n, and the probability of success, p. A common usage of the binomial distribution is to find the probability that, for a recently produced batch of products, the number that are defective crosses a certain threshold; if the probability of having too many defective products is high enough, a company may decide to test each product individually rather than spot-checking, or they may decide to toss the entire batch altogether.

    An interesting feature of the binomial distribution is that it can be approximated using a different type of distribution. If the number of trials, n, is large enough and the probability of success, p, is small enough, a Poisson Approximation to the Binomial Distribution can be applied to avoid potentially complex calculations. 

    To see some binomial distribution calculations in action and how accurate the probabilities supplied by the distribution are, try out the Binomial Distribution Simulation document and see how the Law of Large Numbers relates to your results. 

    You can also try your hand at some Binomial Distribution Example Problems to see some realistic examples and calculations.

    Visit the Binomial Distribution: Overview document for a more in-depth explanation of the distribution. The aforementioned Probability Distributions section also contains overviews for the geometric distribution, Poisson distribution, exponential distribution, and several others you may find interesting!

    This post discusses a solution for modeling a traveling load on Maplesim's Flexible Beam component and provides an example of a bouncing load.

    The idea for the above example came from an attempt to reproduce a model of a mass sliding on a beam from MapleSim's model gallery. However, reproducing it using contact components in combination with the Flexible Beam component turned out to be not straightforward, and this will be discussed in the following.

    To simulate a traveling load on the Flexible Beam component, one could apply forces at discrete locations for a certain duration. However, the fidelity of this approach is limited by the number of discrete locations, which must be defined using the Flexible Beam Frame component, as well as the way in which the forces are activated.

    One potential solution to address the issue of temporal activation of forces is to attach contact elements (such as Rectangle components) at distinct locations along the beam, which are defined by Flexible Beam Frame components, and make contact using a spherical or toroidal contact element. However, this approach also introduces two new problems:

    • An additional bending moment is generated when the load is not applied at the center of the contact element's attachment point, the Flexible Beam Frame component. Depending on the length of the contact element, deformations caused by this moment can be greater than the deformation caused by the force itself when the force is applied at the ends of the contact element. Overall, this unwanted moment makes the simulation unrealistic and must be avoided.
    • When the beam bends, a gap (see below) or an overlap is created between adjacent Rectangle components. If there is a gap, the object exerting a force on the beam can fall through it. Overlaps can create differences in dynamic behavior when the radius of curvature of the beam is on the opposite side of the point of contact.

    To avoid these problems, the solution presented here uses an intermediate kinematic chain (encircled in yellow below) that redistributes the contact force on the Rectangle component on two support points (ports to attach Flexible Beam Frame components) in a linear fashion.

     

     

    To address gaps, the contact element (Rectangle) attached to the kinematic chain has the same width as the chain and connects to the adjacent contact elements via multibody frames. In the image below, 10 contact elements are laid on top of a single Flexible Beam component, like a belt made out of tiles. The belt has to be pinned to the flexible beam at one location (highlighted in yellow). The location of this fixed point determines how the flexible beam is loaded by tangential contact forces (friction forces) and should be selected carefully.

     

     

    Some observations on the attached model:

    • Low damping and high initial potential energy of the ball can result in a failed simulation (due to constraint projection failure). Increasing the number of elastic coordinates has a similar effect. Constraint projection can be turned off in the simulation settings to continue simulation.
    • The bouncing ball excites several eigenmodes at once, causing the beam to wiggle chaotically in combination with the varying bouncing frequency of the ball. A similar looking effect can also be achieved with special initial conditions, as demonstrated with Maple in this excellent post on Euler beams and partial differential equations.
    • Repeated simulations with low damping lead to different results (an indication of chaotic behavior; see three successive simulations below (gold) compared to a saved solution(red)). The moment in the animation when the ball travels backward represents a metastable equilibrium point of the simulation. This makes predictions beyond this point difficult, as the behavior of the system is highly dependent on the model parameters. Whether the reversal is a simulation artifact or can happen in reality remains to be seen. Overall, this example could evolve into a nice experimental fun project for students.

    • Setting the gravitational constant for Mars, everything is different. I could not reproduce the fun factor on Earth. A reason more to stay ,-)

    Ball_bouncing_on_a_flexible_beam.msim

     

     

    2-dimensional motion and displacement are some of the first topics that high school students learn in their physics class. In my physics classes, I loved solving 2-dimensional displacement problems because they require the use of so many different math concepts: trigonometry, coordinate conversions, and vector operations are all necessary to solve these problems. Though displacement problems can seem complicated, they are easy to visualize.
    For example, below is a visualization of the displacement of someone who walked 10m in the direction 30o North of East, then walked 15m in the direction 45o South of East:

    From just looking at the diagram, most people could identify that the final position is some angle Southeast of the initial position and perhaps estimate the distance between these two positions. However, finding an exact solution requires various computations, which are all outlined in the Directional Displacement Example Problem document on Maple Learn.

    Solving a problem like this is a great way to practice solving triangles, adding vectors, computing vector norms, and converting points to and from polar form. If you want to practice these math skills, try out Maple Learn’s Directional Displacement Quiz; this document randomly generates displacement questions for you to solve. Have fun practicing!

     

    Just installing Maple 2023 on my office machine (a mac); installed it on my travel computer (a Surface Pro running Windows) yesterday.

    Configured Jupyter notebooks to use the 2023 Maple Kernel and it all went smoothly.  I was *delighted* to notice that plotting Lambert W in Jupyter with the command

    plot( [W(x), W(-1,x)], x=-1..4, view=[-1..4, -3.5..1.5], colour=[red,blue], scaling=constrained, labels=[x,W(x)] );

    produced a *better* plot near the branch point.  This is hard to do automatically!  It turns out this is a side effect of the better/faster/more memory efficient adaptive plotting software, which I gather from "What's New" was written for efficiency not for quality.  But the quality is better, too!  Nice!

    I am working my. way through the "What's New" and I'm really pleased to learn about the new univariate polynomial rootfinder, *not least because it cites the paper describing the algorithm*.  Lots of other goodies too; the new methods of integration look like serious improvements.  Well done. (One thing there: "parallel Risch" is a term of art, and may lead people to believe that Maple is doing something with parallel computing there.  I don't think so.  Could a reference be supplied?)

    The new colour schemes and plotting features in 3d and contour plotting look fabulous.

    Direct Python language support from a code edit region is not at all what I expected to see---I wonder if it will work in a Jupyter notebook?  I'm going to have to try it...

    I'm quite impressed.  The folks at Maplesoft have been working very hard indeed.  Congratulations on a fine release!

     

    In March of 2023, two high school students, Calcea Johnson, and Ne’Kiya Jackson, presented a new proof of the Pythagorean Theorem at the American Mathematical Society’s Annual Spring Southeastern Sectional Meeting. These two young women are challenging the conventions of math as we know it.
    The Pythagorean Theorem states that in a right angle triangle, the sum of the squares of the legs is equal to the square of the hypotenuse: 


    The theorem has been around for over two thousand years and has been proven hundreds of times with many different methods. So what makes the Johnson-Jackson proof special? The proof is one of the first to use trigonometry.
    For years, mathematicians have been convinced that a trigonometric proof of the Pythagorean Theorem is impossible because much of trigonometry is based upon the Pythagorean Theorem itself (an example of circular reasoning).
    That said, some results in trigonometry are independent of the Pythagorean Theorem, namely the law of sines, and the sine and cosine ratios; the latter is a result that 12-year-old Einstein used in his trigonometric proof of the theorem.
    Though all the details of the Johnson-Jackson proof have not been made public, there was enough information for me to recreate the proof in Maple Learn. The idea of the proof is to construct a right angle triangle with an infinite series of congruent right angle triangles (the first of which has side lengths a, b, and c). Then, using the sine ratio, solve for the hypotenuse lengths of each small congruent triangle. To explore this construction see Johnson and Jackson’s Triangle Construction on Maple Learn. 


     

    Next, find the side lengths of the large triangle (A and B) by evaluating an infinite sum (composed of the hypotenuse lengths of the small congruent triangles). Finally, apply the law of sines to the isosceles triangle made from the first 2 congruent triangles. After simplifying this expression, the Pythagorean relationship (c2 = a2 + b2) emerges.
     

     

    To see more details of the proof, check out Johnson and Jackson’s Proof of Pythagorean Theorem on Maple Learn.
    This new proof of the Pythagorean Theorem shows that discoveries in math are still happening and that young people can play a big role in these discoveries!

     

    The most recent shift in education has seen countries adopting a more student-centered approach to learning. This approach involves enabling students to make sense of new knowledge by building on their existing knowledge. Many countries have embraced this approach in their educational systems. Teachers are no longer the sage on the stage, and gone are lectures and one-way learning. This new era of learning lends itself to the social constructivist framework of teaching and learning. 

     

    Social Constructivism. Students adopt new knowledge through interacting with others to share past experiences and make sense of the learned concepts together. Perhaps the most well-known applications of social constructivist classrooms are Thinking Classrooms popularized by Peter Liljedahl in 2021 (the same age as Maple Learn!). In a Thinking Classroom, groups of students collaborate to discuss potential solutions to solve open-ended problems. Ideas are recorded on vertical surfaces so that all students, including those from different groups, have access to one another’s ideas. The teacher is hands-off in this type of classroom, with students asking each other questions if stuck or unsure. This approach facilitates the exchange of ideas and encourages collaboration among students. Sadly, this innovative idea was brought into the classroom at a peculiar time, at the height of the pandemic when less socialization was happening. 

     

    Nevertheless, teachers were intrigued by this idea, and like any good idea, it spread like wildfire. For the first time, many teachers have reported that they observed their students engage in active thinking, rather than just mechanically plugging and chugging numbers into formulae, as was traditionally done in math education. This shift in approach has led to a deeper understanding of mathematical concepts and improved problem-solving skills among students. At the same time, students were more uncomfortable than ever before because they were not accustomed to the feeling of “not knowing.” The strongest students were often the most uncomfortable as they were conditioned to view mathematics as having only one correct answer. This discomfort is a natural part of the learning process, as it indicates that students are grappling with the new concepts and expanding their understanding. This new approach, which emphasized exploration and problem-solving over rote memorization, challenged their existing beliefs and required them to think in new ways. Over time, as they become more familiar with this approach, students develop greater confidence in their mathematical skills and improve their abilities to think critically and creatively.

     

    Social Constructivism in Maple Learn. As a secondary math teacher, I’ve been using Maple Learn to support my students’ learning. I’ve mainly created projects and collections of financial literacy documents that are not only informative but also exploratory for students to engage with at their own pace. Here is where I see the potential of Maple Learn - not only to support teachers in the classroom but also to act in place of the teacher for asynchronous class work by being the guide on the side. 

     

    The project-based ideas such as “Designing a roller coaster or slide,” “Exploring the rule of 72,” and open-ended questions such as “Designing a cake” and “Moving sofa” can lend themselves to creative discussions using mathematics. This is because Maple Learn offers its users the chance to visualize dynamic representations. Users can relate the algebraic, graphical, text-based, and/or geometrical representations of the same math concept. The convenience of having everything on one page encourages students to take away what they deem are the most important pieces of information as opposed to the teacher telling them what the major takeaways are. Due to their diverse backgrounds and unique mathematical identities, different students tend to focus on different aspects of a given concept. However, it is precisely these differences that can lead to a deeper understanding of the topic at hand. By sharing their perspectives and insights with one another, students can gain a more complete and nuanced understanding of mathematical concepts, and develop a broader range of problem-solving strategies. 

    Source: Double angle identity. Illustration provides geometrical and algebraic representations side by side.  

     

    In addition, the different functions that Maple Learn offers, allow students with varying mathematical backgrounds to have an equitable chance at learning. Some students may be better at manipulating equations, while others might be more visual. Maple Learn provides students with a blank canvas to explore mathematical concepts on their own, without the stress of mental calculations, the need to access different functions on a calculator, or the necessity to search for explanatory videos online. Maple Learn can also have embedded hyperlinks which can be important concepts or documents. These links can provide an easier learning platform for students to construct their own knowledge. An example can be found here. By removing these barriers, students are free to delve into the material and develop a deeper understanding of the underlying principles. This approach can further foster creativity, curiosity, and a passion for learning among students, while also equipping them with the tools they need to succeed in their future academic pursuits. 

     

    Arguably the most difficult aspect of social constructivism to implement using Maple Learn is the “social” aspect of it all which requires a bit of creativity. The goal is not to eliminate the use of teachers, but rather have teachers present the material in a different light. The teacher still decides what students learn in the classroom (or maybe that’s already decided by  the government agency) but how they learn the material is up to the teacher. After interacting with Maple Learn and coming up with interesting solutions, students can trade their responses with their peers to evaluate one another’s responses, approaches, ideas, and solutions to a problem. Students definitely learn more from each other and I believe as teachers, we should capitalize on this aspect. With many jurisdictions around the world adopting a student-centered approach to learning, it is time we advance our teaching styles. Even with the recent advances in AI, we still need to teach our kids how to think, and to think deeply. Tech can definitely help in this regard. 


    In summary, by emphasizing collaboration, critical thinking, and exploration, social constructivism encourages students to build their understanding of new concepts through interaction with others. Often seen as Thinking Classrooms, Maple Learn can supplement social constructivist classrooms by offering a blank canvas for students to explore mathematical concepts on their own, free from the limitations of traditional calculations and rote memorization. Together, these approaches can empower students to become active learners and critical thinkers, setting them on a path towards success in the classroom and beyond. Here are some “How-To” videos to help you get started with creating your own documents in Maple Learn. You can also browse the example gallery with thousands of existing examples here. Happy creating!

    A geometric transformation is a way of manipulating the size, position, or orientation of a geometric object. For example, a triangle can be transformed by a 180o rotation: 

    Learning about geometric transformations is a great way for students, teachers and anyone interested in math to get comfortable using x-y coordinates in the cartesian plane, and mapping functions from R2 to R2. Understanding geometric transformations is also an essential step to understanding higher-level concepts like the Transformations of Functions and Transformation Matrices.
    Check out the Geometric Transformations collection on Maple Learn to learn about this topic. Start out by playing with the Geometric Transformations Exploration document to build intuition about how objects are affected by each of the four transformation types: Dilation, Reflection, Rotation, and Translation. Once you are confident in your skills, try using the Single Geometric Transformation Quiz to test your knowledge.
    For those looking to expand their understanding of geometric transformations, the Combined Transformations Exploration document will let you explore how multiple transformations and the order of said transformations affect the final form of an object. For example, the blue polygon can be transformed into 2 different pink polygons depending on whether the reflection or rotation is performed first:

     


    Once you have the hang of combined transformations, try answering questions on the Combined Geometric Transformations Quiz

     

    How Can Maple Learn Help Address Math Anxiety in Classrooms?

     

    Math anxiety is referred to as negative behaviours such as uneasiness and general avoidance when asked to solve math problems. For teachers and teacher candidates, this can be due to various reasons such as previous negative experiences in math classes, learning styles that conflict with their math teacher, lack of self-confidence, low self-esteem, and stereotype issues related to the belief that math is for men only. Although it is commonly believed that math anxiety only exists in students, research has shown that math anxiety is present among elementary teacher candidates and elementary teachers, particularly women. Furthermore, research has shown that female teachers who suffer from math anxiety have a tendency to pass down their math anxious behaviours to students, particularly affecting more girls than boys. Since the majority of the elementary teaching staff are women, it is possible that a cyclic pattern will arise where teachers will pass down math anxiety to students, and these students will grow up dealing with math anxiety.

    As a current PhD candidate, I have taught elementary teacher candidates basic math knowledge. It was clear to me from the first day, math anxiety was very present within the students I had. Many of these teacher candidates had candidly revealed that they have not taken any math classes since Grade 11, which is the final grade in Ontario where math is mandatory. With Maple Learn, because manyof the documents are created by educators, these documents can function as learning materials which a teacher can use for extra practice and guidance. 

    One strategy to combat math anxiety in general is developing greater self-efficacy and confidence in their math skills. For example, using the Converting and Decimals to Fractions document, teachers and teacher candidates can use this as a tool to support their understanding and can help double-check their work. Unlike students, when learning about math concepts and skills in class, in addition to using online resources they also can ask teachers for help. Whereas for adult learning, it is possible that some may feel shy or embarrassed to seek help from others. On Maple Learn, there are multiple quizzes where a teacher can use as practice to further their understanding. In addition to the solution, these features also provide hints and a “check your work” button so that it can guide the teacher in solving such problems if stuck on a question. One of the cool features of these solutions is that they don’t just reveal the answer, but also include steps to solve the question whenever a teacher gets stuck.

     

    Furthermore, additional visualizations could be a useful tool for visual learners and serve as another method to understand and solve such math problems rather than solely relying on algebra. 

    The documents provided in the example gallery provide multiple different methods on understanding and solving math problems. For example, when multiplying fractions, one can either simplify before multiplying the fractions together or they can first multiply the fractions, then simplify.

    The more practice one does, the better they become at solving math problems, and if interested, Maple Learn has many quizzes that one can use to improve their math skills. For more fractions documents, check out this page here!

     

     

    TODAY I GOT AN INSPIRATION TO CREATE 3D GRAPH EQUATION OF WALKING ROBOT (ED-209) IN CARTESIAN SPACE USING ONLY WITH SINGLE IMPLICIT EQUATION.

    ENJOY...

     

    How to Create Graph Equation of Wankel Engine on Cartesian Plane using Single Implicit Function run by Maple Software

    Enjoy...

     

    It seems once in a while someone asks about converting from degrees minutes seconds format to decimal or the other way around. 

    I created a little procedure for just that purpose. 

    restart; gc()

    NULL

    A little procedure to convert the form of degrees, minutes, seconds to decimal and vice versa.  

    NULL

    dms := proc (d, m := 0, s := 0) local con, d1, d2, d3; if 0 < frac(d) then d1 := floor(d); d2 := floor(60*frac(d)); d3 := 60*frac(60*frac(d)); con := cat(d1, `° `, d2, `' `, d3, `"`) else con := d+m/60.+s/3600. end if; print(con) end proc

    NULL

    Examples of use.

     

    dms(45.2365)

    `45° 14' 11.4000"`

    (1)

    dms(45, 14, 11.4)

    45.23650000

    (2)

    NULL

    Download dms.mw

    edit - a quick realization is to remove the decimals that changes the fractions to floating decimals and change print(con) to print(evlaf(con)) to avoid rounding issues.

    This post is motivated by a question asked by @vs140580  ( The program is making intercept zero even though There is a intercept in regression Fit (A toy code showing the error attached) ).

    The problem met by @vs140580 comes from the large magnitudes of the (two) regressors and the failure to Fit/LinearFit to find the correct solution unless an undecent value of Digits is used.
    This problem has been answerd by @dharr after scaling the data (which is always, when possible, a good practice) and by 
    myself while using explicitely the method called "Normal Equations" (see https://en.wikipedia.org/wiki/Least_squares).

    The method of "Normal Equations" relies upon the inversion of a symmetric square matrix H whose dimension is equal to the number of coefficients of the model to fit.
    It's well known that this method can potentially lead to matrices H extremely ill-conditionned, and thus face severe numerical problems (the most common situation being the fit of a high degree polynomial).
     

    About these alternative methods:

    • In English: http://www.math.kent.edu/~reichel/courses/intr.num.comp.1/fall09/lecture4/lecture4.pdf
    • In French: https://moodle.utc.fr/pluginfile.php/24407/mod_resource/content/5/MT09-ch3_ecran.pdfI


    The attached file illustrates how the QR decomposition method works.
    The test case is @vs140580's.

    Maybe the development team could enhance Fit/LinearFit in future versions by adding an option which specifies what method is to be used?

     

    restart:

    with(Statistics):

    interface(version)

    `Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

    (1)

    Data := Matrix([[4.74593554708566, 11385427.62, 2735660038000], [4.58252830679671, 25469809.77, 12833885700000], [4.29311160501838, 1079325200, 11411813200000000], [4.24176959154225, 1428647556, 18918585950000000], [5.17263072694618, 1428647556, 18918585950000000], [4.39351114955735, 1877950416, 30746202150000000], [4.39599006758777, 1428647556, 18918585950000000], [5.79317412396815, 2448320309, 49065217290000000], [4.48293612651735, 2448320309, 49065217290000000], [4.19990181982522, 2448320309, 49065217290000000], [5.73518217699046, 1856333905, 30648714900000000], [4.67943831980476, 3071210420, 75995866910000000], [4.215240105336, 2390089264, 48670072110000000], [4.41566877563247, 3049877383, 75854074610000000], [4.77780395369828, 2910469403, 74061327950000000], [4.96617430604669, 1416936352, 18891734280000000], [4.36131111330988, 1416936352, 18891734280000000], [5.17783192063198, 1079325200, 11411813200000000], [4.998266287191, 1067513353, 11402362980000000], [4.23366152474871, 2389517120, 48661380410000000], [4.58252830679671, 758079709.3, 5636151969000000], [6.82390874094432, 1304393838, 14240754750000000], [4.24176959154225, 912963601.2, 8621914602000000], [4.52432881167557, 573965555.4, 3535351888000000], [4.84133601918601, 573965555.4, 3535351888000000], [6.88605664769316, 732571773.2, 5558875538000000], [4.35575841415627, 1203944381, 13430693320000000], [4.42527441640593, 955277678, 8795128298000000], [6.82390874094432, 997591754.9, 8968341995000000], [4.35144484433733, 143039477.1, 305355143300000]]):

    # Direct use of LinearFit.
    #
    # As far as I know LinearFit is based on the resolution of the "Normal Equations"
    # (see further down), a system of equations that is known to be ill-conditioned
    # when regressors have large values (in particular when polynomial regression
    # is used).

    X := Data[.., [2, 3]]:
    Y := Data[.., 1]:


    LinearFit(C1+C2*v+C3*w, X, Y, [v, w]);

    Warning, model is not of full rank

     

    HFloat(6.830889923844425e-9)*v-HFloat(2.275143726335622e-16)*w

    (2)

    # For roundoff issues the 3-by-3 matrix involved in the "Normal Equations" (NE)
    # appears to of rank < 3.
    # The rank of this matrix is rqual to 1+rank(X) and one can easily verify that
    # the 2 columns of X are linearly independent:

    LinearAlgebra:-LinearSolve(X, Vector(numelems(Y), 0));
    LinearAlgebra:-Rank(X);

     

    Vector[column]([[0.], [-0.]])

     

    2

    (3)

    # Solve the least squares problem by using explicitely the NE.
    #
    # To account for an intercept we augment X by a vector column of "1"
    # traditionally put in column one.
    Z := `<|>`(Vector(numelems(Y), 1), X):  
    A := (Z^+ . Z)^(-1) . Z^+ . Y;          # Normal Equations

    A := Vector(3, {(1) = 4.659353816079307, (2) = 0.5985084089529947e-9, (3) = -0.27350964718426345e-16}, datatype = float[8])

    (4)

    # What is the rank of Z?
    # Due to the scale of compared to "1", Rank fails to return the good value
    # of rank(Z), which is obviously equal to rank(X)+1.

    LinearAlgebra:-LinearSolve(Z, Vector(numelems(Y), 0));
    LinearAlgebra:-Rank(Z);

    Vector[column]([[0.], [0.], [-0.]])

     

    2

    (5)


    A WORKAROUND : SCALING THE DATA

    model := unapply( LinearFit(C1+C2*v+C3*w, Scale(X), Scale(Y), [v, w]), [v, w] );

    proc (v, w) options operator, arrow; -HFloat(1.264691577813453e-15)+HFloat(0.6607154853418553)*v-HFloat(0.8095150669884322)*w end proc

    (6)

    mX, sX := (Mean, StandardDeviation)(X);
    mY, sY := (Mean, StandardDeviation)(Y);

    mX, sX := Vector[row](2, {(1) = 1447634550.7963333, (2) = 24441399854567932.}, datatype = float[8]), Vector[row](2, {(1) = 871086770.7242773, (2) = 23354440973344224.}, datatype = float[8])

     

    HFloat(4.857279402730572), HFloat(0.789073010656694)

    (7)

    MODEL := model((x1-mX[1])/sX[1], (x2-mX[2])/sX[2]) * sY + mY

    HFloat(4.659353816079309)+HFloat(5.985084089530032e-10)*x1-HFloat(2.7350964718426736e-17)*x2

    (8)

    # Check that the vector of regression coefficients is almost equal to A found above
    # relative error lesst than 10^(-14)

    A_from_scaling       := < coeffs(MODEL) >:
    Relative_Discrepancy := (A_from_scaling - A) /~ A

    Relative_Discrepancy := Vector(3, {(1) = 0.5718679809000842e-15, (2) = 0.14166219140514066e-13, (3) = 0.14308415396983588e-13}, datatype = float[8])

    (9)


    THE QR DECOMPOSITION  (applied on raw data)

    The QR decomposition, as well as Given's rotation method, are two alternatives to the the NE method
    to find the vector of regression coefficients.
    Both of them are known to be less sensitive to the magnitudes of the regressors and do nt require (not
    always) a scaling of the data (which can be quite complex with polynomial regression or when some
    transformation is used to liearize the statistical model, for instanc Y=a*exp(b*X) --> log(Y)=log(a)+b*X).

    N := numelems(Y);
    P := numelems(Z[1]);

    30

     

    3

    (10)

    # Perform the QR decomposition of Z.

    Q, R := LinearAlgebra:-QRDecomposition(Z, fullspan);

    Q, R := Vector(4, {(1) = ` 30 x 30 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), Vector(4, {(1) = ` 30 x 3 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*triangular[upper], (4) = `Order: `*Fortran_order})

    (11)

    # Let C the column vector of length P defined by:

    C := (Q^+ . Y)[1..P];

    C := Vector(3, {(1) = -26.6044149698075, (2) = -.517558353158176, (3) = -.881007519371895})

    (12)

    # Then the vector of regression coefficients is given by:

    A_QR                 := (R[1..P, 1..P])^(-1) . C;
    Relative_Discrepancy := (A_QR - A) /~ A

    A_QR := Vector(3, {(1) = 4.65935381607931, (2) = 0.5985084090e-9, (3) = -0.2735096472e-16})

     

    Relative_Discrepancy := Vector(3, {(1) = 0.3812453206e-15, (2) = 0.1105656128e-13, (3) = 0.1216778632e-13})

    (13)

    # The matrix H = Z^+ . Z writes

    H                    := Z^+ . Z:
    H_QR                 := R^+ . Q^+ . Q . R:
    Relative_Discrepancy := (H_QR - H) /~ H

    Relative_Discrepancy := Matrix(3, 3, {(1, 1) = -0.1184237893e-15, (1, 2) = 0., (1, 3) = -0.3491343943e-15, (2, 1) = 0., (2, 2) = 0.1930383052e-15, (2, 3) = 0.3369103254e-15, (3, 1) = -0.1745671971e-15, (3, 2) = -0.5053654881e-15, (3, 3) = -0.1366873891e-15})

    (14)

    # H_QR expression is required to obtain the covariance matrix of the regression coefficients.


     

    Download LeastSquares_and_QRdecomposition.mw


     

     

    # countourplot3d piggybacks on top of plot3d.
    # For the "coloring=[lowColor, highColor]", the "filledregions=true" option must be present.
    # If "filledregions=true" is not present, plot3d will throw an error.
    # This code shows the three cases, only one of which will work.
    Note to support. I cannot add a new tag. contourplot3d should be a tag.

    restart;
    with(plots);
    with(ColorTools);
    cGr4s := Color([0.50, 0.50, 0.50]);
    contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);
    contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = false, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);
    contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = true, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);

    CREATING GRAPH EQUATION OF "DNA" IN CARTESIAN SPACE USING PARAMETRIC SURFACE EQUATION RUN ON MAPLE SOFTWARE

    ENJOY...

     

    Happy Springtime to all in the MaplePrimes Community! Though some in our community may not live in the northern hemisphere where flowers are beginning to bloom, many will be celebrating April holidays like Ramadan, Passover, and Easter.

    One of my favorite springtime activities is decorating eggs. Today, the practice is typically associated with the Christian holiday of Easter. However, painted eggs have roots in many cultures.

    For over 3,000 years, painting eggs has been a custom associated with the holiday of Nowruz, or Persian New Year, during the spring equinox. Furthermore, in the Bronze Age, decorated ostrich eggs were traded as luxury items across the Mediterranean and Northern Africa. Dipped eggs have also played an important role in the Jewish holiday of Passover since the 16th century.

    To celebrate this tradition, I would like to invite all of the Maplesoft community to create a decorated egg of their own with the Easter Egg Art Maple Learn document. In this document, an ovoid egg equation is used to define the shape of an egg. 



    The ovoid egg equation mimics the shape of a typical hen’s egg. Each bird species lays differently shaped eggs. For example, an ostrich’s egg is more oblong than an owl’s, and an owl’s egg is rounder than a goose’s. Surprisingly, every egg can be described by a single equation with four parameters:



    Learn more about this equation and others like it with John May’s Egg Formulas Maple Learn document.

    The Easter Egg Art document includes 9 different decorative elements; users can change the color, position, and size of each in order to create their own personal egg! The egg starts out looking like this:



    In just a couple of minutes, you can create a unique egg. Have fun exploring this document and share a screenshot of your egg in the comments below!  Here’s one I made:


    How to Create Graph Equation of Water Drop Wave in Cartesian Space using single Implicit Function only run by Maple Software

    The Equation is:   z = - cos( (x2+y2)0.5 - a)  with paramater a is moving form 0 to 2pi 

    Enjoy...

    Plese Click link below to see full equation in Maple software

    Water_Drop_Wave.mw

    First 12 13 14 15 16 17 18 Last Page 14 of 305