On a knowledge-based system for dimensional analysis

On a knowledge-based system for dimensional analysis

On a knowledge-based system for dimensional analysis M a d a n V e n u g o p a l and Steven H. Kim Laboratory for Manufacturing and Productivity, Mass...

751KB Sizes 0 Downloads 5 Views

On a knowledge-based system for dimensional analysis M a d a n V e n u g o p a l and Steven H. Kim Laboratory for Manufacturing and Productivity, Massachusetts institute of Technology, 77 Massachusetts Ave., Cambridge, MA 02139, USA

ABSTRACT Knowledge-based systems to date, whether in engineering or other fields, have tended to incorporate facts, heuristics and algorithms specific to narrow domains of application. As a result, these systems are fragile; they fail catastrophically when the underlying assumptions are violated or they are applied to unforeseen circumstances. A robust system, on the other hand, should encode deep knowledge relating to first principles and general techniques for reasoning about the entire field of application. A general-purpose engineering assistant should encode models of the domain as well as reasoning techniques that apply to diverse arenas of technology. This paper takes a step in the direction of generalized engineering tools by examining how techniques for dimensional analysis may be encoded in software. The goal of the current work is the development of a prototype system to demonstrate the feasibility and utility of such an approach. I N T R O D U C T I O N AND M O T I V A T I O N Intelligent systems that can solve engineering problems are rare, even in the current environment of significant research and advances in Artificial Intelligence and its application to a variety of fields. Currently, the problem formulation is still largely performed by the engineer, with the computer used as a tool to execute the numerical computations. It is desirable to impart some of the engineer's problem-solving ability to the computer. However, this task is nontrivial due to the extreme complexity of most engineering disciplines. Clear theoretical formulations of the behaviour of most physical systems do not yet exist, or are computationally expensive to describe. Traditionally, the pragmatic engineer's approach has been to 0952-1976/90/020110-0852.00 © 1990 Pineridge Press Ltd

110

Eng. Appli. of AI, 1990, Vol. 3, June

use heuristics to solve engineering problems where theory fails. However, due to significant investment in research, engineering analysis today involves a judicious combination of heuristics and algorithms. The relative importance of either type of knowledge depends on the particular field in which the engineering problem falls and the complexity of the problem as well as the effort the engineer can afford to invest. Adopting Simon's terminology 1, engineering problem solving is a 'satisficing' process in which the engineer adopts a certain approach by trading off the effort expended versus the acceptability of the solution. If one accepts the above view of engineering problem-solving, it becomes apparent that systems which solve engineering problems should also have the ability to combine heuristics and numerical computation. This integration is critical for the successful automation of engineering analysis. One of the earliest and most successful AI programs was Moses '2 SIN, which later evolved into MACSYMA; the software encodes mathematical knowledge and can solve sophisticated integral calculus problems. MACSYMA is currently used in many engineering and scientific applications. Another early AI program in engineering problemsolving was SACON, an expert system to serve as a front-end to a complex structural analysis program. This program was less successful than MACSYMA because the end-user of the system was poorly defined. Abelson et al. 3 describe a system to automate the analysis of a complex engineering problem. The system seeks to mathematically model and solve a physical problem in much the same way an engineer would. This approach to engineering problem-solving is still in its infancy, but holds promise. Forbus 4 gives an excellent perspective on the history and future of intelligent computer-aided engineering. An engineer modelling a physical problem usually constructs a mathematical model of the system by drawing upon a library of models of similar physical systems. As an example, the governing equations for fluid flow are the Navier-Stokes equations with the appropriate boundary conditions. There are similar models in solid mechanics, vibrations, etc. There is little doubt about the validity of the fundamental mathematical models. They have evolved over many years by comparing the simulated behaviour of the models against actual physical systems. However, often the postulated models become extremely complicated to solve in their general form. The satisficing solution in such

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim Physical

~

Problem

Mhlm l meit~-D~ al Sirn~l¢ Model

Figure I

- LA~dys. J Model

Stagesin solvinga physicalproblem

