Teaching chemistry with expert systems: Systematic chemical

Aug 1, 1991 - Teaching chemistry with expert systems: Systematic chemical separation of cations in aqueous media. M. S. Larrechi and F. X. Rius. J. Ch...
2 downloads 10 Views 6MB Size
computer series, 128 Teaching Chemistry with Expert Systems Systematic Chemical Separation of Cations in Aqueous Media M. S. Larrechi and F. X. Rius

University of Barcelona Pi. Imperial Thrraco, 1. E-43005 Tarragona, Spain Microprocessorsare widely used in teaching chemistry so that, for example, personal computers are now a very common tool in laboratories, and students are familiar with programming, simulation, and numerical calculus programs. Many programs are basically intended to help students with their calculations because they produce faster and more reliable results. There are also other computer tools coming from the field of artificial intelligence. Although increasingly used in chemical research, expert systems have just been introduced to teaching. Expert systems are computer systems that process and use previously introduced knowledge from a particular area, in order to advise the user as an expert would. The use of these systems involves direct dialog between computer and student. The computer has previously been programmed to give course material and instructions and to ask questions and check answers while varying its presentation according to the student's responses. From this point of view, expert system can be classified as computer-asHowever. there sisted instruction a ~ ~ l i c a t i o(CAI) n s . (1-5). . are differences between expert systems and conve&ional CAI Dromams. which have a fixed structure. Runnine the one knows beforehand the sequence of in&uctions carried out hv the cornouter. Therefore. recomizine students inputs, evaluating them, and jumping frGm one part of the sequence of instructions to another is a dimcult aspect of cAI.-An expert system, however, does the reasoning itself: It tries to determine the right solution from different possible solutions (6,n.Another important aspect of expert systems is the predominant use of symbolic reasoning. The information input to the expert systems may or may not be quantifiable; the variable can take values as "poorest", "poor", "goad", '%better",or "best" and the user can use subjective techniques to assign values to his or her input. Two other striking features of expert systems are their ability to answer why the system needs to know certain information and how the system arrived at a certain solution. This guides the user in providing the correct amount and t m e of information and builds confidence. ~ t u d e n & o ~ e n A e ethe d prompting and guidance that can be furnished bv the tireless expert svstem. Cachet et al. 18)have demon&atei how an expert system can be useful for implementing the idea of "intelligent tutoring systems (ITS)"(9).Settle has recently reported the application of some expert systems to the general chemistry laboratory (10). More specifically, his QUALI expert system has also been designed to assist students in the qualitative analysis of metal ions. This system is also rule-based and designed to act more as a diagnostic tool than a tutorial device, as in current work. However, both systems have the common characteristics of AI instru&

&

edited by

JAMESP. BIRK Arizona State University Tempe, AZ 85281

ments: They act as consultant for qualitative analysis and can explain their reasoning upon request. Settle's expert system covers the analysis of sixmetal ions and introduces uncertainty in the identification of one or more ions present in the test solutions of unknown composition. The present study introduces a rule-based expert system, s~ecificallvdeveloped for teachine. A reauirement of expert systems is that the knowledge they k t a i n be rich in a restricted area. In the present studv the separation of 24 cations in aqueous med& was selected. It seems evident that, despite great advantages offered by instrumental methods, qualitative analysis by purely chemical methods has a significant pedagogical interest: The student must use the physicocbemical theoretical knowledge acquired (11).Although teaching this kind of qualitative analysis requires extensive knowledge of the analytical reactions, the teacher's emerience still plavs a significant role in solving "unexpectedn cases th& &ay arise. The students sometimes fail to ask the right questions and usually ask too many factual questions, overwhelming the teacher with trivia. The present expert system is clearly addressed to students interested in acquiring knowledge useful in the chemical separation of cations. It does not give advice that could lead to-the proper separation of ions in specific samples. On the contrary, it guides the student interactivelv throueh the reasonine of the stem involved in systema"tic cheiical separations in inorgaiic reaction chemistry.

-

Architecture of the Expert System

