11
Pergamon S0957-4174(96)00004-8 Expert Systems With Applications, Vol. I 1, No. I, pp. 4 I-5 i, 1996 Copyright© 19~ Ebevicf Sci~ I~ Printedin ~ Briutin. Allriflesrese~ed 0957-4174/96 $15.00+0.00 A Knowledge-Based System for the Analysis of Electrical Networks ALESSANDRO ]VI.ICAR ~LIJ Diparfimentodi DisciplineScientifiche---Sez. Informatica, TerzaUniversit~ di Roma, Via dellaVascaNavale 84, 00146 Roma, Italy LUIGIA Aml J O Dipanimentodi Informatica • Sistemistica,Universit~ di Roma "La Sapienza",Via Salaria 113,00198 Roma,Italy Abstract--A knowledge-based system for the analysis of electrical networks in alternate current in steady condition is presented. It is a glass box expert system, capable of determining and representing explicitly the current solution for a given problem. The system, mainly conceived for educational purposes, has been implemented in NEXPERT on a Macintosh pla~orm. The system can work in different ways (fully automated or step-by-step) and determine one, some or all the possible solution paths. This, among other features, makes it well suited for educational purposes. The capability of determining all the resolution paths for a given problem has been obtained by using contexts. The system has been tested with several electrical circuits with satisfactory results both in terms of the correctness of the determined solutions and in terms of the performance for the respoase time. The results of the tests of the system confirmed our expectations about the advantage of a knowledge-based approach for systems to be used for educational purposes. Copyright © 1996 Elsevier Science Ltd INTRODUCTION IN "rms pxpEa we describe a knowledge-based system for the analysis of electrical networks in a steady alter- nate current condition. The system, mainly conceived for educational purposes, has been implemented in NEXPERT on a Macintosh platform. Presently, there are many software tools available, and used worldwide, that allow one to solve complex electrical circuits. They are analog (and digital) circuit simulators, offering integrated schematic capture, graph- ical waveform analysis, suitable user interfaces, etc. Such tools [SPICE and PSPICE (Tuinenga, 1988) are noteworthy examples] have already been used for educational purposes essentially as a "simulated labora- tory" (Priguzy, 1989; Laghari et al., 1990; Giuma & Walker, 1992). An advantage of the use of such systems is that they make students' time more effective and, as Laghari et al. pointed out, they "limit the time that students and teachers are exposed to very high voltages, therefore ensuring personal safety in the laboratory". The distinguishing feature of the approach presented here, compared to the above-mentioned software tools, is that the solution to a given problem is constructed autonomously and represented explicitly, in a way that closely mimics a human expert. To this end, a prelimi- nary analysis of the interviews with teachers and the observation of the students' problem solving behaviour have been largely used for the definition of the design specifications of the system. Endowing a system with problem-solving capabilities has been instrumental in determining its flexibility in solving problems either extracted from some educational library or posed by students. Therefore, our system can conveniently be used as a glass box expert module (in the style o~ Anderson, 1988) or as an intelligent actor (in the style of Gisolfi & Loia, 1994) and main component of a wider intelligent tutoring system (Wenger, 1987) for teaching students how to analyse electrical networks. Our system is a new and more powerful version of the expert module of a tutoring system, called SAMPLE, already developed in KEE and running on an EXPLORER workstation (Micarelli et al., 1991-1992). The kind of electrical circuits considered in the first prototype of SAMPLE are only one-net circuits, which is a limitation from a didactic point of view. The system presented here overcomes this limitation; it is, in fact, capable of building a "topological model" of a given circuit constituted by more nets and of applying the relevant electrical laws and formulae for determining the 41

A knowledge-based system for the analysis of electrical networks

Embed Size (px)

Citation preview

Page 1: A knowledge-based system for the analysis of electrical networks

P e r g a m o n

S0957-4174(96)00004-8

Expert Systems With Applications, Vol. I 1, No. I, pp. 4 I-5 i, 1996 Copyright© 19~ Ebevicf S c i ~ I~

Printed in ~ Briutin. All rifles rese~ed 0957-4174/96 $15.00+0.00

A Knowledge-Based System for the Analysis of Electrical Networks

ALESSANDRO ]VI.ICAR ~LIJ

Diparfimento di Discipline Scientifiche---Sez. Informatica, Terza Universit~ di Roma, Via della Vasca Navale 84, 00146 Roma, Italy

LUIGIA Aml J O

Dipanimento di Informatica • Sistemistica, Universit~ di Roma "La Sapienza", Via Salaria 113, 00198 Roma, Italy

Abstract--A knowledge-based system for the analysis of electrical networks in alternate current in steady condition is presented. It is a glass box expert system, capable of determining and representing explicitly the current solution for a given problem. The system, mainly conceived for educational purposes, has been implemented in NEXPERT on a Macintosh pla~orm. The system can work in different ways (fully automated or step-by-step) and determine one, some or all the possible solution paths. This, among other features, makes it well suited for educational purposes. The capability of determining all the resolution paths for a given problem has been obtained by using contexts. The system has been tested with several electrical circuits with satisfactory results both in terms of the correctness of the determined solutions and in terms of the performance for the respoase time. The results of the tests of the system confirmed our expectations about the advantage of a knowledge-based approach for systems to be used for educational purposes. Copyright © 1996 Elsevier Science Ltd