cases is either to solve a simplified mathematical model or to perform experiments covering certain ranges of some of the important physical parameters. The reasoning behind this simplification is often based on a critical set of parameters called the 'non-dimensional' parameters of the system (Figure 1). The theory behind this reasoning, called dimensional analysis, is discussed by Sedov 5 and Birkhoff6. As with human engineers, intelligent systems that solve novel engineering problems will need facilities for dimensional analysis and reasoning based on non-dimensional parameters. For example, if one is attempting to model the drag force on a car, one needs to know the minimum number of parameters affecting the drag force. Given the physical parameters of the problem, these can be determined using dimensional analysis. The actual drag force on the car can then be determined by conducting experiments over ranges of interest of the non-dimensional parameters. We describe a simple system which can derive the set of non-dimensional parameters for a given problem and perform limited reasoning based on actual values of these parameters. Our goal was to build a prototype system that would demonstrate the feasibility and utility of a software assistant for dimensional analysis. The system is called DIAN (Dimensional ANalyst). The system is partly algorithmic and partly heuristic. The procedural part deals with the actual symbolic derivation of the non-dimensional parameters and numerical computation of their values, while the inferences based on these values rely on experiential or empirical information and hence are best represented as a rule-based system with an extendable knowledge base. If this system is to be general enough to cover all physical systems, the knowledge base must be very large and complex. However, this is not a difficulty limited to computers, as some critics of such systems claim. The problems such systems attempt to solve are genuinely complex, and even humans require a large amount of specialized knowledge gained through experience or study. One way to keep the programming task to a tractable size is to restrict the domain of expertise

of the system. For the purposes of this project, the domain chosen is the interaction of incompressible fluids with inelastic solids; even in this restricted domain there is no claim to completeness. The approach used here, dimensional analysis, is of significance for design automation. It succeeds in capturing some general-purpose knowledge that engineers employ in problem-solving. BACKGROUND ON DIMENSIONAL ANALYSIS The theory behind the derivation of non-dimensional parameters for a physical system has been presented by Birkhoff6. Dimensional analysis rests on a set of four postulates and a result known as Buckingham's Pi theorem. The formal statement of the postulates and the theorem are given in Appendix 1. Simply stated, the theorem states the following: If there exists a functional relationship among n dimensional quantities, it is equivalent to a (different) functional relationship between n - m non-dimensional quantities, where m is the number of fundamental units for the problem. In mechanics, m is usually 3--corresponding to the fundamental units of mass, length and time. Thus, these non-dimensional parameters correspond to the minimum set of parameters required to describe the problem. They are derived by nondimensionalizing the non-fundamental quantities using the fundamental quantities. They are of practical significance in constructing simplified mathematical models or in performing experiments over specific ranges of their values to establish the functional dependence among them. An important point about dimensional analysis is that the theory provides no indication as to which physical parameters are most relevant for a given problem, nor does it indicate whether the chosen set is complete. The selection of dimensional quantities for a physical problem is made by the engineer, based on his experience with problems of a similar nature or informed guesswork. (This limitation suggests the utility of an expert system to select the dimensional quantities for restricted domains. However, this task has been postponed as part of a larger project.) Another important point about dimensional analysis is that the dimensionless parameters derived using the theory are not unique. A set of the dimensionless parameters scaled by one of the members of the set raised to an arbitrary power, or Eng. Appli. of AI, 1990, Vol. 3, June

111

On a knowledge-based system for dimensional analysis." M. Venugopal and S. H. Kim

additive combinations of members of the set, are all equally valid sets. This is a nontrivial issue. For now, we circumvent the problem by restricting our attention to directly derivable dimensionless parameters by the above method. It appears that the only feasible approach for a more complete system is to have available a repertoire of potential solutions-for example, in the case of boundary layer theory, the relevant non-dimensional length normal to a boundary is scaled by the square root of the Reynolds number (another non-dimensional parameter). D E S C R I P T I O N O F T H E SYSTEM The system consists of a domain-independent module and a domain-dependent module. The domainindependent module comprises the procedural aspects of computing the symbolic and numerical values of the non-dimensional parameters, as well as input and output procedures. While this is not conceptually difficult, it is tedious to implement. The domain-dependent module is more challenging conceptually. Figure 2 shows the basic structure of DIAN. Dian is the top-level driver. It invokes the four main

modules initial&e, input, compute_Pi and cycle. These modules are discussed below.

