16.08.2013 Views

engineering mathematics education with computer algebra

engineering mathematics education with computer algebra

engineering mathematics education with computer algebra

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ENGINEERING MATHEMATICS EDUCATION WITH COMPUTER ALGEBRA: THE<br />

MATLAB ALTERNATIVE<br />

James Katende<br />

Faculty of Technology<br />

Bayero University, Kano<br />

Keywords: Computer Algebra Systems, Engineering Mathematics Education<br />

Abstract<br />

Computer <strong>algebra</strong> systems have become an<br />

important tool for many <strong>engineering</strong> and<br />

technical professionals. There is a growing need<br />

to incorporate such tools into the <strong>education</strong> of<br />

such professionals. This paper discusses these<br />

systems and their role <strong>with</strong>in <strong>engineering</strong><br />

<strong>mathematics</strong> in higher <strong>education</strong>. Some<br />

advantages and problems associated <strong>with</strong><br />

<strong>computer</strong> <strong>algebra</strong> are highlighted and illustrated<br />

using MATLAB.<br />

1. Introduction<br />

In the early 1980s there were predictions that<br />

<strong>computer</strong> <strong>algebra</strong> systems (also called <strong>computer</strong><br />

based symbolic manipulation systems and<br />

abbreviated to SAMs) would bring about a<br />

revolution. Stern [1] asserted that SAMs would<br />

do for mathematical analysis what the hand-held<br />

calculator had done for calculation and<br />

arithmetic. However, the revolutionary change to<br />

practice in higher <strong>education</strong> that many have<br />

predicted has not yet happened. Lawson [2]<br />

suggested two main reasons for this: one related<br />

to teaching staff and the other to students. The<br />

first is the innate conservatism of many<br />

mathematicians in higher <strong>education</strong> coupled <strong>with</strong><br />

the fact that there were a number of failings in<br />

most of the early packages [3].<br />

The second reason is one of access. Students<br />

readily use pocket calculators because of<br />

familiarity and access. The same has not been<br />

true of SAMs. Students have to visit <strong>computer</strong><br />

laboratories in order to be able to use a SAM.<br />

Consequently, SAMs have not yet shared the<br />

universal availability, which the calculator<br />

enjoys.<br />

However, SAMs are an increasingly important<br />

tool for professionals in a wide variety of<br />

technical and scientific occupations. It was<br />

recognized early that those responsible for<br />

designing and providing the <strong>education</strong>, both<br />

initial formation and continuing professional<br />

development, of these professionals must ensure<br />

that they acquire appropriate knowledge of the<br />

capabilities and limitations of such systems and<br />

learn to incorporate their use into the overall<br />

pattern of their professional activities [4]<br />

1<br />

This paper briefly reviews what a SAM is, and<br />

outlines some of the potentials and problems<br />

which attend the use of SAMs in undergraduate<br />

<strong>engineering</strong> <strong>mathematics</strong>. Illustrations are<br />

presented using the programming language<br />

MATLAB whose Symbolic Math Toolbox<br />

utilizes tools built on portions of one of the most<br />

popular SAMs, MAPLE.<br />

3. SAMs and Their Uses<br />

Basically, a SAM is a piece of software, which is<br />

capable of working symbolically as well as<br />

numerically. In principle it is a program that does<br />

on a <strong>computer</strong> the manipulation that has<br />

traditionally been done <strong>with</strong> pencil and paper.<br />

So, for example, if requested to expand cos(7x) a<br />

SAM will effortlessly return the answer:<br />

64cos 7 (x)-112cos 5 (x)+56cos 3 (x)-7cos(x)<br />

Similarly, a SAM command to differentiate the<br />