INTRODUCTION

IN "rms pxpEa we describe a knowledge-based system for the analysis of electrical networks in a steady alter- nate current condition. The system, mainly conceived for educational purposes, has been implemented in NEXPERT on a Macintosh platform.

Presently, there are many software tools available, and used worldwide, that allow one to solve complex electrical circuits. They are analog (and digital) circuit simulators, offering integrated schematic capture, graph- ical waveform analysis, suitable user interfaces, etc. Such tools [SPICE and PSPICE (Tuinenga, 1988) are noteworthy examples] have already been used for educational purposes essentially as a "simulated labora- tory" (Priguzy, 1989; Laghari et al., 1990; Giuma & Walker, 1992). An advantage of the use of such systems is that they make students' time more effective and, as Laghari et al. pointed out, they "limit the time that students and teachers are exposed to very high voltages, therefore ensuring personal safety in the laboratory".

The distinguishing feature of the approach presented here, compared to the above-mentioned software tools, is that the solution to a given problem is constructed autonomously and represented explicitly, in a way that

closely mimics a human expert. To this end, a prelimi- nary analysis of the interviews with teachers and the observation of the students' problem solving behaviour have been largely used for the definition of the design specifications of the system. Endowing a system with problem-solving capabilities has been instrumental in determining its flexibility in solving problems either extracted from some educational library or posed by students. Therefore, our system can conveniently be used as a glass box expert module (in the style o~ Anderson, 1988) or as an intelligent actor (in the style of Gisolfi & Loia, 1994) and main component of a wider intelligent tutoring system (Wenger, 1987) for teaching students how to analyse electrical networks.

Our system is a new and more powerful version of the expert module of a tutoring system, called SAMPLE, already developed in KEE and running on an EXPLORER workstation (Micarelli et al., 1991-1992). The kind of electrical circuits considered in the first prototype of SAMPLE are only one-net circuits, which is a limitation from a didactic point of view. The system presented here overcomes this limitation; it is, in fact, capable of building a "topological model" of a given circuit constituted by more nets and of applying the relevant electrical laws and formulae for determining the

41

Page 2: A knowledge-based system for the analysis of electrical networks

42 A. Micarelli and L AieUo

solution. Furthermore, the system can work in different ways (fully automated or step-by-step) and determine one, some or all the possible solution paths, which makes it particularly suited for educational purposes. An interesting feature of our system is that it is running on a widespread "delivery platform", thus facilitating the circulation and experimentation on a large scale of possible educational systems.

The paper is organized as follows. In the next section a description of the knowledge base is illustrated. Then we present the resolution strategies used by the system during its problem-solving activity. In particular, we describe a context mechanism used to enable the system to determine all the possible correct solutions for a given problem. An example session with the system, relative to the method based on nodes, is shown. Finally, we describe the tests of the system with students, discuss some related works and present a few concluding remarks.

THE KNOWLEDGE BASE

The knowledge base on the subject domain used by the system in its problem-solving activity has been repre- sented in the form of NEXPERT objects, production rules, methods (order of sources, if change) and external routines.

The declarative knowledge pertinent to the topology and the electrical components of the circuit to be analysed is represented via a hierarchy of objects. In Fig. 1 a taxonomy is represented relative to the various components of a generic circuit. Of course, for a particular electrical circuit to be analysed, some of the objects present in the taxonomy will be instantiated to the actual components present in the circuit. The class COMPONENTS is the most general and groups the common properties of all the objects present in the

l~m*_volt

m~n~ / 0 GF'N-vOLT

FIGURE 1. ~ of the components of an electrical circuit .

circuits considered by the system. Some of the common properties are: the real part, imaginary part, module and phase of the voltage of the considered component; the real part, imaginary part, module and phase of the current flowing through the considered component and so on.

The class COMPONENTS has two subclasses: GEN- ERATORS and IMPEDANCES. The class GENERATORS is split into two other subclasses: G E N VOLT (voltage generators) and G E N CURR (current generators). The class IMPEDANCES is divided into the classes RESISTORS, INDUCTORS, CAPACITORS, G E N IMP (generic impedances, i.e. impedances whose resistive and reactive parts are not equal to zero), SHUNTS and SERIES. The objects belonging to the subclasses of IMPEDANCES are characterized by other properties, such as the value of the real part, imaginary part and phase of the impedance.

The system also uses a declarative representation of the topological aspects of the circuit to be analysed. A circuit is represented as a connected and oriented graph. An arc of the graph corresponds to a component of the circuit. A node of the graph is a point where two or more arcs are connected. For example, in Fig. 3 some topological information about the circuit of Fig. 2 is represented as a taxonomy. There is one net with three objects: the generator G~, the resistor R, and a third component S, constituted by R, and P~ connected in series. P, is the shunt between the capacity C~ and the generic impedance Z~. Such a taxonomy, specific to the circuit of Fig. 2, has been determined by the system using procedural knowledge implemented as external routines written in C.

The deductive knowledge is represented as a tax- onomy of production rules, that implements the knowledge relevant to the applicable electrical laws, theorems and formulae, such as Thevenin theorem, Ohm's law, Kirchhoff's laws, equivalent impedance formulae and so on. Production rules are grouped into clusters, each of which is relative to a particular task to be performed which is called a hypothesis. The hypoth- esis HRST is relative to the rules that can immediately be triggerable for some of the components of the circuit. For instance, when a capacity is input as a component of

