Education

Teaching and learning about math, Maple and MapleSim

Back to school, back to school, to prove to dad that I'm not a fool...(if you don't know what this is from, google it)

Well now that the school year has started, it's time to get the old grey matter going.  Now if you're a student on this board, there's a good chance that:

a) you know how to use Maple and are helping others out; or

b) you are not familiar with Maple and you want all the help you can get.

I'm assuming there are more people...

Here is some standard alternative to Newton's method (and
thus may safe some homework ... so what). 

It will find a root of f (I think it must be continuous C^1)
in the interval ax ... bx, if it has different signs at the
boundaries.

The code is more or less translated from netlib C library
(or similar).

Usage:

  Digits:=16;

  f:= x -> exp(x)-Pi;
  zBrent( f, 0.0, 2.0);
  'f(%)': '%'= evalf(%);

If F is a quadratic function on a n-dimensional vector space,
then F(x) is affine equivalent to one of the following:
  Sum( epsilon[j]*x[j]^2, j=1 ..r  ), 
  Sum( epsilon[j]*x[j]^2, j=1 ..r  ) + alpha, 

But note the mouse-over caption! See www.xkcd.com for todays (June 11, 2008) strip. This will be printed and posted at the door that seperates the Physics Dept. from the Math Dept. at most institutions.

Tim

I recently submitted my work to Maple Application Center and I received a bug report from a staff. Then, I resubmitted it after fixing bugs. However, I have a bug report again (^_^; Yes, this is because my work was poor, but in other words, all applications in Maple Application center that passed strict check by staff are all guaranteed to have good quality. I am sure that everyone can find good tools for education and research. We should utilize them. If we can not find applications that we want, let us develop works and submit them ! Yasuyuki Nakamura

For a bit of light relief, head on over to the online comic strip at phdcomics.com.  If you've ever been a PhD student, be careful, this strip might make the nightmares come back...

I run Maple on a Wintel machine, specifically a Dell Dimension 9100 Mini-Tower: Pentium D Processor 820 with Dual Core Technology (2.80GHz, 800FSB) Microsoft Windows XP Media Center 2005.  I also recently acquired an OLPC.  I don't think that the OLPC will be much of a Maple platform in the near future but it does run Linux.

No, the title does not come from hornybitches.com, nor does it mean something related to sex.

Special Relativity has been around for ~100 years, General Relativity for ~90 years.  I'm hoping that with the assistance of Maple and Mapleprimes I may be able to do some tensor calculus to better understand Einstein.  Perhaps the twin paradox is within my reach.  Perhaps even the orbit of Mercury.

Of all the ways to decompose a numerical (floating point) matrix, my favorite is the singular value decomposition (SVD).  There are a lot of applications of the SVD (see my dissertation for one related to polynomial algebra) but my favorite ones are probably two applications related to image processing.

The first one I want to talk about comes from the cover of James Demmel's book "Applied Numerical Linear Algebra": image compression.  This example gives a really cool intuitive understanding of the Rank of Matrix and is also nice excuse to play with Maple's ImageTools package.

So, the first thing you need a test image. I used the classic image compression benchmark of a Mandrill.



Read this in with:


mandrill:=ImageTools:-Read("4.2.03.tiff");


The result is a 512x512x3 array.  In order to do something with this, we need to make it into a matrix so, call


manmat:=convert(ArrayTools:-Reshape(mandrill, 512*3, 512), Matrix);


Now we can compute a singular value decomposition of the image:


(U, S, V) := LinearAlgebra:-SingularValues(manmat, output = ['U', 'S', 'Vt']);

Now we can zero-out small singular values and multiply things back together to create low-rank approximations of the matrix that are also compressed versions of the image.
Rank 32 will give us 1/8 of the data (64 dimension 512 vectors: 32 rows of U, 32 columns of V, and the 32 corresponding singular values) but still a pretty good image:


rank32approx:=MatrixMatrixMultiply(`.`(U, DiagonalMatrix(S[1..32], 3*512, 512)), V, outputoptions = [order = C_order]);


This reshape it back to an image and display:


Preview((Reshape(rank32approx, 512, 512, 3)));


Taking things down to rank 8, is leaving only 1/32 of the data, but it is amazing how what is left resembles the original image:


rank8approx:=MatrixMatrixMultiply(`.`(U, DiagonalMatrix(S[1..8], 3*512, 512)), V, outputoptions = [order = C_order]);
Preview((Reshape(rank8approx, 512, 512, 3)));


To look at more images in order of descending rank, take a look at my worksheet:
Download 5480_SVD-face-colour-improved.mw
View file details

Next time: eigenfaces

A colleague showed this to me earlier this afternoon. I can explain, and accept, most of Maple's responses. I do have one case where I believe Maple could do better.

This arose during the creation of some Maple materials to support the derivation of the Integral Test for series convergence. Consider:

restart;
I1 := Int( 1/x^p, x=1..infinity );
                                /infinity      
                               |          1    
                               |          -- dx
                               |           p   
                              /1          x    

I would like Maple to assist me with the following definite double integral:

int(int(x/(x^2+y^2+z^2)^(3/2), y = -b .. b), z = c .. a+c)

so far, I have failed.  Can anybody help?

Here is my worksheet:

View 4937_Page92.mw on MapleNet or Download 4937_Page92.mw
View file details

Why is the following function such a problem to differentiate?

A := 1/(8*cos(`θ`)*(sin(`θ`))(sin(`θ`)+cos(`θ`))^2)

Here is a worksheet:

View 4937_page84.mw on MapleNet or Download 4937_page84.mw
View file details

I've made up a worksheet of the Top Ten Maple Errors, containing some of the common mistakes I often see newcomers to Maple commit (especially in the setting of my Introduction to Mathematical Computing class). I hope you will find it useful in trying to avoid those mistakes. Of course this is only a personal list, and not exhaustive. Please feel free to argue the merits of other items that should be included in the list. Here is the link: Download 4541_topten.mw

First 51 52 53 54 55 56 57 Page 53 of 58