An expert system has three basic parts: the knowledge base, thk inference engine, and the iser interface. In current work knowledge base refers to the knowledge and in our laboratoly in the sysexperience put int~-~ractice tematic separation of cations in aqueous media. The inference engine controls the use of knowledge implemented in the knowledge base and works like an expert, giving advice and drawing conclusions.The user interface facilitates communication between the user and the knowledge stored in the computer program. Software

The expert system shell KES1 has been used as a tool to build the didactical system. It can be used with different operational systems and with different computers. In our study, the KES 1.4 version wasused with an IBM PSI2. The construction of the system involved the specification of attributes, rules, and actions to be used by the system. The Knowledge Base

Knowledge base construction is founded on the fundamental theory of inorganic analysis. The objective of the designed system is to assist students in the separation of the elements present in a liquid sample. The general separation method used in our laboratory includes the use of hydrogen sulfide as general reagent to separate the second and third groups of cations. Though utilizing substances that are very toxic and hazardous when not used properly (circumstances thoroughly advised to students), the 'KES PS availabe from Software Architect~reand Engmeerng nc.. 1600 W son Bo- evard. Site 500, Arl ngton. VA. 22209. LSA Volume 66 Number 8 August 1991

859

(12-14).Our expert system"knows" the reagents to be used in each separation step and the conditions (pH, dilution, solution temperature, presence of other ions) at which the separation will be carried out. Figure 1 is a flow chart showing part of the knowledge base introduced. The expert system initially asks the student to select a general reagent from a set shown on a menu. The actions section wnsists of wmmands that control the expert system. Thus, it is the commanding part of the program. Figure 2 shows how to present messages, prompt information, and establish objective attributes for the inference engine. In our example, the fint command is to obtain the value of attribute resreac.

isulfuric acid, hydrochloric acid, ammonium chloride, ammonium carbonate] (question: -Which analytic reactant would you choose?") (explain: 'In the chemical separation that employs hydrogen sulfide as", "general reactant, all cations can be separated into 5 genera1 groups.", -The first group is constituted by all cations that precipitate as", charides in acid media"].

-