initialize: This module displays the welcome banner and reads in the auxiliary program and data files. The welcome module offers a help utility to assist the user. input: The input required is in the form of two lists. The first is the list of dimensional quantities to be non-dimensionalized, and the second is the list of fundamental quantities to use in the nondimensionalization. Each element of either list is itself a list with the first element being a symbol and the second element being a dimension. The symbol must be a combination of lower-case characters and the dimension must match one of the dimensions existing in the database. The list of dimensions is displayed along with the input prompt. The list of fundamental quantities must have three elements, and they should represent an independent combination of the dimensions of mass, length and time. The input module accesses a database of units and attaches the units in the foot-pound-second (FPS) system to each element of the input list. These are used later in the formulation of the non-dimensional variables.

I DIAN ) I

I

I

[co

I input

~nitialize 1 I

I

)

1

Icyc Io ) !

'

tPij.,u.

DOMAIN INDEPENDENT MODU,E

I

LNrS

L

J

Figure 2

DIAN program structure

DOMAIN D PENDENT .ODU'E

112

Eng. Appli. of AI, 1990, Vol. 3, June

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim

compute_Pi: This module computes the list of symbolic non-dimensional parameters corresponding to the input list of dimensional parameters based on Buckingham's Pi theorem and the associated calculus as discussed in the earlier section and Appendix 1. This involves the solution of a linear system of three equations. The solution gives the exponents of the fundamental units to nondimensionalize the dimensional parameters. The symbolic parameters are then algebraically reduced and simplified. The list of non-dimensional parameters is compared with a library of known non-dimensional parameters and its name is assigned to each non-dimensional parameter. If the non-dimensional parameter is not known, the name is designated to be the same as the symbol itself. The computed non-dimensional parameters are displayed on the screen. cycle." This module consists of four sub-modules. The basic function of the main module is to display the list of non-dimensional parameters and prompt the user for input of values of the dimensional parameters. These are then used to compute numerical values of the non-dimensional parameters. The values are used to draw inferences regarding the physical problem of interest, drawing upon a knowledge base containing information in the domain of incompressible-fluid/elastic-solid interaction. These inferences are displayed, and then the user is asked whether he wants to input a new set of values for the dimensional parameters. If the answer is yes, cycle is called again. If the answer is no, the program terminates. The domain-dependent part consists of three blocks--a knowledge base of units, a knowledge base of common dimensionless parameters and a knowledge base of the implications of values of the non-dimensional parameters. For the present, the units have been restricted to the British (FPS) system, and the dimensionless parameters are a restricted subset of the ones used in the study of inelastic-solid/incompressible-fluid interaction problems. ISSUES IN K N O W L E D G E REPRESENTATION A critical decision in the design of such systems is the choice of the appropriate language for representation. Often the choice is guided by the familiarity and availability of the language or

environment. Tyugu 7 discusses a system called UTOPIST which is a frame-based language for building expert systems to represent high-school mathematics and science knowledge. However, building such a language is quite complicated. The task involves symbolic and numerical computation and higher-level knowledge representation. Ruling out the possibility of designing a new language that has both high- and low-level language capabilities and sufficiently rich data structures, the options are to use either a higher-level language like Prolog or Scheme, or a lower-level language like C or Fortran. For most projects, including our own, the latter strategy would result in a large system to achieve the same task. Between Prolog and Scheme (or Common Lisp) the choice is more subtle. Both of them are efficient for solving problems involving symbolic representations and numerical computation (though neither is ideal for number-crunching). Both of them have the capability of allowing construction of general data structures. Prolog has two features which make it more attractive for this problem-pattern directed procedure calling and representation directly in the form of rules with a built-in backward-chaining depth-first search strategy. A negative aspect is that the use of Prolog makes the procedural predicates look clumsy and contrived. But, in the context of the present problem, Prolog does the best job under the imposed constraints. The system is coded in C-Prolog which uses the Edinburgh syntax (cf. Clocksin and Mellish 2, Kim 9, Sterling and Shapiro 1°, etc.). The basic data structure used is the list. More complex data structures and their handling utilities were developed as needed. Lists were chosen in preference to a more specialized data structure like the frame because the information to be represented for each dimensional quantity was small and lists are simpler to handle than frames. Of the above modules in the system description, the most challenging to define were the domain dependent modules. The system needs to know the physical parameters of importance to the problem. Conceivably, one could have a system where this information is known to the system from the problem domain. But this would require the system to possess a tremendous amount of information about the 'world' even in restricted domains. Hence, for the present this is considered given. The next problem is to derive the fundamental parameters from among those proposed. Even for a knowledgeable engineer this sometimes poses Eng. Appli. of AI, 1990, Vol. 3, June 113

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim

