MATLAB, MATHCAD or MATHEMATICA as well as ... visualization and animation options. At least but not last .... of both 2 and 3D plots and animations, multiple.
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
Symbolic Computations in Science and Engineering MARCIN KAMIŃSKI Chair of Mechanics of Materials Technical University of Łódź Al. Politechniki 6, 90-924 Łódź POLAND
Abstract: - A presentation of the modern issues related to the symbolic computing is contained here with the detailed discussion of its application to the education of various scientific and engineering academic disciplines. As it is shown on the example of the MAPLE system, symbolic computational environments play the very important role in supporting the lectures and the classes in all the computer labs. Those environments may be very useful in teaching basic natural sciences in all those cases, when some algebraic or differential equations appear, must be solved and their results should be precisely discussed. The application of the MAPLE and similar computer systems in the engineering education seems to be unquestionable now and some examples are contained here to show how the professors may improve their lectures and make them very interesting and exciting. The key feature offered by the symbolic computing is the opportunity to discover the knowledge, which the students may do by themselves, when they are specifically leaded by the instructors. The future expansion of the symbolic environment is drawn here together with the very related educational aspects all we have during the classes in the computer labs. Key-Words: - symbolic computations, computer methods, computer science, computers in education (and us too) to remember correct grammar structures, for instance. So that, the complete computer preparation of the homeworks for the English or history lessons should be strictly prohibited. No one at this moment may prognose the social progress under such circumstances (the written language may be totally left for the computers as well in the nearest future). The educational aspects of the ‘computerization everywhere’ have nevertheless many positive aspects, especially for the basic natural and engineering sciences. The basic and the very clear difference to the previous blackboard methods is the opportunity to (1) present the solution of the particular problem in its final form with its overall verification, (2) compare on the same screen the solutions of the similar or even different problems, (3) study parameter sensitivity of those solutions and, especially (4) make a dynamic visualization of our problem solution. So that we, as the teachers, may pack the complicated (boring for the students) problems together with the necessary knowledge as the attractive colorful boxes, which the children and the students want to open with no delay. It was quite impossible before and must be exploited now as widely as possible. Thanks to such an educational method a large portion of the differential equations appears as a quite natural prolongation of the well-known elementary algebraic equations, where some visible and touchable (on the screen) functions give the final answer.
1 Introduction Nowadays, a role of the computer-based learning in all scientific and engineering disciplines and subjects still seems to be decisive. Those computer methods are of course very widely understood, begin with from the internet browsing and searching for some specific knowledge sources. The teachers and lecturers should focus the students not only on finding the answer for some specific problem but first of all on the reliability of the particular internet source. Considering a common practice of finding everything, which is needed to prepare the homeworks at the schools and universities on the relevant webpages, the teachers influence is practically strongly limited to a verification of those sources (without the opportunity of the effective corrections of the net source in its electronic version). The second process strictly connected to the above is an explosion of the computer software (well packed into the graphical environments). Starting from 3D games through business packages till the scientific advanced programs we can all use, modify or even build any necessary processes flows to complete most of our work to be done on (and mostly) by the computers. Therefore, a role of the modern teaching in this context may be (and really is) limited to a creation of the written or spoken manuals to the specific computer software. In this context the Latin idea that ‘repetitorum mater studiorum est’ transforms to the repeated usage of the same program or just the algorithm. Anyway it may result with no doubt in a complete disability of our children
ISSN: 1790-5109
1025
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
2 Symbolic computations world According to the internet definition, the symbolic computing is a discipline focused on the representation and a manipulation of the information in the form of a symbol, which is mainly connected with its numeric representation for further processing. The symbolic computing became so large last years that there exists in the internet the so-called SymβolicNet maintained by the Kent State University (http://www.symbolicnet.org) containing the conferences and other events, open positions, software, downloads and search engine as well as the subscritpion sub-site. The software available in the symbolic computations area obey a plenty of the commercial packages like MAPLE, MACSYMA, MATLAB, MATHCAD or MATHEMATICA as well as even freeware like the jscl-meditor (the java symbolic computing library and mathematical editor, http://jsclmeditor.sourceforge.net), MAXIMA or SCILAB (http://www.scilab.org). All the detailed considerations contained below are referenced to the system MAPLE (present version 12.0) implemented for the first time in 1981 by the Symbolic Computations Group at the University of Waterloo in Canada. The internal language of MAPLE is the interpreted language with dynamic data types, where the idea of symbolic computing is realized by the acyclic directed graphs. Nevertheless, there is no loss of a generality in discussing everything on MAPLE here and all the options recalled here do exist in the remaining systems and are easy available in the remaining systems after small semantic modifications only. Let us remind now that the genesis of all those programs is more less the same – they have been initiated at the applied mathematics and/or computer science departments of the worldwide leading universities and through those years went out outside academic area by commercialization or are still being developed by the scientists or engineers in many countries under the GPLs. Nowadays, the symbolic programs are very powerful and, besides all simple algebraic transformations and differentiation anf integration techniques, have the entire ODEs and PDEs libraries, extended statistical as well as very fantastic visualization and animation options. At least but not last it is possible to build separate window-released programs including longer sequences of symbolic operations devoted to a solution of the specific problem (the so-called maplets). Now, we have the example how to easily calculate the volume for the user-specified surface of the revolution, which is integrated with the extended graphical options. All may understand rather easily from this window-based internal application within the MAPLE system the main general concept behind this calculation (see Fig. 1).
ISSN: 1790-5109
Fig. 1. The surfaces of the revolution modeling
The programmers working with the classical now languages (like FORTRAN, for example) may incorporate their subroutines into the symbolic environment so that they can supervise the program flow, to use efficiently the interoperability options and, especially, to employ the visualization options for their even pure algebraic operations large lists. Only the few years before we all needed to know t a separate programming language typical for the symbolic environment but now it is quite not necessary, because of the icons groups as well as the very extended trees of the sub-options built into the main system window. Finally, let us note that the symbolic programs grow in parallel to the hardware, so that even more advanced problems solutions done by MAPLE do not need the very powerful computers. So that those systems may be used widely – also by the students on their notebooks during, before and/or after the lectures in a library (as the book examples verification) Considering above, the symbolic computation programs may be the very efficient educational tools implemented both in the university computer labs and at home – for the distant learning. Their extended usage is observed and grows naturally in all those subjects, where mathematical equations do appear and the reason is twofold here: (1) there exist the applications centers and the internet well-documented user’s manuals, where you can find a lot of the ready-to-use problems solved before and commented by their authors sufficiently; (2) the user does not really need to know most of the mathematical methods leading to his particular solution. This user
1026
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
group of the hybrid analytical-numerical methods including initially symbolic algebra may become in the future the largest class on the market including most of the computational software. The mathematics hidden under the icons is indeed very dangerous educational direction since our students become totally computer-dependent mathematicians and without the aid of a machine they can do nothing of course. A paradox of this phenomenon is that the symbolic programs first reduced maths to the commands and then, the symbolic programmers implemented the windows-based applications builders to create the educational applications demonstrating various mathematical methods and its analytical tricks. The maplet for the integration by parts is visible below – see Fig. 3; a pure application of the symbolic integration procedure does not demand of course any knowledge about all the methods available. Then, the students taught this operation without any methodological background lecture (just ‘int’ option) may think (and they really do so) that this procedure is so easy that this is the real ‘piece of cake’ and there is no need to deals with it longer than a minute.
needs to use the proper command (or the commands sequence in a worse scenario), sometimes even the application name and then just click simply the ENTER button or the additional icon. The exponential growth of the users may be explained taking into account a qualitative progress of the numerical methods in the applied sciences. It is widely known, that almost the few years ago the methods available were traditionally divided into analytical and numerical approaches, where the last group was adequate to discrete algorithms rather like the finite differences, finite or boundary elements than the explicit solution of some ODEs system made without any discretization (just for the equations transformed to the editor as they appear on the paper sheet). You can see the exemplary results below – for the Van der Pol oscillator – the user see the equation mathematical form and has some windows to modify the coefficients and redisplay the final solution (Fig. 3).
Fig. 2. The surfaces of the revolution modeling
Today we can conclude that all analytical methods have been eaten by the symbolic environments, so that for simpler problems no one wants to engage quite separate discretization and the computer program when the solution and visualization is easy here (and may be at once slightly modified to check the parameter sensitivity of an answer). On the other hand, the academic software for the scientific computations written in lower level languages may be easily incorporated here into the exciting graphical platform, so that we theoretically can have everything in a single computer program realized according to our philosophy. Since the leading computer software companies systematically develop their systems autonomously, our ‘ugly’ computational routines written long ago may get a year after year the new packaging and the interaction options automatically. The small
ISSN: 1790-5109
Fig. 3. The result of an integration by parts in MAPLE
1027
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
The main role of the symbolic programs is to enable the students to discover the knowledge in an easier and decisively more attractive way than before. The very important tools are (1) a programming language very close to the natural English (some other versions like German, French or Japanese also available), (2) the very extended and interactive ‘Help’ reacting for the words similar to some internal procedures with a large variety of the ready-to-use examples for copy-paste usage, (3) graphical environment – the use may change the domain of both 2 and 3D plots and animations, multiple functions or parametric families may be plotted for the same intervals of the independent variables. Therefore, the students may distinguish between different mathematical models for the same phenomenon or the same mathematical model but with slightly modified parameters. However, the key feature of the symbolic programs lies undoubtedly in the multilevel structure of mathematical operations, the solution verification and dynamical definition of the types and names. It is visible at most for the differential equations and their systems, which are commonly used in some basic sciences as well as almost the entire engineering. They are at the same time too complicated to be remembered even by better students. An application of the MAPLE to the vibrating mechanical system is shown here, where the solution is rather easy and the well-known (Fig. 4 below with the amplitudes given parametrically in Fig. 5). The parameters of this system defined as follows: m[M]=1000kg, m[U]=500kg, d=100000[N/m], whereas the basic solution of the differential equation itself reduces to the following three lines:
Fig. 5. Parametric display of the amplitudes for the vibrating system
An application of the symbolic packages to teach how to solve the differential equations automatically gives the students opportunity to appreciate the role of the boundary and/or initial conditions on the overall solution. The computer with its symbolic software takes momentarily a role of the teacher saying by error commands, what is correct and what is wrong and whether the sequence of commands is well-structured or not. Since a huge number of such equations to be taught within a traditional course of mechanical engineering, the application of symbolic computing enables for sure (1) deeper understanding of various mechanical and physical phenomena, (2) better study of influence of all parameters on the structural response, (3) notification of the similarities between different phenomena described by the same differential equations and (4) recognition of the system properties from its response visualization. The symbolic computing programs give the brand new opportunity for our students – an opportunity to discover the new facts and the research findings they cannot find at a single or even at none book. Using mathematical definitions of some quantities and some symbolic operations they can derive (with the teacher aid) some more advanced properties of these quantities or the properties of their functions (like products, the powers or so). It needs essentially more mathematical background and intuition but an opportunity to discover something new is the very exciting by itself, so that the educational process is done by the way only (by the way for the students of course). The aspect of a time spent on the education is also very important here – having such a computational tool there is no need to (1) derive slowly and systematically anything on the blackboard, (2) recommend the students the additional books in the libraries, (3) prepare the new and extend the existing
Fig. 4. The mechanical vibrating system
ISSN: 1790-5109
1028
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
E[k ] , E[ ρc] and Var (k ) , Var (ρc ) ,
presentations, which may be decisive considering the still increasing number of the lecturing and contacting hours with the students everywhere. Finally, let us note that the MAPLE and related systems offer today the opportunity to prepare the entire lectures and even books into them. We may use to this purpose the automatic renumbering of the equations appearing into the text as well as automatic saving in the *.html format (some examples can be downloaded from the applications centers – http://www.maplesoft.com). There is also the huge library of the mathematical symbols, Greek letters as well as the other graphical tools to prepare the excellent presentation.
which completes the probabilistic description of physical properties of the composite constituents. We will provide a symbolic solution to this problem in the form of the expected values and standard deviations of temperature field for this heated structure. To this purpose the Taylor expansion technique with random parameters will be used. Therefore, let us denote the corresponding random vector of the problem by b( x ) , with probability density functions p(b). Therefore, mth order central probabilistic moment is given by +∞
3 Some research worksheet As the research example for the symbolic computations we use the transient heat flow problem governed by the following ordinary second order differential Fourier equation:
∂ ∂T k − g = 0; ∂x ∂x x ∈ Ω; τ ∈ [0, ∞) , .
ρcT −
(1)
where c=c(T) is the heat capacity characterizing some domain Ω, ρ=ρ(T) is the density of the material contained in Ω, k=k(T) is the thermal conductivity tensor, while g=g(T) is the rate of heat generated per unit volume. Variables T and τ denote temperature field values and time, respectively. This equation should fulfil the boundary conditions of the ∂Ω being a continuous and sufficiently smooth contour bounding the Ω region. The boundary conditions discussed for eqn (1) are as follows: 1) temperature (essential) boundary conditions
T = T$ ; x ∈∂Ω T ,
(2)
− E[b r ]) p(b)db m
r
(6)
−∞
The basic idea of the stochastic perturbation approach follows the classical perturbation expansion idea and is based on approximation of all input variables and the state functions of the problem via truncated Taylor series about their spatial expectations in terms of a parameter ε>0. For example, in the case of random heat conductivity, the nth order truncated expansion may be written as
1 k = e 0 + εk ,b ∆b + ε 2 k ,bb ∆b∆b 2 n 1 ∂ k n + ... + ε n n (∆b ) n! ∂b
(7)
where
ε∆b = ε (b − b 0 )
(8)
2
(9)
(3) is the second variation of b about its expected value, where nth order variation can be expressed accordingly. In this case, temperature may be expanded as
3) initial conditions (4)
Let us suppose that heat conductivity and volumetric heat capacity are uncorrelated Gaussian random fields defined uniquely by their two probabilistic moments as follows:
ISSN: 1790-5109
∫ (b
ε 2 ∆b∆b = ε 2 (b − b 0 )
where ∂Ω T ∪ ∂Ω q = ∂Ω and ∂Ω T ∩ ∂Ω q = {∅} .
T 0 = T( x i ;0) ; x i ∈Ω , τ = 0 .
µ m (b) =
is the first variation of b about its expected value and similarly
and for ∂Ωq part of the total ∂Ω: 2) heat flux (natural) boundary conditions
∂T = q$ ; x ∈∂Ω q , ∂n
(5)
1029
1 2 T = T 0 + εT ,b ∆b + ε 2T ,bb (∆b ) 2 n 1 ∂ T n + ... + ε n n (∆b ) n! ∂b
(10)
Traditionally, the stochastic perturbation approach to all the physical problems is entered by the respective
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
perturbed equations of the 0th, 1st and successively higher orders being a modification of the variational integral formulation. Hence, there holds (1) one zeroth-order partial differential equation 0 0 0 .0 ∂T 0 ∂T dΩ + ρ δ δ c T T k ∫Ω ∂x ∂x , = ∫ qˆ 0 δT d (∂Ω ) + ∫ g 0δT dΩ
∂Ω q
(11)
1 x2 x x 2 κt 2 T ( x, t ) = exp − − 2 erfc 2 κt , k π t 4 κ 2 k in where κ = and which is further used for = 1 .0 ρc sec
Ω
(2) nth order higher order partial differential equation
n n p p p =0 p m =0 m
( p ) ( p−m) (n− p) ∫ δT ∑ ∑ ρ c T& dΩ
Ω
+ ∫δ Ω
∂T ∂x
n ( p ) ∂T k ∑ ∂x p =0 p
(n− p)
n
= ∫ δT ( g ) dΩ + ( n)
Ω
∫ δT (qˆ ) ∂
(n)
same symbolic computations package. The computational part is provided using the transient heat conduction in a semi-infinite solid subjected to a unit surface heat flux and physical properties of this semi-infinite solid are adopted as follows: E[k]=1.0 BTU/(sec in °F), E[ρc]=1.0 BTU/(in3 °F). The deterministic result is also available thanks to the MAPLE computations following the considerations provided in [1]
the probabilistic modeling. Thanks to the application of the symbolic computations package it is possible to visualize the solution (Fig. 6) with respect to the spatial and temporal coordinates at the same time, which is obtained with no delay time. It is possible to make an animation showing dynamical temperature changes within the heated rod.
(12)
dΩ d (∂Ω )
Ωq
Having solved those equations for T 0 and their higher orders respectively, we derive the expressions for the expected values and the other moments of the temperature field. In order to calculate the expected values and higher order probabilistic moments of temperature T (b; t ) , the same Taylor expansion is employed to the definitions of probabilistic moments
E [T (t , b) ; b] =
+∞
∫ f (T ) p(b)db =
(13)
−∞ +∞
∫ T
0
+ εT ,b ∆b + ... +
−∞
1 n ,n ε T (∆b )n p(b)db n!
There holds for such variables with standard deviations equal to σ
µ 2 k +1 (b) = 0, µ 2 k (b) = (2k − 1)!σ (h) ; 2k
(14)
k≤m Using this extension of the random output, a desired efficiency of the expected values can be achieved by the appropriate choice of m and ε corresponding to the input probability density function (PDF) type, probabilistic moment interrelations, acceptable error of the computations, etc.; this choice can be made by comparative studies with Monte-Carlo simulations or theoretical results obtained by direct (i.e. symbolic) integration. This comparison may be also done using the
ISSN: 1790-5109
1030
Fig. 6. Temperature distribution along the heated rod in time
As it is clear from those figures, the expected values during the entire heating process are larger than the corresponding deterministic values; the coefficients of variation of the temperature are equal more less 0.1, which can be recovered dividing the results from Figs. 7 and 8, respectively. This study after small modifications may be directly useful in the reliability studies of such structures and for all those cases, where the solution of the relevant state differential equation may be symbolically obtained. A plenty of other symbolic computations applications in homogenization, strength, plasticity, fracture and fatigue of composite materials may be found in [2].
ISBN: 978-960-6766-85-5
12th WSEAS International Conference on COMPUTERS, Heraklion, Greece, July 23-25, 2008
4 Final remarks As it was discussed and presented here, the symbolic computing programs give a good, reliable and modern alternative to the traditional methods for many courser provided at the high schools and universities. Successfully for the teachers and lecturers they still evolve to enlarge an educational impact on the students and to fasten the computational part of a given problem solution. Let us remind finally, that the design process realized using symbolic mathematics and computing, which is integral and decisive part of the engineers jobs and education does not belong to the ‘multi-lives games’ class. Let us repeat that the single life (without the repeated states eligibility) is a fundamental concept of the structural and systems reliability. The reality mixes mentally with the virtual reality of the games for those young people, who extensively play those games and they prolong this philosophy to the other domains of computational activity (and not only). Therefore, for educational reasons, such games should be entirely prohibited within all schools computer labs and the teachers should explain their students the bad influence of such rules in the real problems solutions, even if they are related to the computer programs.
Fig. 7. Expected values of temperatures in the heated rod
References: [1] H.S. Carlsaw, J.C. Jaeger, Conduction of Heat in Solids, Oxford Univ. Press, London, 1959. [2] M. Kamiński, Computational Mechanics of Composite Materials, Springer-Verlag, London-New York, 2005. [3] M. Kamiński, Generalized perturbation-based stochastic finite element method in elastostatics. Computers and Structures, Vol. 85, No. 10, 2007, pp.586-594.
Fig. 8. Standard deviations of temperatures in the heated rod
ISSN: 1790-5109
1031
ISBN: 978-960-6766-85-5