function sin(E x /(x 2 +1) <strong>with</strong> respect to x produces<br />

the answer (almost instantly):<br />

x ⎛ x<br />

⎛ E ⎞<br />

⎜ E<br />

cos ⎜<br />

⎟ − 2<br />

2<br />

⎝ + ⎠<br />

⎜ 2<br />

x 1<br />

⎝<br />

x + 1<br />

E<br />

x<br />

x<br />

⎞<br />

( ) ⎟⎟<br />

2 2<br />

x + 1<br />

Early SAMs such as, MACSYMA and<br />

REDUCE, were large, required considerable<br />

<strong>computer</strong> power and had complex syntax.<br />

However, hardware and software advances over<br />

recent years completely altered this situation.<br />

Modern programs that incorporate SAM<br />

capabilities include Derive, Maple, Mathematica<br />

and Matlab. They run on PCs, have graphical<br />

user interfaces and although there is still a<br />

reasonable amount of syntax required for more<br />

complicated operations, can be used to perform<br />

routine manipulation <strong>with</strong>out the need for<br />

lengthy study of manuals. In addition these<br />

packages have progressed enormously beyond<br />

simply being manipulators of complicated<br />

symbolic strings. They are now complete<br />

mathematical environments <strong>with</strong> <strong>algebra</strong>ic,<br />

numerical, graphical and programming facilities.<br />


3. The MATLAB SAM<br />

MATLAB (Matrix Laboratory) is a high<br />

performance interactive software tool for<br />

technical computing. Typical uses include<br />

general-purpose numeric computation; algorithm<br />

prototyping; modelling and simulation; data<br />

analysis, exploration and visualisation; scientific<br />

and <strong>engineering</strong> graphics; a teaching aid in linear<br />

<strong>algebra</strong> and other topics; and solution of special<br />

purpose matrix formulations such as those<br />

associated <strong>with</strong> automatic control, statistics and<br />

signal processing [5,6,7].<br />

MATLAB features a family of applicationspecific<br />

solutions called toolboxes, which allow<br />

the user to learn and apply specialised<br />

technology. Toolboxes are specialised<br />

collections of MATLAB functions (M-files) that<br />

extend the MATLAB environment to solve<br />

particular classes of problems. Areas in which<br />

toolboxes are available include: symbolic maths;<br />

analogue and digital signal processing; analogue<br />

and digital control systems; neural networks;<br />

fuzzy logic; simulation; system identification;<br />

and many others.<br />

The Symbolic Toolbox deals <strong>with</strong> symbols,<br />

formulas, and equations. It features in-built<br />

functions for: differentiation; integration;<br />

solution of differential equations; Laplace and<br />

Fourier transformations; linear <strong>algebra</strong>; graphics;<br />

etc. It is employed in the following sections to<br />

illustrate some advantages and drawbacks<br />

associated <strong>with</strong> use of a SAM in <strong>mathematics</strong><br />

<strong>education</strong>.<br />

Clicking the MATLAB (version 5.3) icon in the<br />

WINDOWS – 95/98/NT/Me environment opens<br />

the command window, which is the main<br />

window for communicating <strong>with</strong> the MATLAB<br />

interpreter. The command window prompt is "»".<br />

To find out about the symbolic computation<br />

functions available in MATLAB, execute the<br />

command:<br />

» help symbolic.<br />

4. Uses of SAMs in Education<br />

A strong case has been presented for the<br />

widespread use of <strong>computer</strong> <strong>algebra</strong> in<br />

<strong>mathematics</strong> <strong>education</strong>. Some benefits resulting<br />

from using <strong>computer</strong> <strong>algebra</strong> have been<br />

enumerated [8]. The key advantages include the<br />

following:<br />

Computer <strong>algebra</strong> allows the focus to be<br />

on concepts and understanding<br />

principles <strong>with</strong>out the distraction of<br />

2<br />

large amounts of ‘routine’<br />

manipulation.<br />

Motivation can be enhanced because<br />

more realistic problems can be tackled.<br />

Students can cover many more<br />

examples allowing them to be more<br />

active participants in discovery<br />

learning.<br />

These are expanded in the following <strong>with</strong><br />

illustrative examples in MATLAB. Although all<br />

the examples of <strong>computer</strong> <strong>algebra</strong> commands<br />

given in this section are for MATLAB, all SAM<br />

packages can easily do the things shown here.<br />

Where MATLAB sessions are shown, lines<br />

beginning <strong>with</strong> '»' show inputs to MATLAB and<br />

other lines show answers MATLAB returns. The<br />

bold typeface shows MATLAB in-built<br />

functions or constants.<br />

(a) SAMS reduce the premium on pure<br />

manipulative ability. Students may use a SAM to<br />

assist in or confirm their own calculations. As a<br />

result weaker students can be enabled to follow<br />

more sophisticated or complex arguments. In the<br />

following MATLAB session a student enters the<br />

expression, f = sin (yx 2 ), and differentiates it<br />

<strong>with</strong> respect to x and y in turn.<br />

»f = sym ( 'sin(y*x^2)');<br />

»diff (f) % derivative <strong>with</strong> respect to x<br />

ans =<br />

2*cos(y*x^2)*y*x<br />

»diff(f,'y') %derivative <strong>with</strong> respect to y<br />

ans =<br />

cos(y*x^2)*x^2<br />

(b) SAMs enable students to concentrate on<br />

concepts, not detail. A case in point is that of<br />

differentiation. In undergraduate <strong>engineering</strong><br />

<strong>mathematics</strong>, students learn a range of<br />

techniques of differentiation including such<br />

things as the product rule, the quotient rule, and<br />

the function of a function rule, implicit<br />

differentiation and logarithmic differentiation. A<br />

SAM will return the derivative of a function<br />

<strong>with</strong>out any explicit indication that a particular<br />

technique or rule has been used. For example,<br />

differentiation of the function in the above<br />

MATLAB session requires use of both the<br />

function of a function and the product rule.<br />

However, as far as the user of a SAM is<br />

concerned, there is no difference between<br />

differentiating this function and differentiating x 2<br />

as illustrated in the following MATLAB session.<br />

Note that in both cases MATLAB returns the<br />

answer (ans) almost instantaneously.


»x=sym ('x');<br />

»diff(x^2)<br />

ans =<br />

2*x<br />

This can be viewed as a great advantage as it<br />

makes the point that differentiation is the same<br />

process no matter how complex the function<br />

being differentiated. The technique employed to<br />

determine the derivative does not alter what the<br />

derivative means.<br />

Consequently students need only to know that<br />

there is a product rule, what the rule is and where<br />

it comes from but need not necessarily complete<br />

large numbers of ever more (<strong>algebra</strong>ically)<br />

complicated examples. In the time that is freed<br />

by this reduction in “drill” exercises, key<br />

concepts such as the derivative being a rate of<br />

change, qualitative information such as a positive<br />

derivative indicating an increasing function and<br />

using derivatives to represent physical quantities<br />

(such as velocity and acceleration) are all topics<br />

which might be more heavily emphasized than at<br />

present.<br />

(c) A SAM acts as a computational assistant for<br />

routine procedures. Once a procedure has been<br />

understood at a basic level a better understanding<br />

can sometimes be achieved by the study of a<br />

range of examples. However, the labour of<br />

repetitive computations often inhibits such<br />

learning. A SAM can reduce the labour and also<br />

allow lecturers to set a wider range of illustrative<br />

work in assignments. Fourier series offer a good<br />

example. To illustrate the more subtle points of<br />

the topic requires a wide range of examples to be<br />

completed. The labour of calculating the Fourier<br />

coefficients for that large number of examples<br />

discourages students from completing them and<br />

thus inhibits understanding. The following<br />

MATLAB session evaluates the coefficients bn<br />

for the first five terms of a Fourier series for the<br />

function f(x) = x(1-x), 0≤x≤1. The Fourier<br />

coefficients are given by:<br />

1<br />

bn = x ( 1 x)<br />

sin( πnx)<br />

dx<br />

∫ −<br />

0<br />

With pencil and paper this would require<br />

integration by parts twice.<br />

» syms x n bn<br />

»bn = int(x*(1-x)*sin(pi*n*x),0,1)<br />

bn =<br />

-(pi*n*sin(pi*n)+2*cos(pi*n))/pi^3/n^3+<br />

3<br />

+2/pi^3/n^3<br />

» pretty(bn)<br />

pi n sin(pi n) + 2 cos(pi n) 2<br />

- ---------------------------------- + ------<br />

3 3 3 3<br />

pi n pi n<br />

» subs(bn,n,{1,2,3,4,5})<br />

bn =<br />

[ 4/pi^3, 0, 4/27/pi^3, 0, 4/125/pi^3]<br />

The result is actually<br />

πnsin(<br />

πn)<br />

+ 2cos(<br />

πn)<br />

2<br />

bn = −<br />

+<br />

3 3<br />

3<br />

π n π n<br />

n<br />

( −1)<br />

2<br />

= − 2 + 3 3 3 3<br />

π n π n<br />

The first five coefficients are:<br />

bn = [<br />

4<br />

3<br />

π<br />

, 0,<br />

4<br />

27π<br />

3<br />

, 0,<br />

4<br />

125<br />

3<br />

π<br />

Majority of <strong>engineering</strong> undergraduates would<br />

make at least one minor error in completing the<br />

above integration. This would simply obscure<br />

any learning, which was intended to follow from<br />

a consideration of the (correct) Fourier series<br />

representation of the waveform. Using a SAM,<br />

students can be expected to complete a wider<br />

range of examples more quickly and more<br />

accurately, and when guided appropriately, to<br />

gain thus an enhanced understanding of the<br />

topic.<br />

(d) SAMs act as an expert system. A student may<br />

know, in principle, that a manipulation is<br />

possible but may not have the knowledge, skill<br />

or persistence to carry it through in practice.<br />

Trigonometric identities provide good examples<br />

of this. Having met the identities for cos(2x) and<br />

cos(3x) as polynomials in cos(x), a student might<br />

perhaps know, in theory, that cos(6x) could also<br />

be expressed as a polynomial in cos(x) but be<br />

unable to complete the computation quickly or<br />

accurately. Below is a MATLAB session<br />

showing how this may be done <strong>with</strong> a SAM.<br />

» x=sym ('x');<br />

» expand (cos(2*x))<br />

ans =<br />

2*cos(x)^2-1<br />

]<br />

3


» expand (cos(3*x))<br />

ans =<br />

4*cos(x)^3-3*cos(x)<br />

» expand (cos(6*x))<br />

ans =<br />

32*cos(x)^6-48*cos(x)^4+18*cos(x)^2-1<br />

Note that MATLAB’s response is almost<br />

instantaneous.<br />

(e) SAMs make graph drawing and visualisation<br />

easier. The sophisticated graph plotting facilities<br />

of most SAMs can help to give insight into<br />

mathematical ideas through visualisation. For<br />

example the function f(x) =x(1-x) in (c) may be<br />

visualised using the command:<br />

» ezplot('x*(1-x)',0,1)<br />

The resulting plot is shown in Fig.1.<br />

0.25<br />

0.2<br />

0.15<br />

0.1<br />

0.05<br />

0<br />

x*(1-x)<br />

0 0.1 0.2 0.3 0.4 0.5<br />

x<br />

0.6 0.7 0.8 0.9 1<br />

Fig. 1: A visualisation of the function whose<br />

Fourier coefficients were obtained in (c).<br />

Three- dimensional visualizations are supported.<br />

The following example illustrates the creation of<br />

a 3-D plot of the sinc function, sin(r)/r.<br />

» [X,Y]=meshgrid(-9:.5:9);<br />

» R=sqrt(X.^2+Y.^2)+eps;<br />

» Z=sin(R)./R;<br />

» mesh(X,Y,Z)<br />

The plot is shown in Fig. 2. In this example, R is<br />

the distance from the origin, which is the centre<br />

of the matrix. Adding eps avoids the<br />

indeterminate 0/0 at the origin.<br />

4<br />

Fig 2. 3-D visualisation of the sinc function<br />

(f) SAMs encourage exploration and experiment.<br />

The many features of SAMs can be used to<br />

encourage students to be more open to<br />

mathematical exploration and experimentation.<br />

The SAM removes the drudgery of repetitive<br />

calculation, provides standard tools, eliminates<br />

much of the need for routine reference to tables<br />

and textbooks and generally makes<br />

experimentation easier, more exciting and more<br />

rewarding.<br />

(g) Lecturers can construct complex/animated<br />

visualisations and improve instruction. The<br />

sophisticated graphical features of many SAMs<br />

engender the construction of visualisations and<br />

animations, which can motivate or clarify<br />

complex mathematical ideas. For example a<br />

SAM may be used as a virtual laboratory where<br />

students perform <strong>computer</strong>-based experiments on<br />

animated mass-spring-damper systems [8]. They<br />

can then relate the results of their virtual<br />

experiments to solutions of the differential<br />

equations that model such systems.<br />

5. Some problems <strong>with</strong> use of a SAM<br />

(a) Additional time is needed to learn SAM<br />

usage. This would inevitably take time from<br />

other subjects in the curriculum. However, skill<br />

<strong>with</strong> a SAM will ultimately improve the student's<br />

efficiency in learning other material, so that part,<br />

at least, of the time spent on learning a SAM<br />

would be recovered.<br />

(b) Undermining development of manipulative<br />

skills. Just as the pocket calculator is considered<br />

to have led to the atrophy of arithmetic skills, so<br />

might SAMs probably lead to a reduction in<br />

purely manipulative <strong>algebra</strong> and calculus skills?<br />

However, once SAMS become available on<br />

affordable pocket calculators, it may be argued<br />

that this loss is unimportant. Indeed Lawson [9]<br />

argues that <strong>computer</strong> <strong>algebra</strong> ought not to be<br />

seen as a de-skilling tool but rather as a re-


skilling one that gives access to higher level<br />

skills (such as formulation and interpretation)<br />

instead of being focussed on lower level skills of<br />

manipulation and techniques.<br />

(c) Problems of remembering the SAM language.<br />

The rich vocabulary of SAM commands contains<br />

a number of possibilities. To become truly adept<br />

in a SAM language requires routine everyday<br />

use. Occasional users would quickly lose their<br />

'edge'. The following MATLAB session<br />

illustrates what can easily happen in a SAM if an<br />

occasional user attempts to combine sin(A+B)<br />

and sin(A-B). The student has an idea of the<br />

form the answer takes but wants MATLAB to<br />

confirm the correct details. Among the many<br />

related commands of MATLAB which one is<br />

correct? The approach adopted here is to try any<br />

possibility until the correct answer is obtained.<br />

Obviously this can be time consuming and<br />

frustrating for a novice or occasional user. Note<br />

that the command simple (not used here) gives<br />

even intermediate steps used in the process.<br />

» syms a b x<br />

» x=sin(a+b)+sin(a-b)<br />

x =<br />

sin(a+b)+sin(a-b)<br />

» simplify (x)<br />

ans =<br />

sin(a+b)+sin(a-b)<br />

» factor (x)<br />

ans =<br />

sin(a+b)+sin(a-b)<br />

» expand (x)<br />

ans =<br />

2*sin(a)*cos(b)<br />

(d) Course examination. Examination of a SAMbased<br />

course is a serious problem. With the everincreasing<br />

<strong>mathematics</strong> classes, it is impractical<br />

to consider the option of providing a<br />

micro<strong>computer</strong> at each exam desk. All forms of<br />

non-examination assessment (e.g. continuous<br />

assessment only) might not be acceptable,<br />

especially in a society in which traditional values<br />

of 'fair play' and honesty can no longer be taken<br />

for granted.<br />

6. Conclusion<br />

In the face of the demonstrated versatility of<br />

SAMs there is a need to change either the<br />

<strong>engineering</strong> <strong>mathematics</strong> curriculum or the<br />

approach to the curriculum in such a way as to<br />

exploit the numerous advantages they (SAMs)<br />

offer. Engineering <strong>mathematics</strong> teachers should<br />

5<br />

not only use SAMs as a tool to free students<br />

from the drudgery of routine <strong>algebra</strong>, calculus<br />

and graph drawing, but should deploy SAMs to<br />

help them (students) to understand at a deeper<br />

level, the nature and structures of <strong>mathematics</strong><br />

and to appreciate the ways SAMs can be used to<br />

model the operation of those physical and other<br />

real-world systems that are of interest to<br />

engineers and technologists.<br />

7. References<br />

1. Stern, L.A.: "Computer calculus",<br />

Science News, 1981, 119, Reprinted in<br />

SIGSAM Bull, 1981, 15, (3), pp.26-27<br />

2. Lawson, D.: "The challenge of<br />

<strong>computer</strong> <strong>algebra</strong> to <strong>engineering</strong><br />

<strong>mathematics</strong>", Engineering Science.<br />

and Education Journal, 1997, 6, (6),<br />

pp.228-232.<br />

3. Mitic, P. and Thomas, P.G.: "Pitfalls<br />

and limitations of <strong>computer</strong> <strong>algebra</strong>",<br />

Computers and Education, 1994, 22,<br />

(4), pp.355-361.<br />

4. Barozzi, G., and Clements, R. R.: "The<br />

potential use of <strong>computer</strong> <strong>algebra</strong><br />

systems in mathematical <strong>education</strong> of<br />

engineers", Int. J. Math. Educ. Sci.<br />

Tech., 1987, 18, p.681.<br />

5. Chipperfield, A.J. and Fleming, P.J.<br />

(Eds.) 'MATLAB toolboxes and<br />

applications for control', Peter<br />

Peregrinus/IEE, UK, 1993.<br />

6. Biran, A. and Breiner, M. 'MATLAB<br />

for Engineers', Addison-Wesley,<br />

Harlow, England, 1995.<br />

7. http://www.mathworks.com: MATLAB<br />

the Language for Technical Computing:<br />

Visualisation, Programming, 1998.<br />

8. Clements, R.R: "Computer <strong>algebra</strong> for<br />

engineers: the Maple alternative",<br />

Engineering Science. and Education<br />

Journal, 1997, 6, (6), pp.233-238.<br />

9. Rozsasi, R.: "The use of Mathematica<br />

programmed virtual experiment<br />

animations", in Hibberd, S. and Mustoe,<br />

L. (Eds.): 'Mathematical Education of<br />

Engineers' (IMA Publications, 1997)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!