problems when there is a duplication of parameters of the same type. The selection is then based on more details of the problem. Currently, this is assumed to be given, but a system which can make this choice intelligently--at least for restricted domains--is being considered. The system needs to assign some units to the dimensional parameters input to perform the symbolic algebra in computing the dimensionless parameters and their values. This is achieved by providing a knowledge base of FPS units for a restricted class of physical parameters such as length, density, viscosity, etc. This could be easily generalized to a larger set in different systems of units. Given this information, computing the dimensionless parameters is straightforward, though tedious. DIAN accomplishes this using the domainindependent modules. Once the non-dimensional parameters have been computed, they have to be identified with the commonly used dimensionless parameters. DIAN uses its knowledge base of dimensionless parameters, which is a subset of the ones in common use, to perform the identification. Defining this knowledge base exhaustively even for restricted domains is difficult because of the problem of scaling associated with dimensionless parameters. For example, a square or multiple of a dimensionless parameter is still the same dimensionless parameter in some sense. This difficulty was circumvented by explicitly defining some known forms of the various dimensional parameters. Finally, DIAN uses given values of the dimensional parameters to compute values of the dimensionless parameters and draw inferences about the problem. The system uses a knowledge base of inferences based on values of the known dimensionless parameters. This knowledge base is heavily domain dependent; for our prototype system, the domain of fluid-structure interactions was chosen.

2 shows a listing of the interaction. DIAN concludes that the relevant non-dimensional parameters are a force coefficient and the Reynolds number. Further, for appropriate input values of the dimensions, relevant conclusions regarding the problem are also displayed. Dimensional analysis cannot provide us with any more information regarding the problem. We can conduct a series of experiments for an interesting range of the non-dimensional parameters and establish a functional relationship among the dimensionless parameters. Another use of the results lies in the appropriate simplification of the governing equations of the problems. In this case, the governing equations are the Navier-Stokes equations and the continuity equation. Given the appropriate boundary conditions, the continuity relation must be solved for the pressure on the body surface and hence the force on it. Based on the value of the Reynolds number, DIAN suggests the appropriate model for the problem. This is a rather simple illustration of the use of this approach. DIAN's ability can be greatly enhanced by providing the system with more knowledge about the domain, as well as appropriate interfaces to other modules that can represent the mathematical models symbolically and solve them either numerically or symbolically. LIMITATIONS AND DISCUSSION The system as implemented has several limitations in addition to those mentioned in the previous sections. The system is unable to derive the fundamental dimensions, but rather requires that they be supplied as input. This limitation can readily be overcome with more domain knowledge and programming effort.

I<

!

v

AN ILLUSTRATIVE EXAMPLE As an example we consider the physical problem of a typical shape of a car of length d, moving with a velocity v in an unbounded fluid of density p and kinematic viscosity/~. We are interested in the drag force on the sphere f as shown in Figure 3. Choosing the fundamental units for the problem as the velocity, the density and the diameter of the sphere DIAN is invoked and the input supplied. Appendix

114

Eng. Appli. of AI, 1990, Vol. 3, June

¥

Dimensional parameters f, v, d, p, P. Dimensionless parameters

cf

= ,/p d'~;

Cf,

Rn

Rn =p v •

Figure 3 A body moving in an unbounded fluid

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim

