Volume 10, Issue 1 Articles Trott's Corner New Products New Publications Calendar News Bulletins New Resources Classifieds Download This Issue Editorial Policy Staff and Contributors Submissions Subscriptions Advertising Back Issues Contact Information 
ElementsAn ObjectOriented Approach to Industrial Software Development
IntroductionModels in engineering as well as in physics, chemistry, finance, mathematics, and economics are characterized by the following two main features.
The parameters are of central importance when variations of the model are examined. For example these quantities determine bifurcations to different states of the system. By variations we mean not only numeric changes but also symbolic ones. However, modeling is a sophisticated endeavor of traversing between reality, imagination, and feasibility. It eventually converges to a mathematical description which captures the most essential aspects important for a particular purpose and, at the same time, is simple enough to be treated by formal methods. We start with an observation that every modeling process involves working with objects and its primary goal is to select features relevant to a specific problem together with relations between them. Different problems in one specific area usually involve a rather limited number of objects. The problem itself is then reflected in the relations between them. From this point of view it is natural to build a knowledge base containing descriptions of basic objects which often appear in modeling. Such a database would significantly speed up the modeling and provide a basis for rapid prototyping. It is not only a tedious and errorprone task to type in things over and over again, but, in many cases, parametrized solutions for recurring problems could be computed and stored in advance. Our primary motivation is to facilitate the modeling process in engineering by providing a transparent and easytouse knowledge base of objects. In this article we stipulate and analyze requirements on such a system and present a Mathematica package to store and retrieve information about objects. The proposed system is designed to be, in its nature, primarily static. It is not supposed to include "automatic solvers", although internal and external algorithms will be utilized to perform computation whenever this appears appropriate. Extensions of the knowledge base will always be checked by a human. The reason is that the vast majority of practical problems do not provide easy answers. Even though today's computer systems are very powerful, solutions obtained automatically still need to be postprocessed by experts. This makes it impossible to simply add them to an existing knowledge base since sooner or later its consistency would inevitably be destroyed, making it useless. Objects in ModelingWhen we analyze requirements on the design of a system for object representation, we naturally come across some principles already used for years in software engineering: objectoriented programming. It is not surprising that the same or very similar principles will govern the design here. Objectoriented programming introduced the concepts of classes and inheritance. It can be observed that solutions are often simpler when a hierarchical structure is imposed on the problems. Another aspect of objectoriented programming may be even more important. Classes and their objects are encapsulated, standalone, and wellspecified entities that behave the same way in any programthis is a key property of reusable components. This makes it possible to publish code which can be used in various settings without change. It is clear that these paradigms apply to modeling as well. A hierarchical structure is already in the nature of all mathematical and physical objects while the closeness of used entities is a prerequisite for the use of objects in different environments. These two concepts will play a primary role in the design of a modeling environment. ObjectOriented Methods in Computer AlgebraThe fact that principles of objectoriented programming are compatible with structures in scientific computing led to adopting those methods into computer algebra systems. A proper combination of these two fields yields the key to a solution of our problem. On the one hand, objectoriented design provides for encapsulation and reuse of objects. On the other hand, computer algebra offers a variety of algorithms to work with them. However, up to now there is no single system that contains these features in a wellbalanced symbiosis. We encounter either systems offering implementation of the class concept (C++, Java, SML, Aldor, and so forth), or single or multipurpose computer algebra systems providing more or less large sets of algorithms (Maple, Mathematica, GAP, and so forth). In spite of this fact, a lot of successful work has already been done using objectoriented methods in computer algebra systems. There is an extensive literature on objectoriented numerical methods [1, 2, 3, 4]. Numerical algorithms benefit from the fact that most of the data types they work on are largely supported by classical programming languages so there are quite a few choices. However, numerics do not belong to areas that would primarily benefit from objectoriented paradigms. Another approach integrates objectoriented programming languages and computer algebra in one application [5, 6, 7, 8]. However, these solutions are mostly aimed at a few specialized fields. The last option is to stay solely within a computer algebra system. For a long time, Maple lacked a proper concept for data encapsulation. It was finally included in Version 7. An example of objectoriented programming using numerical computation in Maple can be found in [9]. In spite of this, Maple's imperative nature is not well suited for the complex manipulations on data and code necessary when implementing objectoriented features. Probably the first implementation of classes in Mathematica was done by R. Maeder in [10]. Even though this code was just a proof of concept, it demonstrated the strength of the language and proved that Mathematica provides powerful means for building structures and for data encapsulation. Applications in engineering require an extensive collection of algorithms which are currently provided only by general computer algebra systems like Mathematica or Maple. In this article we present the package Elements, which provides an implementation of objectoriented features to facilitate modeling directly within Mathematica [11, 12]. The package, which is available from the authors' company [13], goes beyond Maeder's work and has proved to be well suited for the purpose of building a knowledge base of objects from which models are built. In the next section, we postulate and analyze requirements for a working environment that allows rapid development of models in engineering.


About Mathematica  Download Mathematica Player © Wolfram Media, Inc. All rights reserved. 