R1 R2

c 7 I ®

FIGURE 2. An example circuit.

4.

Page 3: A knowledge-based system for the analysis of electrical networks

Analysis of Electrical Networks

/~(+) GTI

FIGURE 3. Taxonomy of some topological m q ) ~ s of the circuit of Rg. 2.

43

a circuit to be analysed, its real part property has to be set to zero. This is done by the rule shown in Fig. 4. There are 12 rules relative to the hypothesis FIRST.

The hypothesis CONVERS is relative to the possible conversions between the different representations of an electrical quantity, i.e. (i) with complex numbers and (ii) with module and phase. In Fig. 5 one of the 31 rules relative to the hypothesis CONVERS is shown. It determines the module of a quantity starting from the real part and the imaginary part of the quantity represented as a complex number.

There are 15 rules relative to the hypothesis OHM that implement Ohm's law. In Fig. 6 an example of this group of rules is shown, which determines the module of the current flowing through an impedance, given the modules of the impedance and of the relative voltage.

CONDITIONS : Is <ICAPACITYI>.re_val UNKNOWN

HYPOTHESIS : FIRST ACTIONS :

Strategy @PFACTIONS=FALSE; Do 0 <ICAPACffYI>.re_val Strategy @PFACTIONS=,TRUE;

FIGURE 4. An example rule relative to the hypothesis FIRST.

C O ~ : IsNot <L"OtOONE~Sb.im_curr UNKNOWN ISNot ~ S i > . r e _ c u r r UMOqOV~ Is < ~ S b . m o d _ c u r r UNKNOWN

HYPOTHESIS : COtO/ERS ACTIONS :

Do SQRT(POW( <ICOMPONENTSI>.re_curr,2 )+ POW( <ICOMPONENTSI>.im_curr,2 ) )

<ICOMPONENTSI>.mod_cusr Execute "update" OT YPE -EXE,-OATOMID- <ICOMPONENTSI>;

@s'r Rit~3- "i_mod_unk"; Execute "convers" @TYPE,,EXE,~ATOMID- <ICOMPONENTSI>;

@STRING-"Z I";

FIGURE 5. An example rule relaltfve to the hypotholJa CONVERS.

IsNot < ~ . m o d _ v o i t UNiO~WN ISNot < ~ S t > . m o d _ v a l UNKNOWN Is <IIMPEDANCF~I> .rood_cur r UNKNOWN

tWPGq3~_$tS : O ~ ACTIONS :

Do <BMPEDANCESI> .rood_volt/<IMREDANCJ~_ _~> .mod_val

~ J a o d _ c , r r FJtecute "W,,~3ze" eTYRE-IDIF.,'eATOMIO,.<IIMPEDAN(~SI>;

~TRING-'i_mod_unk"; Execute "ohm" @TYPE,,ENE,tlJATOMIO-<IIMPEDANCESI>;

@ S T Y " 12";

FIGURE 6. An example rule reildive to the hypOtheldl OHM.

The hypothesis SAME is relative to the electrical laws applicable to the components with the same current flow or with the same voltage. There are 8 rules of this group that transmit the appropriate values of electrical quan- tifies from a component to another one.

The hypothesis KIRCHHOFF is relative to the Kirchhoff laws applicable to the nets and cuts of a given circuit. There are 4 rules of this group which have a key role for the resolution process. Other hypotheses are: SER_ SHUNT, relative to the formulae applicable to the configurations connected in series and to the shunts; NODES, relative to the application of the resolution procedure based on nodes; and CONGRUENCE, which tests the congruence of the values of the determined quantifies, verifying whether they are contradictory (this happens if the student proposes a circuit with redundant and non-coherent initial data).

THE RESOLUTION PROCESS

At the beginning of a working session, an electrical circuit is chosen from a library of prestored exercises or is proposed by the student. At this point the circuit is analysed by the system using the resolution strategy shown in Fig. 7.

In the first phase the system identifies the connections in series and the shunts between impedances present in the given circuit.

In a second phase, the relevant topological aspects of the circuit are determined. They are all the nets and cuts present in the circuit. A net is a set of arcs of the graph

Page 4: A knowledge-based system for the analysis of electrical networks

44 A. Micardli and L Aieilo

9 SFJHIKS..SHUNT

UI'DATE_TOroU)GY

FIGURE 7. ~ u t l o n

which constitute a closed and finite path. A cut is a set of arcs traversed by a closed and finite line.

At this point the system possibly applies the rules relative to the hypothesis FIRST. Then an iteration cycle is executed, until no more electrical laws are applicable. Inside this cycle, a precedence between laws is defined, as represented in Fig. 7.

First, the laws relative to the conversion for the representation of electrical quantities (CONVERS) are applied. Then, the system applies the Ohm laws (OHM), the laws relative to components with the same current flow or the same voltage (SAME), the Kirchhoff laws relative to the nets and cuts previously determined (KIRCHHOFF) and the laws relative to the connections in series and to the shunts (SER_ SHUNT). At the end of this cycle, there is one more test to verify if all the required electrical quanitites have been determined: if the test fails, the system tries to use a solution pro- cedure based on nodes. The last phase is the check for consistence of the determined values (CONGRUENCE).