Currently, the domain is limited. It would be useful to have a broader domain and a larger range of dimensions that the system recognizes. Further, it would be useful for the system to have a limited natural language ability to understand the various dimensions rather than require that they be spelled in exactly the same way as the system does. DIAN requires numerical values to be input in the FPS system. It would be useful for the system to be able to recognize different types of units and convert between these to a consistent system which is user-specified. Notwithstanding these limitations, the system has succeeded in illustrating the use of a dimensional analysis in automated engineering problem-solving. The approach has a firm mathematical foundation, and, at the same time, the conclusions are finally based on experiential information coded in the form of if-then rules. This is typical of the satisficing approach used by engineers. One of the limitations of Prolog is the inability to declare prefix operators with multiple arguments. This imposes a constraint in defining the symbolic and numerical manipulations. In general, the mathematical operations within Prolog are not efficient. The solution of the linear system of equations is quite clumsy. An industrial-grade software package should have modules written in languages such as Fortran or C for the numerical operations. DIAN can be viewed as a compiler for the nondimensional variables, as stated earlier. A limitation with the current symbolic representation of the non-dimensional variables is the need to use several rules to identify one non-dimensional variable such as the Reynolds number. This is because a nondimensional variable is viewed as a one-dimensional parameter normalized using three others. There is also the problem of identifying different functions (such as a square or reciprocal) of a non-dimensional variable. The method adopted here is to be explicit about all incarnations of the non-dimensional variable. This approach works, but is clumsy. A more appropriate representation is being considered for an extension of this work. The system as it stands has no explanation facility: it cannot explain why it arrived at a certain inference. Although the system also has no knowledge acquisition module, any of the rule bases can be readily expanded by adding similar sets of rules to the existing ones. The procedural part of the code is implemented rather rigidly, so modification or expansion of this

part can be performed only by someone who has a clear understanding of the function of the code. However, the declarative rule bases can be expanded easily as indicated earlier. At present the system response time is a few seconds. This could be improved significantly in a future version by paying more attention to computational efficiency. FUTURE DIRECTIONS It remains to remove the limitations of the system as pointed out above. Further, in order to prove that this approach can be successful and merits consideration, a system that can perform a fully automated analysis of an engineering problem should be built. DIAN as described above would be just one component of such a system. The system would, of necessity, have the ability to combine symbolic and numerical computation and declarative knowledge representation. To keep the development effort tractable, the domain may have to be very narrow and specialized. However, even as it stands, it would be quite useful if the system were able to derive the fundamental units directly and not have them provided as input to the program. This capability is not so straightforward to implement. Development of DIAN has brought to light several important points regarding reasoning about engineering problems. It illustrates the difficulties in implementing the most basic of reasoning tools that an engineer employs in analysis. A mixture of symbolic and numerical computing and heuristic knowledge representation, even for a small problem, becomes a challenging goal. Ideally, the system should be able to determine the physical quantities of interest once the physical problem is described. At this stage the system does not know which dimensional parameters are relevant for a given physical problem. This is a harder problem and requires that the system possess considerable information. Work in qualitative physics 4 should help in this regard. The above suggestions relate to input techniques. Another possible extension is in terms of the output. The output in a fully automated analysis system could be the appropriately reduced and simplified governing equations that could be fed directly to a symbolic equation-solver such as MACSYMA, or could be used to set up a numerical solution program using finite differences, finite elements or spectral elements as appropriate. The capabilities Eng. Appli. of AI, 1990, Vol. 3, June

115

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim

represented in DIAN appear to be essential in any case for a system to perform automated reasoning for engineering problems. REFERENCES

Dimensional analysis therefore deals with unit-free functional relations.

THEOREM 1. Any unit-free relation which involves r fundamental units is also equivalent to Qo=CQ~,. . .Q~r

1 Simon, H. A. Sciences of the Artificial. The MIT Press, Cambridge, MA (1960) 2 Moses, J. Symbolic integration. Ph.D. Thesis, MIT (1967) 3 Abelson, H. and Sussman, G. J. The dynamicist's workbench: 1. Automatic preparation of numerical experiments. AI Laboratory Memo 955, MIT (May 1987) 4 Forbus, K. Intelligent computer aided engineering. A1 Ma#azme, 9 (3), 23-36 (Fall 1988) 5 Sedov, L. I. Similarity and Dimensional Methods in Mechanics. Academic Press, New York (1959) 6 Birkhoff, G. Hydrodynamics: A Study in Logic, Fact and Similitude. Princeton University Press, Princeton (1960) 7 Tyugu, E. Knowledge-Based Programmino. Addison-Wesley, Reading, MA (1988) 8 Clocksin, W. F. and Mellish, C. S. Proorammin9 in Prolog. Springer-Verlag, New York (1987) 9 Kim, S. H. Logical Minds: Software Development Throuoh Prolog. Freeman, New York (1990) 10 Sterling, L. and Shapiro, E. Y. The Art of Prolog. The MIT Press, Cambridge, MA (1986)

