# Summer 2012 MATH 207: Mathematical computing Branko Ćurgus

Monday, August 13, 2012

• In Problem 1 on Assignment 3 you need to use the Calendar package: Needs["Calendar`"]. This package contains several functions related to date arithmetic: DaysBetween[], DaysPlus[], DateQ[].
An important warning: Before you use the commands from the Calendar package you must load the Calendar package. If you by mistake try to use one of the Calendar package commands without having the package loaded, you will have to quit the kernel (Evaluation→Quit Kernel→Local) before loading the package.
• Files 20120808.nb, 20120809.nb and 20120813.nb contain some useful commands for Problem 2 on Assignment 3.
• Tomorrow we will discuss commands Fit[] and FindFit[] which are essential for Problem 2 (b-3) on Assignment 3.
• The file PythagorasTree.nb is a "guide" for the construction of fractals in Problem 3 on Assignment 3.

Wednesday, August 8, 2012

• In the first part of Problem 3 on Assignment 3 you are asked to create a function that would produce iterations of the quadratic type 2 curve. In the first picture below I show the 0th iteration in blue and the 1st iteration in red. I emphasize the points that are used. You do not need to do this on your plots. In the second picture below I show the 1st iteration in blue and the 2nd iteration in red. The large picture is the fourth iteration of the quadratic type 2 curve.
• In the second part of Problem 3 on Assignment 3 you are asked to create a function that would produce iterations of the von Koch snowflake. The four pictures below show the 0th, 1st, 2nd and the 3rd iteration of the von Koch snowflake.
• In the third part of Problem 3 on Assignment 3 you are asked to create a function that would produce iterations of the Cesaro fractal which depends on angle $\alpha$. The four pictures below show the 0th, 1st, 2nd and the 3rd iteration of the Cesaro fractal with the small angle $\alpha = \pi/16$.

• Below is an animated gif file that cycles through the 1st, 2nd, 3rd, 4th, 5th and the 6th iteration of the Cesaro fractal and, within each of the iterations cycles through all the angles starting from $\pi$, proceeding towards $0$ and then back to $\pi$ in steps of $\pi/50$. The animation starts by the first iteration and cycles through angles from $\pi$ to $0$ and back to $\pi$. This is repeated for 2nd, 3rd, 4th 5th and 6th iteration. For each iteration there are 101 pictures.

• Place the cursor over the image to start the animation.

Monday, August 6, 2012

• For completeness, I post four more generalized cardioids; this is for the optional third part of Problem 3. The animations below are large. On a slow internet connection it takes a while for them to load. I will make smaller ones later.
• Below is the cardioid generated by a wheel with radius 1/2 rolling inside of a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 1/3 rolling inside of a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 2 rolling "inside" of a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 3/2 rolling "inside" of a circle with radius 1.

Place the cursor over the image to start the animation.

Saturday, August 4, 2012

• For completeness, I post four generalized cardioids; this is for the optional third part of Problem 3. The animations below are large. On a slow internet connection it takes a while for them to load. I will make smaller ones later.
• Below is the cardioid generated by a wheel with radius 1/2 rolling on a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 1/3 rolling on a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 2 rolling on a circle with radius 1.

Place the cursor over the image to start the animation.

• Below is the cardioid generated by a wheel with radius 3/2 rolling on a circle with radius 1.

Place the cursor over the image to start the animation.

Thursday, August 2, 2012

• The notebook 20120801.nb contains some hints for Problem 4 and also a hint for Problem 3.
• Again, I point out that Problem 1 is quite similar to the problem solved in ExpfTanl.nb. In this notebook there are many hints on what to do in this problem.
• Problem 3. I made an animation that unifying two pictures from Wikipedia's Cardioid page. You should be able to produce something like this. If not you can present one animation and one picture.

Place the cursor over the image to start the animation.

• As stated in Assignment 2, Problem 3 consists of three parts: Cycloid, Cardioid and Generalized cardioid. Since I have not posted any illustrations for the Generalized cardioid part, I am making this part an optional part of the assignment. If you do it, I will give you extra credit. Otherwise, I will not consider it a part of this assignment.

Tuesday, July 31, 2012

• Assignment 2 is posted today.
• The most important tools in Mathematica are Module[] and Pure Function. I used Module[] in several notebooks so far. Today we discussed pure functions and their power. The notebook 20120731.nb is a must read for pure functions.
• Problem 1. This problem is quite similar to the problem solved in ExpfTanl.nb. In this notebook there are many hints on what to do in this problem.
• Problem 2. This problem is an exploration of a surprising function. You should use what you learned in Calculus, but with the power of Mathematica. This function has some surprising features that you need to discover. When you discover these features, formulate them in clear answers to my questions. Support your answers with calculations and illustrations. To explore the function use the functions D[] to find the derivative and FullSimplify[] to simplify it. To find special points you can use Solve[], Reduce[] or FindRoot[] where appropriate. However, Mathematica needs a lot of human help in this problem. It is a very good example of human-machine interaction. The notebook 20120731.nb has a lot of material relevant to this problem.
• Problem 3. In the first part of this problem you need to unify, as explained in the problem, three animations given below.

Place the cursor over the image to start the animation.

Place the cursor over the image to start the animation.

Place the cursor over the image to start the animation.

• I will comment on Problem 4 later.

Tuesday, July 24, 2012

• Assignment 1 is due on Monday, July 30 at 11:59pm.
• Problem 1. In definitions the functions SqSin, SqCos, LiSin, LiCos, TrapSin, TrapCos, RoSin, RoCos in Problem 1 it is preferable to use compositions of Cos, Sin, Sign, ArcCos, ArcSin and modifications of resulting periods and amplitudes. If you use Mod, Floor, If and similar functions you might experience problems with Plot. These problems are caused by the plot option Exclusions->Automatic. Changing Exclusions->Automatic to Exclusions->None might fix the problem.
• Problem 1. When you adopt the content of The beauty of trigonometry to your funny Cos, Sin it is essential to pay attention to the proper domains for the variables involved. Here proper means that there should be no overlap in the parametric plots. In 3-d parametric plots overlaps can slow down plotting considerably. Your notebook should evaluate in less than 60 seconds. If it is slower comment out slow parts.
• Problem 2. For some useful stuff for Problem 2 see my Mathematica page, Section: Recursively defined functions.

Wednesday, June 18, 2012

• Mathematica part of the class will start on Thursday, July 19, 2012.
• The information sheet
• We will use
which is available in BH 215. This is the current version of this powerful computer algebra system.
• We also have
which is available on many more campus computers. This is an old, but still powerful, version of this software.
• To get started see my Mathematica page. Please watch the videos that are on this page before the first class.