This resolution process is completely automated. The system is, in any case, also arranged to behave in a step- by-step way. In this way the system allows the user to

choose the electrical law to apply at each resolution step, verifying the applicability of the law and consequently triggering it.

THE MECHANISM OF CONTEXTS

During the interaction, the system can also be asked to determine all the possible correct solutions for a given circuit. To this end, the fundamental building blocks for knowledge representation provided by NEXPERT (frames, production rules and procedural attachments) have been extended with a context mechanism, in the style of the Worlds mechanism of KEE (Filman, 1988).

A context is a set of facts describing a hypothetical situation or problem-solving state. From each context it is possible to create child contexts, which can be thought of as representing the results of an action or making a hypothesis in the situation represented by its parent context. In this way, problem solving is an exploratory incremental process. That is, the system starts with a set of beliefs which are true in every situation and which represent the static knowledge base. The knowledge base in our case represents the topology of the circuit to be analysed and the initial available data. Starting from the static knowledge base, the system, using production rules and the inference engine, creates contexts where new facts are deduced. Each context is produced by the application of a production rule, whose conditions are verified in a context. At the end of the process, a context and its ancestors in the graph represent a partially- ordered network of actions.

During the process, it is not sufficient to explode every context by applying the electrical laws on the domain, since the student could follow a different strategy for the determination of the correct path to the solution. Consider, for example, the case where the student, during his problem,solving activity, has the possibility of applying an electrical law requiring data that are present in different contexts belonging to different paths in the graph. This situation is illustrated in Fig. 8. The electrical law is:

V(Zl).re= V( GTl).re - V(Rl).re - V(R2).re

The real parts of the tension of the generator GT~ and of the resistors R~ and R2 belong to the contexts a, fl and y, respectively. In this case there is the need of "merging" the three contexts into a new one (context 8), represent- ing the state resulting from a union of the changes from its ancestor contexts. In context B the data V(Z~).re, determined by the application of the previous electrical law, has been added. At the end of the process, the determined graph represents all possible paths to the solutions for a given circuit.

AN EXAMPLE SESSION

In this section we present an example of a step-by-step session with the system, relative to the analysis based on

Page 5: A knowledge-based system for the analysis of electrical networks

Analysis of Electrical Networks 45

~ ~NTEXT

~ CONTEX'I" ~