(question:'What cic acid?"!

Figure 1. Flow diagram of the knowledge base for the separation of the 2nd group of cations. method is one of the best to illustrate the importance of aciditv control of the medium when the distinct -zeneral reagents are used to precipitate the different groups ofions. A flow diagram of the separation of the 24 ions studied can be found in standard textbooks of qualitative analysis

can you observe when adding hydrochlo-

(explain: 'When adding hydrochloric acid, if there are :ation5 of the" -first group, it will appear a precipitate. If there is not a" precipitate, we can be sure that cations belonging :O the first" gro-p are missing"1. .I

measage welcome. message continue. break. rneSSage Begin. message FindgroupI. obtain resreac. if s t a t u ~ (resreacl = known then display value of resreac. display attach explain of value of resreac. if resreac = incorrect then

erase. message Start again. stop. endif. if resreac = correct then obtain rappeai. display value of rappeal. display attach explain of value of rappear. endif. incorrect then if rappear erase. obtain rappeai. endif.

-

LFigure 2. Actions. 680

Journal of Chemical Education

deduce1:sgl (there is at least one 'group I cation', there is no 'group I cation', there is at least one'group I1 cation') (question: 'What

can be deduced?")

I [explain: en if you have observed the presence of xecipitare, it is"

-

obvious, to deduce the presence of cations of grou ["I.

(A9 Pb Hg, Cu Rg Pb, Pb Hg Bil [question: "Which of the following cations can be foun in the ", 'precipitate?") (explain: -The group I is composed by the cations Ag. 'b2* and ~ g * " , 'whose chlorides ace insoluble in cold water").

L Figure 3. Input attributes

rule1 correct identification o f hydrochloric acid:

Welcome to the separation of metal ions in aqueous e d i a employing hydrogen sulfide as general reactant.

I f reactant

The present expert system has a definite didactical b jecrive.

then resreac

=

hydrochloric acid correct.

=

The first objective consists of investigating the ex~ t e n c eof the first group o f cations

endif. rule2

which analytic reactant would you choose?

incorrect identification o f different hydrochlori< =id: If reactant then resreac

:hydrochloric

1. sulfuric acid

2. hydrochloric acid 3. ammonium chloride 4. ammoninm carbonate

acid

incorrect.

=

endif.

= ? I incorrect

rule3 presence of group I cations:

Why? ~f appear = precipitate and

dedvcel

=

Think a bit more and try again

there is at least one group I cation

then rappear

=

correct.

endif.

m i c h ane1ytis reactant would you choose?

rule4

- ? 2

adequate identification o f no precipitate: ~f appear = nothing and

correct

d e d u c d = there is not any group I cation

Hydrochloric acid is the reactant suited to isolate the irst group of cations.

then rappear = adequate. endif.

What can you observe when addlng hydrochloric acid?

Figure 4. Rules used. 1. precipitate

Attributes are used to represent the information of a certain domain. (See Fig. 3.) Each attribute may acquire a certain value during each system run. The expert system looks for the value requested in the actions section first by looking at the conseq~enceof the rules in the rules section. The rules are elaborated according to the followina model: IF... and ... THEN... and.... A rule-of this kind shows that supplying the antecedent determines the consequence. In our case (Fig. 4) it can be seen how the value (correct or inwrrect) can be inferred from rule 1and rule 2. Because "reactant" is the unknown attribute in both cases, the systemlooks for the value ofthis antecedent attrihute. This is an input attribute not linked by rules to any other attribute, so the system asks the end user (students) the question set up in the attributes section: "Which analytic reactant would you choose?" The student must choose one answer amone the four ~ossiblevalues: hydrogen . - sulfide, hydrogen chloride, ammonia chloride, and ammonium carbonate. By chosen methodology, the selection of the reagent is rigid and must be camed out in a perfectly established sequential order. Thus, no uncertainG is introduced in the answers, and there are no probability figures assigned to the different values. If the selected value of attribute reactant is correct. the svstem follows the procedure to separate the ions specified & the command i f the actions section. (See Fie. 2.) If the selected value is wrong. the system zives the stuYdent a sewnd opportunity to answer. ~&eove, where t h e user types x r without the brackets. Suggested Exercises The X-rav crvstallorrra~hiccoordinate data of methyl gibberellac di-&brom;be&oate a r e given in gibbate.x&, which is included i n all packages of STR3DI.ZIP. However, the command enables STRSDI to accept X-ray data. The data for this target compound can be entered into a file named "gibbateO.xxsn and automatically stored in the subdirectory \str\xray. The structure can be moved about by to provide the most suitable profde. This profile can automatically in be saved by as "gibbatel.xxsX \str\xray. Examination of t h e structure on-screen shows t h a t t h e ladone's a l k y h x y g e n bond was not reproduced, because this bond length is outside the normal range for G O single bonds. The experimenter should do six things. 1. Compare the G O distance of the "missing" bond to the average C-O bond length value of 141pm. 2. Measure the length oftbe ladanic G C O bond. Then measure the band angles at the carbon to which the lactonic oxygen should be bonded. Compare these values to their respective norms. 3. Measure the bond lengths of the aromatic ring of one of the bromabenzoate ester groups, listing them in tabular form. Calculate the percent variation of their bond lengths from the norms. 4. The molecule contains three ester groups. Compare the lengths of the alkyl-oxygen bonds, the carbanyl C=O bonds, and

884

Journal

of Chamlcal Education

~

~

~~~~

Trends in variation of the bond angles shows that many atoms a r e i n motion during cyclization. The structure derived by modelling m u s t undergo other geometrical changes for a minimum energy shape. If possible, subject to the MMX fdes of the structure. saved as bc3210et.s~~. minimization by MMX.EXE a d compare the resultkg structure with the startine structure. The results a r e m i t e interesting.

-

Acknowledgment The author wishes to thank The City College of C.U.N.Y. for the funds used to purchase a math coprocessor (8087) and a modem.

%x, V. G.S. Hetemcycleg 1990, 17, 1 157. 5Hattsuck,J. A,; Lipscomb, W. N. J. Amer. Chem. Soc. 1963, 85, 3414.