(4)

where C = f ( 1 , 1. . . . . 1) and the xi are determined by

boi=blixl + . . . +b,ix,,

i=1 .... ,r

(5)

with the bj~ being the exponents in (2).

THEOREM 2 (Buckingham's Pi Theorem). A functional relationship among the r dimensional variables Q~ of the form,

f(Qx . . . . , Q,)=0

(6)

is equivalent to a functional relationship among (r-m) dimensionless variables H~ as follows: f(n,

....

, H,_m)=O.

(7)

Here each I-I~is a product of the Qi which takes the following form: A P P E N D I X 1. F U N D A M E N T A L S OF D I M E N S I O N A L ANALYSIS Postulates 1. There are certain fundamental quantities qi such that, for any positive real numbers ai we can change units independently according to the formula

Ta(qi)=aiql,

i = l . . . . ,n;

ai>0.

(1)

In mechanics n = 3 and the qi are length, time and mass. 2. There are derived quantities Qj such as density and velocity which are dimensionally homogeneous in the sense that they can be converted by multiplying them by a suitable conversion factor given by Ta(Qj) = a~J'.. .ab,~"Qj.

(2)

The exponents bjk a r e called the 'dimensions' of Qj in the given fundamental units. If they are all zero then Qj is called 'dimensionless' or 'non-dimensional'. 3. There is a functional relationship of the form

Qo =f(Q~ . . . . . Q,)

(3)

where f is a single valued function. 4. The relation (3) is independent of the choice of fundamental units. 116

Eng. Appli. of AI, 1990, Vol. 3, June

n , - Q ,¢1 g~ ...g;r --

C2

where each of the Cj may be 1, 0 or any other real number. The above theorem is valid if the Q~ transform by the relation (2) for all changes in the fundamental units qj. The above postulates, theorems and their proofs are discussed in Birkhoff6. A P P E N D I X 2. SAMPLE INTERACTION This appendix presents a sample interaction for the example given in the text. The interaction is given in descriptive form, the substance of which corresponds to the actual output from the computer. In the interaction below, U stands for the User and C for the Computer. C: Welcom to DIAN. Do you want help? U: No. C: Please input the list of non-fundamental parameters of the problem. Each variable should be specified as a symbol and a dimension. U: [[f, force],[~t,dynamic_viscosity]]. C: Please input the list of fundamental parameters in the above problem. The fundamental variables must be some independent combination of mass, length and time. U: [[d,length],[v,velocity],[r,density]].

On a knowledge-based system for dimensional analysis: M. Venugopal and S. H. Kim

C: There are 2 non-dimensional parameters for your problem and they are 1) The Reynolds Number, r*v*d/l.t 2) A drag coefficient, f/(r*v*v*d*d). C: Would you like to see how values of the dimensional parameters affect the physical problem? U: Yes. C: Please enter typical values for the following parameter(s): force (lbf). U: 10. C: dynamic viscosity (slugs/ft/sec). U: 0.0000001. C: length (ft). U: 1. C: velocity (ft/sec). U: 5. C: density (slugs/ft ^ 3). U:2. C: The dimensionless parameters have the following values: Force Coefficient = 0.2

Reynolds N u m b e r = 10 ^ 8. The value of the Reynolds Number implies that the flow over the body is turbulent. The inertia forces dominate the viscous forces. The flow in the far field can be modelled by an ideal fluid model, if the separation point and the shape of the wake are known. If the characteristics of the turbulent flow are to be examined, a suitable turbulence model must be incorporated in the Navier-Stokes equations. The value of the force coefficient depends on the force being measured; for example, lift and drag forces. The magnitude indicates a ratio of the force to the inertial forces. The variation of this value with the other non-dimensional parameters of the problem is usually best determined experimentally or numerically, except for very simple shapes when analytical solutions are possible. You may supply other values of the dimensional parameters to determine their effect on the analysis or stop at this time. Would you like to continue? U: No.

Eng. Appli. of AI, 1990, Vol. 3, June 117