V ( R ~ ( R Z I . r e

V(Zl ).re-+V(GT1 ).m-V(R1 ).re-V(RZ).re FIGURE 8. An example of a merge context.

nodes of the circuit represented in Fig. 9. We recall that the method based on nodes can be applied if we know the values of the real and imaginary parts of the tensions of the voltage generators, of the currents of the current generators and of the all impedances present in the circuit. Before starting the description of the problem, we introduce some conventions adopted in the following. The first is relative to the directions of the tensions and of the currents: as is shown in Fig. 10, the positive terminal of the tension has been associated with node n~ and the negative terminal with node n 2. As for the currents, the figure shows the positive direction for the impedances (from n I to n2) and for the generators (from n2 to n~), respectively. The second convention is relative to the "generic impedances", i.e. impedances with both the resistive and reactive parts not equal to zero. For the description of the electrical behaviour of those imped- ances the attribute "type" has been used, with the value '~ype=l" for inductive impedances and the value "type =- 1" for capacitive impedances.

The problem is the determination of the currents

flowing through the passive components of the given circuit. At the beginning of the session, the system determines the topological aspects of the circuit by executing the relevant procedure ("topology"). This procedure analyses the circuit at different representation levels (see Fig. 11): the first (level 0) is relative to the circuit with single initial components, the second (level 1) is with $1 between the nodes 2 and 4 ($1 corresponds to the series ofR 2 and P~), the third level (level 2) is with P~ between the nodes 3 and 4 (P~ corresponds to the shunt between Z , C~ and L~). For each level the system determines the nets, cuts, elements with the same tension (shunts) and those with the same current (series). The names of the objects determined by this procedure have two numbers: the first is relative to the representation level, the second is the order number. In Fig. 12 the nets and cuts at level 0 are shown. At this point the electrical laws are applied. At each step, an object of the class STEP is created with three attributes: (1) "law", which describes the electrical law that has been applied; (2) "list", which represents the mathematical formula of the electrical law; and (3) "value", which shows the numerical value of the determined electrical quantity. When the applied rule is "procedure based on nodes", the system creates a number of objects of the class EQUATIONS corresponding to the number Of equations present in the resolving system of equations. Each object of this class has the following four attributes:

id: name of an unknown quantity in an equation of the resolving system

list: mathematical expression of the above equation

re_ val: real part of the quantity indicated by the value of the attribute "id"

im_ val: imaginary part of the quantity indicated by the value of the attribute "id".

The resolution steps are shown in the following. The presented solution can be divided into three parts.

In the first part (steps n. 1, 2 and 3) the computation

GT1

GC1 ® R2

+ I I

C1 ,,

I ®

®

+

FIGURE 9. Circuit Ixopoted to the stlxllnt.

L1

Page 6: A knowledge-based system for the analysis of electrical networks

46 A. Micarelli and L Aiello

nl

1 1 °

Impedance generator

FIGURE 10. Conventiorm relotivt to the dlmotlons of the tenMorm and currents.

of the real and imaginary values needed for the method based on nodes is performed. In step n. 1 the attribute "type" of the generic impedance Z~ has been used to compute the imaginary part of Z~: since Z~ has an "inductive" electrical behaviour (type= I), its imaginary part must be positive.

The second part (step 4) consists of the application of the solution procedure based on nodes. The node marked with the highest number (node n. 4) has been chosen as the "node of reference", and its tension has been set to zero [eqn (5)]. The unknown quantities are the tensions of the nodes n. 1, 2 and 3 as regards node n. 4 [eqns (1), (2) and (3)]. Since node n. 1 is directly connected to node n. 4 with a voltage generator (GT0, it is necessary to introduce a further unknown quantity, i.e. the current flowing through this generator [eqn (4)].

The last part of the resolution procedure consists of the determination of the tensions and currents of the passive components present in the circuit, using the quantities determined with the solution procedure based on nodes. To this end, Ohm's law (steps n. 7, 9, 10, 12 and 13) and Kirchhoff's law (steps n. 5, 6, 8, 11 and 14) have been applied on the previously determined cuts. The resolution steps follow:

Step n. 1:

liSt: Z(ZI).imfZ(Z,).type*sqrt{[Z(Zl).mod] 2 - Z ( Z 0 . r e ] 2 }

law: Law that links the imaginary value to the module, the real part and the type of the impedance of Zj

value: 3.0

Step n. 2:

list: l(GCt).re=KGCi),mod*cos[l(GCt).phase] law: Law that links the real value to the module and the

phase of the current of GCI value: 2.828428

Step n. 3:

fist: l(GCl).im=l(GC,).mod*sin[l(GC~).phase] law: Law that links the imaginary value to the module

and the phase of the current of GCI value: 2.828427

Step n. 4:

law: Application of the procedure based on nodes

Eq-l.id: V(node_ 1) Eq-l.list: +[G(R~)*V~=+I(GC~)+I(GTO Eq-l.re_ val: 2.0 Eq-l.im_ val: 3.0

Eq-2.id: Eq-2.list: Eq-2.re_ val: Eq-2.im_ val:

V(node_ 2) + [G(R2)*V2- [ G ( R g ] , V 3 = - I(GC,) - 17.474257 - 7.94284

Eq-3.id: V(node_ 3) Eq-3.1ist: - [G(R2)*V2 + [( G(R2) + G(L~)

+G(CJ+G(Z~)]*V3=0 Eq-3.re_ val: - 6.160547

GTI(1 +

GC1 R2

I ®

(!)

GT1 I+ ? GC1

R1 !1 S1

l ®

level n. 1 level n. 2

FIGURE 11. Diffwlmt ~ o n kam~ o¢ t l ~ dmul t of IRg. 9.

Page 7: A knowledge-based system for the analysis of electrical networks

Analysis of Electrical Networks 47

Eq-3. im_ val: 3.370866

Eq-4.id: I( GT~) Eq-4.1ist: V(GT,) = V~ Eq-4.re_ val: - 1.828428 Eq-4.im _ val: - 1.328427

Eq-5.id: V(node_4) Eq-5.1ist: Node of reference: its tension is set

tO ze ro

Exl-5.re_ val: 0.0 Eq-5.im _ val: 0.0

Step n. 5:

list: l( R,).im = + l( GT)O.im + l( GCl).im law: Kirehhoff law applied to the cut n. 1 value: 1.5

Step n. 6:

list: l ( R 2 ) . i m = - I(Rl).im+l(GTi).im law: Kirchhoff law applied to the cut n. 6 value: - 2.828427

Step n. 7:

list: l(RO.re=[V(ROre*Z(RO.re+ V(RO.im*Z(RO.im]/ { [Z(RI).I~] 2 + [Z(Rt ). ira] 2 }

law: Ohm law for R~ value: 1.0

Step n. 8:

list: l(R)z).m=-l(R,).re+l(GTt).re law: KJrchhoff law applied to the cut n. 6 value: - 2.828428

NETS C~/TS

GC1

RZ GC1

L1

C U T _ O _ Z / / ~- GC1 /

C1

CUT_O_S \ \~- Zl L GT1

CLrr_o_6 \ ~ RZ

z1

RZ

T1

a) b)

FIGURE 12. Taxonomy of nets and out l I t level 0.

Page 8: A knowledge-based system for the analysis of electrical networks

48 A. Micarelli and L Aiello

Step n. 9:

list: l(Zi).im=[V(Z0.im*Z(Z0re- V(ZO.re*Z(Zl).im]l { [Z(Z~) .re]2+ [Z(Zt ) . im] 2}

law: Ohm law for Z t value: 1.278604

Step n. 10:

list: l(C0.im= [V(CO.im*Z(Ci).re- V(CO.re*Z(CO.im] /{ [Z(Ci).re] 2 + [Z(Ct).im] 2 }

law: Ohm law for Cj value: - 6.160547

Step n. 11:

list: law: value:

1(L, ).im = - I (R2) . im - 1( C, ) . ira - l(Zl ).im Kirehhoff law applied to the cut n. 5 2.053516

Step n. 12:

list:

law: value:

~LO.re=[V(Lt).re*Z(Lt).re-V(Li).im*Z(Li).im]l {[Z(Li).re]z+[Z(Li).im] 2 } Ohm lawforL~ 1.123622

Step n. 13:

list:

law: value:

l( Ci).re = [V( CO.re*Z( Cl).re - V( CO.im*Z( C,).im] /{ [Z(C0.re]2 + [Z(Ct).im] 2 } Ohm law for Ct - 3.370866

the students' behaviour in problem solving. This analysis leads us to the following classification of errors:

Algebraic errors 4.1% Incorrect use of formulae 12% Correct but not optimum 9.5% process Errors in determining the 12.7% equivalent impedance in a shunt Errors in determining the 4.1% equivalent impedance for a connection in series Errors in computing the 21.6% phase angle Careless mistakes 6.4% Numerical mistakes 8.8% Errors in the application of 4.1% theorems (Thevenin, Norton) Trigonometric mistakes 4.8% Errors in the units of measure 7.3% Errors in the use of complex 4.1% numbers

In addition, student monitoring has allowed us to collect a lot of information about the resolution methodology, the kind of help requested by students and the questions and hints asked to the teachers.

The system has been tested with the chosen electrical circuits with satisfactory results, both in terms of the correctness of the determined solutions and in terms of the performance for the response time (a few seconds for each circuit).

Step n. 14:

list: l(Z0.re= - l(L0.re - l(CO.re - l(GCO.re law: Kirchhoff law applied to the cut n. 3 value: - 0.581183

TESTING THE SYSTEM WITH TEACHERS AND STUDENTS

As for the testing phase, a set of 40 electrical circuits has been chosen and proposed for the system. Some of the circuits used for the testing are shown in Appendix 1. The choice of these circuits has been made according to the educational needs of high school students. To determine them, an accurate requirements definition phase has been necessary. A sizeable number of students (238, from four different technical high schools) has been preliminarily interviewed and observed during their problem-solving activity. This process consisted of filling in questionnaires, individual interviews, analysis and control of homework and classroom exercises already corrected by the teachers and, lastly, monitoring

RELATED WORKS

As anticipated in the Introduction, the work presented in this paper is an evolution of the system SAMPLE (Micarelli et al., 1991-1992). SAMPLE is an intelligent tutoring system for teaching high school and college students how to analyse one-net electrical circuits in steady alternate current conditions. SAMPLE consists of an expert module, capable of actually solving problems in the domain to be taught, a student modelling module, capable of building an explicit representation of the learning status of the student, a tutoring module, containing the teaching expertise of the system, a bug catalogue, which is a library of common errors made by students, and a user interface that administers a mixed initiative interaction between the student and the system. SAMPLE has been successfully tested with school students. Such tests have played a fundamental role in the definition of the object domain and the design specifications of the system presented in this paper.

Another educational system that deals with electrical circuits is ALLEN (Assistant in Learning Linear Elec- trical Network Analysis) (Watanabe et al. 1991). This is

Page 9: A knowledge-based system for the analysis of electrical networks

Analysis o f Electrical Networks 49

an intelligent tutoring system for teaching the analysis of one-net circuits in direct current. Like SAMPLE, this system is a mixed-initiative tutor which diagnoses and guides students during problem solving just as a human tutor does. A limitation of ALLEN is that it can only choose from twenty different circuit analysis problems, which are prestored in the system. Each problem contains the circuit topology and the question to be answered by the student. The interaction is not based on a graphical or menu-based interface, but on natural language. So, to solve a problem the student can propose either equations, by a formula manipulator, or natural language sentences, that will be processed by a parser. Instead of a session (when the student completes a problem) ALLEN provides an evaluation of the student's behaviour in the resolution of the just-completed prob- lem: the tutor displays the number of errors, requests for assistance, etc. On the basis of this analysis the system can choose the new problem to be proposed. A limitation of this system, besides the limitation of the domain, is that the student is not allowed to propose a new circuit to be analysed, since its problem-solving capabilities are only relative to a pre-canned library of problems.

Yoshikawa et al. (1992) present another intelligent tutoring system, called "Circuit Exerciser", written in Lisp and C and running on a NEWS workstation (made by Sony Corporation) using UNIX 4.2BSD. It has been designed to help university students learn more about electrical circuits. The main limitation of this system is that the problems proposed to the students are, in substance, only the computations of series and shunts of passive electrical components.

Debebe and Rajagopalan (1995) describe a Power Electronics instruction aid for selection and analysis of suitable power electronic converter configurations. In the system, transient, steady-state and harmonic analyses are performed by a simulator. A knowledge-based compo- nent is present, and is relative to the instruction module.

A system that copes with synthesis problems, which are complementary to the analysis problems considered in our work, is ASCETA (Marchesi et al., 1990). It is an expert system for passive network synthesis and filter design, developed in an object-oriented environment. The system, implemented in SMALLTALK/5, has been realized for educational purposes. In the system heuristic knowledge has been used to control the whole synthesis procedure and to focus on the actual algorithms to perform the synthesis, while numerical methods have been used to code these algorithms. ASCETA has been used mainly by teachers to develop exercises and examination tests.

CONCLUSIONS AND FUTURE WORK

In this paper a knowledge-based approach to circuit analysis has been explored and a knowledge-based system for the analysis of electrical networks in a steady

alternate current condition has been presented. It is a glass box expert system, capable of determining and explicitly representing the correct solution to a given problem. The system, has been implemented in NEX- PERT, extended to deal with contexts and is running on a Macintosh platform. The system can work in different ways, all well suited for educational purposes. Of particular interest is its capability of determining all the resolution paths for a given problem; this has been obtained by a mechanism of contexts.

The present implementation of our system is at the stage of a research prototype. Tests with students and teachers have confirmed our expectations about the advantage of the knowledge-based approach for educa- tional purposes. Various extensions and improvements to the system are envisaged. First, the domain to be taught can be extended to include problems concerning energy and power transfer. Second, the system can be used as a "core" (expert module) of a wider knowledge-based educational system to be used to assist and supplement conventional classroom teaching. Another step is to provide the system with a graphical interface that permits an easier way to propose circuits to be analysed, to change the circuit's quantities via a mouse and to have the effects of these changes graphically represented in real time in the style of a simulated laboratory.

REFERENCES

Anderson, J. R. (1988). The expert module. In M. C. Poison & J. J. Wlchardson (Eds), Foundations of intelligent tutoring systems (pp. 21-53). Hillsdale, NJ: Erlbaum.

Beltzer, A. & Shenkman, A. L. (1995). Use of symbolic computation in engineering education. IEEE T~ansactions on Education, 38(2), 177-184.

Debebe, K. & Rajagopalan, V. 0995). A learning aid for power electronics with knowledge based components. IEEE Transactions on Education, 38(2), 171-176.

Filman, R. E. (1988). Reasoning with worlds and truth maintenance in a knowledge-based programming environment. Conununications of the ACM, 31(4), 382-401.

Gisolfi, A. & Ldia, V. (1994). Designing complex systems within distributed architectures: An intelligent tutoring systems per- spective. Applied Artificial Intelligence, 8, 393-411.

Giuma, T. & Walker, P. (1992). PSPICE circuit generation through the method of simulated annealing. IEEE Transactions on Education, 35(2), 159-163.

Laghari, J. R., Suthar, J. L. & Cygan, S. (1990). PSPICE applications in high voltage engineering education. Computers & Education, 14(6), 455-462.

Marchesi, M., Piazza, E & Orlandi, G. (1990). ASCETA: An expert system for passive network synthesis. Applied ArtifiCial Intelli- gence, 4, 85-93.

Micarclli, A., Mungo, F., NuccL F. S. & Aiello, L. (1991): SAMPLE: An intelligent educational system for electrical circuits. Journal of Artificial Intelligence in Education, 2(3), 83-99.

Micarelli, A., Mungo, F., Nucci, F. S. & Aielio, L. (1992). Reasoning with worlds and truth maintenance in an intelligent tutoring system. Expert Systems with Applications, 4, 147-155.

Prigozy, S. (1989). Novel applications of SPICE in engineering education. IEEE Transactions on Education, 32, 35-38.

Pudlowski, Z. J. & Rados, M. (1994). A computer-based aptitude test

Page 10: A knowledge-based system for the analysis of electrical networks

50 A. Micarelli and L Aiello

for electrical engineering. Computers & Education, 22(3),

239-250. Tuinenga, P. W. (1988). SPICE: A guide to circuit simulation and

analysis using PSPICE. Englewood Cliffs, NJ: Prentice-Hall. Watanabe, S., Miyamichi, J. & Ifstz. I. R. (1991). Teaching circuit

analysis: A mixed-initiative intelligent tutoring system and its evalution. In IL Lewis and S. Otsuki (Eds), Advanced research on

compeers in education. Amsterdam, The Netherlands: Elsevier. Wenger, E. (1987). Artificial intelligence and mtonng systems, los

Altos, CA: Kaufrnmm. Yoshikawa, A., Shintaui, M. & Ohba, Y. (1992). Intelligent tutoring

system for electric circuit exe~ising. IEEE Transactions on Educo~on, 3,q(3), 222-225.

A P P E N D I X I A

Example I Example 2

GT3

(3) ®

°1 ~'~" ~ +i RI + + ® O1"2

OTI Zl R2 - ~ +

~ ® -

- - ® Initial data Initial data

V(GTl).sa = 10.0V V(GTI). im = 0.0 V V(Zl ) .m - 4.0 V V(Zl) . im - 0.0 V Z(Rl) .val ,, 2.0 V Z(R2).val = 4.0 V CIRCUITO.w = 1.0 sad/sac

Q= 4-

V(OTX).sa = 1.0V V(GTI). im = 0 .0V V(OT2).n, - 1.0 V V(OT2).im = - I . 0 V V ( G T 3 ) . m - -3.0 V V(GT3).im - 0.0 V Z(Cl).val ,, 1.0 ! z Z(Ll).val ,, 1.0 H Z(R1).val ,, 1.0 CIRCUITO.w = 1.0 sad/sac

®

CI

E x a m p l e 3 Example 4

RI OCl

GTI LI Cl T

!_®

Initial data

V(6T1).ira - 3.0 V V ( G T I ) . ~ - 2 .0V l(G.Cl).mod - 4.0 A l (GCl) . fase - 0.785398 Z(Cl) .val - 1.0 P Z(Ll) .val ,. 3.0 H ZOU).val o 2.0 Z(Zl) .mod = 5 .0 n Z(Zl ) .m - 4.0 0 z ( z t ) . t i v o - 1 CIRCUITO.w =, 1 sad/sac

Z1

± ®

Initial data

V(GT1).im - 3.0 V V(OT1).im - 2.0 V Z(Cl).val = 1.0 P ZOLl).val = 3.0 H Z(]Rl).val - 2.0 l~i ZOP.2).val =, 2.0 Q Z(Z1) .mo~ - 5 .0 Z ~ l ) . s a - 4.0

C I R C U r r o . w , i m~mm

CI ~ ZI

Page 11: A knowledge-based system for the analysis of electrical networks

Analysis of Electrical Networks 51

E x a m p l e 3

(!) m t I

O - -

GT1

_L ®

l (GT1) .mod - 6.0 A l ( G T l ) . f u e = 0 .0 Z ( Z l ) . r e - 8 . 0 0 Z ( Z l ) . t i p o = 1 Z(Z2) .uu - 10.0 n V ( Z l ) . m o d = 100.0 V V(Z2) .mod - 1SO.O V CIRCUITO.w .. 314 rad/sec

®

4 .

Z 2

01"i 4 "

A P P E N D I X IB E x a m p l e 6

~)

ZI

÷

4

- -® V ( O T l ) . m o d - 2.50.0 V l ( O T l ) . m o d - 12.0 A V ( O T l ) . f a u - 0 .0 I (OTl) . fmm - 0.61 Z(R2) .val = 35 f~ 7.(Zl).,ipo. i CIRCUITO.w = 314 m d l l e c

R2

@

I ? E x a m p l e 7

Z I

.I I

GCI

± @

l ( O C l ) . m o d - 12.0 A V ( O C l ) . f w - 0 .0 l ( G C l ) . f u e - -0 .139626 Z(Z1) . im - 6 . 0 0 Z ( Z l ) . f m e = 0.4363:32 Z(Z2) .m - 8.0 n Z(Z2). t ipo = -1 CIRCUITO.w = 1 rad/sec

®

Z2

Example 8 Example 9

0

i_.®

V ( f f r l ) . m o d - 100.0 V V(OT2) .mod - 200.0 V V ( O T l ) . f l l e . . 0.0 V(OT2).fase - 0 .0 Z (RI ) . va l = 10.0 n Z(R2).v81 - 20.0 n ZOR3).val - 30.0 n Z(R4) .v . I = 40.0 n

Z( l~ ) .va l - 50.0 I01

LI I - Z l

~-- ®

V(OTl ) . im - 3 .0 V V ( G T l ) . i m - 2 .0 V Z(CI ) .va l =. 1.0 F Z ( L l ) . v a l - 3 .0 H Z ( R l ) . v a l = 2.0 n Z ( Z l ) . m o d - 5 .0 n Z ( Z l ) . m - 4.0 n Z ( Z l ) . ~ p o - 1 CiRCUITO.w - 1 radlsec

E x a m p l e 10

R1

OT1 +~./VVx,,_ ®

< L1

_ ®

V ( G ' r l ) . i m = 3 .0 V V(GTI ) . r e = 2 . 0 V Z ( L l ) . v a l = 3 .0 H Z ( R l ) . v a l - 2.0 Q Z ( Z l ) . m ~ l - 5.0 0 Z ( Z l ) . m - 4.0 r) Z ( Z l ) . t i p o = 1 C lRCUITO.w = I rad/sec

I Z I

E x a m p l e 11 E x a m p l e 12

LI

® ci ® @ :ooo._

GTI RI O1"1 _ ~ RI

_,® - ~ ®

Z ( R I ) . v s l = 1 .0 Z ( C l ) . v a l - 1 .0 P V ( O T l ) . r e . . 0 . 0 V V ( O T l ) . i m .. - 2 . 0 V C I R C U I T O . W - 1.0 t a d / s a c

®

u

V ( O T l ) . i m - 3 . 0 V V ( O T l ) . r e = 2 . 0 V Z ( L I ) . v a l - 3 . 0 H Z O t l ) . v 8 1 .. 2 . 0 n Z ( Z l ) . m o d .. 5 . 0 n Z ( Z l ) . r e = 4 . 0 Z ( Z l ) . t i p o .. I C I R C U I T O . w = I t a d / s a c

E x a m p l e 13

t ' ~ R1 ~ O C l o }:o, Tl ± ® -2

V I G T I ) . i m = 3 . 0 V V ( G T I ) . r e - 2 . 0 V l ( O C l ) . m o d - 4 . 0 A l ( G C l ) . f a s e - 0 . 7 8 5 3 9 5 Z ( C l ) . v a l = 1 .0 F Z ( L l ) . v a l = 3 .0 H Z ( R l ) . v a l = 2 .0 Q Z ( R 2 ) . v a l = 4 . 0 n Z ( Z l ) . m o d = 5 . 0 ~1 Z ( Z l ) . r e - 4 . 0 Z ( Z l ) . t i p o - 1 C I R C U I T O . w = I r a d l s e c