CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー...

Preview:

Citation preview

CAS-aided Visualizationin LaTeX documents

for Mathematics Educationー Achievement of KETpic ー

M. Kaneko, T. Abe, M. Sekiguchi,

Y. Tadokoro, S. Yamashita,

(Kisarazu National College of Tech.)

& S. Takato (Toho Univ.)

Contents

1. What is KETpic ?

2. Simple demonstration of drawing

pictures using KETpic

3. Other examples

4. Examples of space curves

5. Conclusion

6. Future works

What isKETpic?

KETpic isMacro Package for

CAS (Maple, Mathematica etc.)

What can we doby using KETpic?

We can draw

Fine Pictures in LaTeX documents.

(Fine = accurate & beautiful)

Usually many people use EPS.

\includegraphics

User’s LaTeXtext file

User’sdocument

CAS EPS

CompileMathematicaldocument

The output (EPS) of CAS is inserted into the LaTeX text file by using command “includegraphics”.The above procedure fits in case of not only CAS but also various graphic softwares or Gnuplot . Also, the command of Maple and Mathematica which generates LaTeX file follows the above procedure.

BUT…

EPS is not satisfactory for us.

• The size of file is large.

• Graphics can not be corrected as we like.

• Mathematical expressions (e.g. legends, accessories, hatchings,...) are poor.

• What we want to do (drawing tangential line to a curve at a specified point, curves defined by implicit functions, etc. ) are not supported.

Solution

So we have developed “KETpic”.

• KETpic for Maple has been accomplished (v1.7). This talk is concerned with this version mainly.

• Recently we have started transplanting KETpic to Mathematica .

• How to get KETpic?

http://www.kisarazu.ac.jp/~masa/math/

(Of course FREE)

Though… Maple is NOT FREE

Comparison with EPS

\input

User’s LaTeXText file

User’sdocument

KETpicCAS

Tpic

CompileMathematicaldocument

By using KETpic, graphical outputs of CAS are formatted to generate graphical codes (Tpic specials) and written on text files. We insert these files into LaTeX document by the command “input”.

It is a Fourier series approximation of the step function \pm 1 with period twice of pi.

A simple demonstrationof drawing pictures

by using KETpic

An example from the convergencetheorem of Fourier series.

Merit of KETpic (1)

• By using CAS, we can draw accurate curves easily in the LaTeX documents.

• The output of KETpic is just a text file, which is much smaller than EPS, JPEG, PDF etc. Therefore, it is easy to attach the output to E-mail.

Merit of KETpic (2)

• You can insert mathematical expressions at your favorite position in graphics, with the same quality as those in LaTeX text.

• You can use various accessories such as hatchings, tickmarks, legends, …, so that you can give students very expressive printed matter.

Other ExamplesFollowing examples are effective for math. education,

and we actually use them in our classroom.

JapaneseMathematics(18C~ 19C)

cycloid

polar coordinate

stabilitytangential

circlesasteroid

9-pointed circle

contour

chi^2 function

Examples ofspace curves

This is the cross eyed view of the intersection of two cylinders.

These are the figures of regular icosahedron. In the right figure, hidden line elimination of KETpic is used unlike the left. Skeletons like this are drawn automatically by using KETpic.

You see the right figure is much more expressive than the left.

This is a picture used to educate spherical polar coordinate.

Mathematica version(1) Loading KETpic

Get[StringJoin[“c:”,bksl[“ketpicmath.m”]]]

(2) Calculation of numerical data

setwindow[{-2*Pi,2*Pi},{-2.3,2.3}];

f=(4/Pi)*Sum[Sin[(2*k-1)*x]/(2*k-1),{k=1,N}];

N=10;

g=plotdata[{f,{x,XMIN,XMAX},PlotPoints->100}];

(3) Writing down the numerical data onto LaTeX file (“fig1.tex”)

openfile[“e:\\Hungary/fig1.tex”];

openpicture["1cm“]:

drwline[g];

closepicture[1];

closefile[];

This is a picture of chaos drawn with KETpic for Mathematica.

Mathematica Codes

Putting 40000 points.

Perhaps it is the delimitation of LaTeX and DVI.

Conclusion

• KETpic takes full advantage of CAS so that we can insert fine graphics into LaTeX document with reasonable efforts.

• KETpic has many merits which are effective for mathematics education. Especially it is useful when the outputs are used in math classroom as printed matter.

Future works

• Extension to other CAS’s

– Now on developing Mathematica version

– And other CAS’s, especially for free, such as Risa-Asir, Scilab, …

• Various and richer 3d-expression

We hope

KETpic is wide spread to the world.

Please use KETpic!

Thank you for your attention.

感謝

Structure of user’s documentMaple file

(1) Loading KETpic

> read `c:\\ketpicw.m`:

(2) Calculation of numerical data

> setwindow(-2*Pi..2*Pi,-2.3..2.3):

> f:=(4/Pi)*sum(sin((2*k-1)*x)/(2*k-1),k=1..N);

> N:=10:

> g:=plot(f,x=XMIN..XMAX,numpoints=100):

(3) Writing down the numerical data onto LaTeX file (“fig1.tex”)

> openfile(`e:\\Hungary/fig1.tex`):

> openpicture("1cm"):

> drwline(g):

> closepicture():

> closefile():

LaTeX file

(4) Generation of LaTeX file of graphic

codes

\begin{document}

\input{fig1}

\end{document}

Then the output is the following picture:

This picture of cycloid can be drawn by using do-loop and the commands “rotate” and “translate” of Maple.

We believe that the educational effect of this picture is not inferior to that of animation. Also this picture has the advantage that it can be used in the form of printed matter.

This picture of trochoid can be drawn by the same Maple program with only the coordinate of point substituted.

Inspiring students’ imagination

While seeing these pictures, some student

may put up a question

“How will the picture become

if ellipse rotate?” Then we can give them answer by using

KETpic as in the next picture.

The roulette of the focus is called “Delauney curve”.

This is a trace of the circle which rotates twice around the given ellipse on the outer side of it.

In case of the rotation on the inner side of ellipse, the diameter of circle need to be small to a certain extent so that the rotation would not be interrupted.

This shows a delicate situation. Whether safe or not safe is easily judged using the two diameters of ellipse and that of circle. Deduction of this safety condition is a good exercise for high school students.

This is a picture of 9-pointed circle. The dotted circle is drawn by automatic calculation of Maple.

This is a picture of circles which are tangent to each other and the two lines. To draw it, do-loop of Maple is used. Also hatching is done very easily.

This figure shows an example of the graph of function given by polar coordinate. Here do-loop of Maple is effectively used.

Closed chain circle

The sum of the inverse for radii of dotted circles are the same as that of dashed circles.

This is the case that bold circles are put side by side. Then touching circle is turned upside down. This picture seems quite different from the previous one, but essentially the same.

These curves are graphs of chi^2 functions with various values of deviation.

These are graphs of functions obtained by integration of the above chi^2 functions. Without using CAS, it would be impossible to draw graphics like this.

This is contours of the Coulomb potential with two electric charges at (\pm 1,0). To draw this picture, “contourplot” is used.

Z=((x+1)^2+y^2)^(-1/2)+((x-1)^2+y^2)^(-1/2)

The width and direction of hatchings are easily handled.

This figure is used to explain the stability of dynamical systems in economics classroom. You see that various kind of lines (real line, dotted line, dashed line,…) and arrowhead are very expressive

Recommended