Skip to main content

Expert system: use of CLIPS software to evaluate solar energy for residences and businesses


The use of energy is important in all sectors, considered essential in industrial, commercial and residential activities. In view of this and the environmental problems caused by energy sources with fossil fuel origin, methods of energy production with renewable sources have been increasingly addressed. Studies that estimate the impact and evaluations of solar technologies in homes are scarce. In this sense, the applied method addresses the use of CLIPS for the development of a knowledge base for preliminary diagnosis and evaluation of solar energy for homes and businesses, thus obtaining a prototype of an expert system, the method also approaches the use of artificial intelligence with a heuristic characteristic and its target audience is people with little or no knowledge in the area, thus contributing to the social impact. As a result, the developed programming helps people with little or no knowledge about solar energy and its residential application to have access and thus verify the applicability. It is worth noting that this is the first empirical study carried out in Brazil, a country of crucial importance for the development of solar energy.


The use of energy is important in all sectors, considered essential in industrial, commercial and residential activities. In view of this and the environmental problems caused by energy sources with fossil fuel origin, methods of producing energy with renewable sources have been increasingly addressed and, as it is a sustainable source, it is highly promoted due to its environmental privileges, as it does not emit harmful gases such as carbon dioxide, contributing to the slowdown of global warming. Research, development and continuous improvement of renewable energy technology are essential to increase energy efficiency for beneficial use in all consumer segments (Dincer and Ezzat 2018).

The residential sector is an undefined energy reservoir due to a wide variety of structure sizes, geometries and widely varying consumption behavior (Swan and Ugursal 2009). In order to ensure the stability of the electrical network, reduction of energy use in this sector, in addition to other factors, an optimized management of all energy resources is discussed, according to the requirements and preferences of end users. In the future, the widespread use of Smart Residence Energy Management System will significantly increase and change the way electricity is used. Among the management attributions, there is the need to restrict energy demand and the exploitation of energy efficiency (Joelsson and Gustavsson 2009; Martinez-Pabon et al. 2017).

The implementation of residential energy management started in the 80’s and was based on an optimized energy management algorithm in order to reduce the cost under a price structure in relation to the time of use and in the consideration of the operational size, type of equipment and process, geographic location divided into levels of management functions (basic, advanced and total) (Capehart et al. 1982; Rahman and Bhatnagar 1986). In more recent studies on energy management systems in the residence, in a residence with an aspect of smart consumption, there are connections of appliances, smart meters, thermostats and other devices through a network that balances energy demand and reduces the costs (Martinez-Pabon et al. 2018; Beaudin et al. 2012; Siano 2014).

As a support for the application of Energy Management Systems in Residences, such as the control and monitoring of various residence appliances, artificial intelligence has been explored. Some examples of artificial intelligence techniques applied in this segment are based on artificial neural networks, fuzzy logic control, adaptive neuro fuzzy inference system and expert system (ES) (Shareef et al. 2018). In the present article, the expert system (ES) was used in view of the data obtained meeting its requirements for better extraction and inferences of the information obtained.

As a way of contextualizing, Expert Systems are computer programs that mimic the behavior of human experts within a specific domain of knowledge, based on heuristic processes. The objective of Expert Systems is to obtain the knowledge accumulated during the entire professional life of an expert or several experts, represent this knowledge in a base and transmit it to the end user (Matelli 2008).

In this sequence, as detailed above, with the review in the literature and in relation to the Brazilian context, the application of techniques to optimize energy management systems in the residential and commercial sector is still incipient, thus showing an opportunity to study with the use and application of artificial intelligence methods.

In the study by David et al. (2021) the authors identified, through a qualitative research, potential aspects for the implementation of photovoltaic systems in homes, which were six (“Lack of knowledge about the topic”; “Lack of priority”; “Cultural”; “Standardization of standards”; “Lack of influencers” and “Costs”). Two aspects “Lack of knowledge about the topic” and “Cultural” refer to the motivation for this article, as a way to demystify these two aspects by building an expert system whose end user is a person who is completely unaware of the topic of solar energy, contributing to the accessibility for any individual. There is a lot of research involving calculations, technology development as a way to reduce costs, for example (Wang and Hasani 2022; Shen et al. 2023), but the lack of practical and social study is little observed (Mabvutoa et al. 2017; Yeison Alberto et al. 2021), which is the main motivation for this article.

In this sense, the objective of this article is to develop a prototype of an expert system, equipped with an explanation generation module, for preliminary diagnosis and evaluation of solar energy for residences and businesses.

Photovoltaic solar energy

The solar energy technologies provide solutions to the growing need for clean energy to mitigate climate change and improve air quality. During the last few years, the use of solar energy has progressed strongly, thanks to the impressive development of photovoltaics, which has become one of the most cost-competitive energy technologies. The source is becoming the lowest cost option for electricity generation in most parts of the world, which should drive investment in the coming years. As the markets for the various solar energy systems increase, studies and research in the area also develop (IEA 2021).

The number of residences that rely on solar photovoltaic energy is expected to grow to more than 100 million by 2030, for comparison, the 2022 data is 25 million in the Zero Net Emissions Scenario by 2050. At least 190 GW will be installed from 2022 each year and this number will continue to increase due to increased competitiveness and growing appetite for clean energy sources. The cost of solar equipment and installation has dropped by more than 80% over the past decade as has business models entered to complement the purchase of a PV system, offering rental or leasing options that provide additional maintenance services and, in some cases, combined with electricity bills (IEA 2022).

Related to this concept, studies on solar energy are increasingly under development, such as the work of Luo et al. (2019), in which an improvement was developed in the residence energy management system. The authors proposed a way to program domestic energy resources in an environment with photovoltaic solar energy on roofs. Ahmed et al. (2021) performed a method to analyze the effect on the cost curve of the load consumed with the integration of photovoltaic solar energy in the smart residential energy management system. The problem was modeled with an algorithm to program residence appliances with and without the availability of photovoltaic solar energy sources. In another study that addresses the issue of technical and market potential in Brazil, the technical being defined as the maximum amount of electric energy generated if the entire usable area of ​​roofs of Brazilian residences were covered by photovoltaic systems and the market was defined as that the amount of electricity produced is economically viable by photovoltaic systems sized to meet only the average annual monthly consumption of Brazilian households (under current financing conditions), the authors estimated that the Brazilian technical potential is approximately 772 TWh per year, and the market potential is approximately 48 TWh per year (Santos and Lucena 2020). In this research segment, several facilitators and optimizers for the total efficiency of the solar energy system have been created, as in the study by Ha et al. (2017), in which the authors optimized the total energy costs in an operational model of a hub of energy in a residential area. In addition to the usual way of installing photovoltaic solar energy, in which the consumer uses around 95% of their energy demand for this renewable source, there are hybrid ways that combine some types of generation, this was analyzed in the work of Li et al. (2019). Still in the same segment of the hybrid model, in a study a pilot project of a residential smart grid was developed. The analysis is based on detailed monitoring data measured at 5-min intervals. In this pilot, smart appliances, heat pumps, micro heat and power combination, and solar photovoltaics were installed to assess their efficiency, their ability to reduce peak electricity purchases, and their effects on self-sufficiency and local use of solar electricity. In another study that also addresses hybrid models, it was possible to infer that the proposed system can achieve energy and exergetic efficiencies of 71.8% and 40%, respectively, through the analysis of a multigeneration energy system integrated with nature, based on solar photovoltaic for residences (Karaca and Dincer 2020).


Regarding the type of approach used in the work, the heuristic approach was chosen for the search for solutions, which requires representation of specialized knowledge to be implemented computationally in a knowledge-based system. The essence of this approach lies in the application of selective patterns that reduce the dimension of the problem and can be used to simulate the decision pattern of human beings. The decision rules of the experts were identified through questionnaires and interviews and with the use of concepts correlated with the research area researched.

Regarding the motivation for this study, which is given by the base work of David et al. (2021), six aspects (“Ignorance about the topic”; “Lack of priority”; “Cultural”; “Standard standardization”; “Lack of Influencers” and “Costs”) Most relevant divided into two groups (Internal Factors and External Factors) of ranking were discovered. The Fig. 1 exemplifies the relative priority of the group of internal factors.

Fig. 1
figure 1

(Source: David et al. (2021))

Relative priorities: internal factors

In this sense, two aspects “Ignorance about the subject” and “Cultural”, motivated the present work as a way to demystify these two aspects by building an ES that has as an end user a person who is completely unaware of the solar energy theme, contributing to accessibility of any individual.

Knowledge based systems

Knowledge-based systems structured by an explicit model of knowledge aimed at solving problems have been the subject of many successful Artificial Intelligence researches because of the knowledge being represented in the form of rules or objects (Py 2006). They are systems that apply automated reasoning mechanisms for the representation and inference of knowledge. These systems are often identified as simply “applied artificial intelligence” and represent a broad class of applications of which all others would roughly be subclasses. There are some formalisms that can be used to model knowledge, such as production rules, case-based reasoning, neural networks, probabilistic networks (Py 2006).

It is worth noting that artificial intelligence is divided into three independent research areas. Some scholars are concerned with developing computer programs that read, speak, or understand the language people use in conversation, known as natural language processing. Another area works with the development of intelligent robots. And the third area of research develops programs that make it possible to use the knowledge of experts through software that allows the storage and sequencing of information and self-learning, known as Expert Systems (Py 2006).

Expert system

An ES is an artificial intelligence technique that can solve specific tasks in a knowledge area, supposedly with the same quality as a human expert. In contrast, common programs such as payroll programs, word processors, spreadsheets, computer games, and so on, are not intended to embody human experience or knowledge. The ES uses specialized knowledge (which may contain traces of uncertainty) to solve complex problems, with intellectual performance comparable to that of a human expert in a specific domain (Giarratano 1996).

In order to obtain a correct functioning of an SE, the program used to approach it has to be supported by specific data and guided to execute certain patterns, elaborated through knowledge bases obtained by one or more experts of the area to which the problem is addressed relates. The knowledge base and the rule base must be structured in a complete and correct way to be later simulated in such a way that, in the end, the ES is able to offer suggestions and indications to users and, also, acquire new knowledge and heuristics with the interaction. In short, the system needs to have a knowledge base, made up of facts, rules and heuristics about the domain. It is worth mentioning that an ES can be applied in the most diverse areas of knowledge, such as: engineering, agriculture, information technology, chemistry and electronics (Py 2006; Figueiredo 2011).

The tool used to build the ES in this study is CLIPS, which was developed at NASA’s Johnson Space Center from 1985 to 1996, the C Language Integrated Production System (CLIPS) is a rules-based programming language useful for creating expert systems and other programs where a heuristic solution is easier to implement and maintain than an algorithmic solution. Written in C for portability, CLIPS can be installed and used on a wide variety of platforms. Since 1996 CLIPS has been available as public domain software (Giarratano 1996).

A rules-based ES written in CLIPS is a data-oriented program where the facts and objects are the data that stimulate execution through the Inference mechanism. For comparative purposes, a complete dataset is much more important in an ES than in languages like Java, C, Ada, because the rules of an ES are usually not executed sequentially. CLIPS helps the programmer to write descriptive facts like this through standard templates (Giarratano 1996).

The expert systems are composed of three parts: the Knowledge Base, where the facts and rules used in the resolutions are stored, in this part it is possible to insert new data or change old data; Inference mechanism, device that performs queries in the knowledge base generating the answers, compares the knowledge base rules with the information provided by the user, examines the content deciding the order in which the inferences are drawn, thus, the inference mechanism conducts the query with the user, transferring the facts and rules used during a query to working memory; and the User Interface, a source of user interaction. Where questions are presented to the system and answers/outputs are obtained.

A relevant factor of expert systems is the aggregation of knowledge from more than one expert on the same subject, and in this case without the physical and emotional limitations consumed by humans. As an advantage, there is the speed of determination of consistent solutions for a given problem, preservation of knowledge, stability, improvement of process efficiency and inhibition of interpretation problems, which are also considered decisive in systems.

Research delimitation

In view of the diversity attributed to the research topic, the work was limited to the managerial and theoretical analysis of the implementation of photovoltaic systems in homes and businesses with a focus on two aspects: the first was limited to carrying out a literature review of highly relevant articles, in institutional sources of the Brazilian government and the information and data obtained with the distribution of questionnaires to experts.

The selection of the consumer profile would initially be limited to all the profiles of GROUP B (Low Voltage consumer units, Residential (Subgroup B1), Rural (B2), Other Classes (B3) and Public Lighting (B4) and from GROUP A (High Voltage consumer units (Subgroups A1, A2 and A3), Medium Voltage (Subgroups A3a and A4), and underground systems (Subgroup AS). With the development of the research, it was inferred due to the data collection that would be necessary and the knowledge obtained from the experts, that the groups selected for this work would only be GROUP B, limited to the following subgroups: Low Voltage consumer units, Residential (Subgroup B1), Rural (B2) and Other Classes Classes (B3).

Regarding the type of approach used in the work, the heuristic approach was chosen for the search for solutions, which requires representation of specialized knowledge to be computationally implemented in a knowledge-based system. The essence of this approach lies in the application of selective patterns that reduce the dimension of the problem and can be used to simulate the decision pattern of human beings. The experts’ decision rules were identified through questionnaires and interviews and with the use of concepts correlated with the area of research researched.

With regard to social classes, in Brazil the methodology applied by the Brazilian Association of Research Companies (ABEP) is used, which is based on the Family Budget Survey (POF) divided into five income ranges or social classes, being A with 2.80% share, B with 21% share, C with 48% share, D and E with 28.50% share. In this work, it was decided to delimit by classes C and D. To include classes A and B, factors that would not make any relevant contribution to the objective of the present work would need to be addressed, and class E does not have the necessary characteristics for the study.

Development of the ES prototype

Acquisition of knowledge

Regarding energy legislation, Brazil is governed by the National Electric Energy Agency, ANEEL, being responsible for the guidelines that energy concessionaires must follow. As there is a lot of diversity throughout the national territory (geographic, environmental, economic aspects), different types of tariff modality are applied to suit local consumer demand.

There are tariffs A and B, with A for higher power transformers for medium and high voltages (between 112.5 and 1000 kVa) and B for low voltage consumers (transformers from 15 to 75 kVa). Within these two categories there are several characteristics (ANEEL 2022).

The consumers who use the group A modality have binomial pricing, which are charged for the energy they consume in kWh/month and for the contracted power (the contracted demand in kW). For group B consumers, there is monomial pricing, which are charged only for the energy they consume in kWh/month, regardless of power.

The Group A consumers have 3 tariff modalities (conventional binomial): Green Hour and Blue Hour, which are focused on usage in relation to consumption time. This binomial pricing is characterized by demand of less than 150 kW (when there are values greater than this amount, it is mandatory to choose an hourly tariff) and by differences in kWh billing, which differs in reaction to peak and off-peak (use at specific times in the day). In addition to the values corresponding to peak and off-peak, there is the specific value of contracted demand, which will depend on the correct dimensioning and control so that this amount is not exceeded and generates fines for the consumer (ANEEL 2022).

There are also some cost reductions from some profile frameworks such as in the rural class, group A 10%, Group B 60%, irrigation 70 to 90% in Group A and 60 to 73% in Group B. In the irrigation framework (commonly used in the Northeast) depending on other factors such as negotiations with the concessionaire itself, there may be even more discount, which can be 98% in a certain time reserved for consumption (ANEEL 2022).

In order to provide a basic example, we take as an example a consumer of group B, modality B2 (pumping water for irrigation) which has an average consumption of 6000 kWh/month. In the agreement made by the concessionaire, of these 6000 kWh/month he consumes 2600 kWh/month at the reserved time, at that time the kWh costs US$ 0.019. Therefore, he will pay US$ 385.36 (referring to 3400 kWh/month outside the reserved time, 3400 × US$ 0.11) and US$ 48.13 (referring to 2600 kWh/month within the reserved time, 2600 × US$ 0.019).

Knowledge engineering

Knowledge engineering provides guidance on when and how to apply specific knowledge presentation techniques to solve specific problems, has been around for decades and has achieved results that are useful for knowledge management. Knowledge management facilitates obtaining, storing and disseminating knowledge using information technology. Methods to manage knowledge have become a relevant issue and knowledge management has developed a wide range of technologies and applications for both academic research and practical applications (Lai 2007; Wielinga et al. 1997).

The first and most important lesson that can be learned from knowledge engineering is that the level of knowledge is the right level to describe knowledge. Although aspects such as accessibility, learnability and usability of knowledge are important properties of knowledge in a knowledge management context, the most important aspect of knowledge in knowledge management is its content and not its representation or implementation. The grain size used to describe knowledge in knowledge management may vary according to the scope and objectives of management activities, but will undoubtedly be larger than the grain size used for knowledge engineering. In knowledge management, notions of collections of concepts, facts, rules, procedures are normally used instead of individual knowledge elements (Wielinga et al. 1997). In knowledge engineering, some principles are established (Shadbolt and Milton 1999):

Principle: recognize that there are different types of knowledge. Philosophers have been thinking about knowledge for thousands of years. Part of their effort has been to identify different types of knowledge. One distinction is between declarative knowledge (knowledge of facts) and procedural knowledge (knowledge of how to do things). A popular way of thinking about this is the difference between “knowing that” and “knowing how” (Ryle 1949). This distinction has long been recognized and used in psychology. In knowledge engineering, these two types are often called static knowledge and dynamic knowledge.

Another well-known classification of knowledge is that of tacit knowledge (cannot be articulated easily) and explicit knowledge (can be articulated easily). A particularly important way of classifying knowledge is the extent to which it is abstract (applies to many situations) or specific (applies to one or a few situations). The field of logic has also inspired other important types of knowledge: concepts, attributes, and values.

Principle 2: recognize that there are different types of experts—and expertise. Not only are there different types of knowledge, but there are different types of experts. It is important to identify the different types of specialists involved in a project and adapt methods accordingly. The difference between knowledge that can be articulated easily and knowledge that cannot be articulated easily is a very important distinction for both knowledge engineering and knowledge management. Psychologists and knowledge engineers have found that experts vary in how well they can articulate their knowledge. This is because the nature of experts’ knowledge varies according to their training and experience.

There are different types of experts, from those whose knowledge of a domain is almost completely tacit, to those whose knowledge is almost completely explicit. In addition to differences in the ability to articulate knowledge, experts vary in how well they remember information in a given context. Studies in psychology have repeatedly shown that experts are not able to remember the same things during interviews as they do when performing a task. Furthermore, the ability to recall the same information on different tasks may vary between individuals. For example, those with experience teaching others in a classroom are generally better at explaining their knowledge than those without such experience. Another point is that experts can vary in the validity of the knowledge they can articulate, people are biased and error-prone when trying to explain something: they try to maintain a good impression or show off, they rationalize or misinterpret what happens. In view of this, knowledge engineers have created various methods to overcome these problems, such as aggregating knowledge from multiple sources and validating knowledge across sources.

Principle 3: recognize that there are different ways of representing knowledge. One of the great achievements of the field of artificial intelligence is the production of a range of forms of knowledge representation. Explanations of these representations include various forms of logic, rules, and semantic networks. Producing different representations of knowledge is an important part of artificial intelligence, since the ease of solving a problem is almost completely determined by how the problem is conceptualized and represented. The same can be said for the task of communicating knowledge. A well-chosen analogy, anecdote or diagram can make all the difference when trying to communicate a difficult idea to someone, especially someone who is not an expert in the field.

Principle 4: recognize that there are different ways to use knowledge. People use knowledge in different ways depending on the task they are doing. Various ways of classifying tasks have been created in knowledge engineering. One classification, adapted and refined from ideas in psychology, is a hierarchy of knowledge-intensive tasks based on the type of problem being solved. Knowledge engineers have created models that define the type of knowledge that form the inputs and outputs of the task, as well as how the knowledge is transformed to satisfy an objective or set of objectives. This can not only increase the efficiency of task analysis and process modeling, but also allow you to identify how the same knowledge is used differently depending on the context in which it is used.

Principle 5: use structured methods. This principle follows the first four. It is shown that there are different types of knowledge, different types of experts, different ways of representing knowledge and different ways of using knowledge. Therefore, a way is needed to relate these types of knowledge, experts, representations, and tasks together to carry out a knowledge-driven activity. For this, well-defined methods are needed: structured methods so that the correct techniques and tools are used depending on the situation and, mainly, the objectives involved. Using these methods, no one will try to interview experts about knowledge they cannot articulate or represent it in a way that no one will understand, for example.

Selection of experts

The selection of experts was based on the definition of a profile in which several criteria were necessary (David et al. 2021). In this sense, the characteristics of the five selected experts were elaborated for this work. In order to obtain in-depth information from empirical knowledge, the choice of this group was considered crucial for the development of this work. Some characteristics for the selected profile were specified, such as: the positions held by experts who are in companies that install photovoltaic systems connected to the grid; members of associations that represent and promote the Brazilian photovoltaic sector in the country, such as the Brazilian Photovoltaic Solar Energy Association (ABSOLAR); or by people who have proven experience in the researched area, but with a focus on management. As secondary characteristics, we have: experience in the area of more than 5 years; be available to respond to the survey in a timely manner, understanding and passing on the required information.

Document processing

Once the expert selection process was finalized, the next step was to establish a schedule of meetings and methods for transferring data, information and knowledge, which would enable all five experts to participate.

Two independent surveys carried out in the work of David et al. (2021) were used as a basis for the preparation of this work. According to David et al. (2021), both surveys were applied separately through questionnaires to the same group of experts. The objective was to gather information about potential aspects for the implementation of photovoltaic system in residences. The questionnaires were submitted to the experts through the application of the Survey Monkey tool (, through which a specific access link was sent to each of them through e-mails. The return of information was collected directly by the platform, tabulated and then analyzed, aiming to prepare material for the other stages of the research.

In the first stage of this work, each experts in the group gathered additional information from the solar energy sector in the residences and industries they work with (consumptions, demands, project characteristics) with the objective of providing an understanding and general alignment to the knowledge engineer. This information allows the knowledge engineer to plan the direct approach with the experts, as well as to align their information.

In this process, the following analyses stood out: consumption according to the characteristics of each region; from the experts' comments regarding the aspects raised in the work by David et al. (2021), analysis of the change of tariff modality, characteristics of physical and climatic conditions at the installation site (technical visit).

The result of this step was the elaboration of a general report containing the consensus of the group of experts and Knowledge Engineer in the light of the acquired knowledge. Part of the content of this report was used by the knowledge engineer to form the knowledge base of the ES prototype.

Direct approach

Based on the preliminary report that was prepared in the document processing, the Knowledge Engineer starts the process of interviewing the experts with the aim of obtaining the knowledge and explanation that each expert presents to solve a specific problem. Thus, structured (on a specific subject) and unstructured (generalized questions) interviews were conducted. At the end of the interviews, a summary of this knowledge was obtained. This summary was sent to all experts for approval. The result of this work was the elaboration of the general report, which was passed on to the group of experts for collective analysis and establishment of a consensus. This type of approach is important to avoid any misinterpretation.

During the interview process, questions such as:

“Identification of the most important marketing, legislative, environmental, social and economic aspects of photovoltaic solar systems in homes: “Lack of knowledge on the subject”; “Lack of priority”; “Cultural”; “Uniformization of norms”; “Lack of influencers” and “Costs”. Question: In your opinion, is there any comment that is pertinent about solar energy in residences or industry related to the aspects discovered in the first study (David et al. 2021)? Additional comments.

Question: As a specialist in the field of solar energy, what questions should be asked to be viable and favorable to install solar energy in residences and/or industries? (Questions can be related to any topic in the researched area. If possible, detail or comment on the question you expose)”.

Observational approach

Another technique used during the knowledge acquisition process was the observational approach through scheduled visits to each of the experts while designing the photovoltaic solar systems. In these visits, the knowledge engineer can analyze the experts developing activities and request an explanation of each process.

The characteristics and decisions made by the experts in the knowledge engineer’s points of interest were raised. This type of approach allows a detailed review, together with the experts, of the procedures and knowledge demonstrated or verbalized by him/her, avoiding imprecision or superficiality in the transfer of knowledge.

A summary of the knowledge gained through the observational approach was written by the knowledge engineer and sent to the experts for approval. The result of this work was the inclusion of additional knowledge to the previously prepared general report, which was once again passed on to the group of experts for collective analysis and consensus building.

Meetings with experts

Throughout the process of acquiring knowledge, several meetings were held with the experts, these being individual. Communication via e-mail was also used, as well as face-to-face meetings, enabling the exchange of information in order to formalize the process and create traceability and transparency.

All the techniques presented in this section made up the knowledge acquisition process of the present work and it is summarized as follows:

  • Document processing: each expert was personally interviewed. The result of this session was validated individually by the experts. In total, five personal interviews were conducted.

  • Direct approach: each expert was personally interviewed twice, one of which was structured. In total, ten interviews were carried out with the experts.

  • Observational approach: each expert was also observed once performing activities in their workplace. In total, five observation sessions were carried out, one for each expert.

Approximately 105 questions on different topics of the project review process were raised. These questions were divided into groups and subgroups, as there were differences between specific characteristics.

The main groups of structured questions were:

  • Group A—energy consumption characteristics (adequate consumption range, intention to increase energy)

  • Group B—maintenance (cleaning, replacement of solar inverter)

  • Group C—general information about processes that experts carry out

  • Group D—information on change of tariff modality

  • Group E—characteristic of tariff flags (additional to the energy bill at a certain time of year)

  • Group F—characteristics of tariff modalities in different regions of Brazil

  • Group G—availability cost characteristic

  • Group H—sale of surplus solar energy (new law)

  • Group I—characteristics on physical conditions of the installation site

  • Group J—features about solar system payment

  • Group K—information on lessons learned

  • Group L—specific questions.

In the personal interviews, the new ideas obtained were included in the next questionnaire to improve the entire process. A reduction in the number of personal and additional verification questions was observed for the created groups. At the end of the knowledge acquisition process, the knowledge representation stage was developed with a view to implementing the knowledge base of the ES prototype.


For this study with regard to knowledge representation, the rule set mechanism was used, which is identified as the knowledge base. Therefore, the tool used for the development of the knowledge-based system was CLIPS, which is a rules-based programming language useful for creating expert systems and other programs where a heuristic solution is easier to implement and maintain than a algorithmic. Written in C, CLIPS can be installed and used on a wide variety of platforms. Since 1996 CLIPS has been available as public domain software (Giarratano 1996).

CLIPS is an ES tool originally developed by the Software Technology Branch (STB), NASA/Lyndon B. Johnson Space Center, and is designed to facilitate the development of software to model human knowledge or experience. There are three ways to represent knowledge in CLIPS: (1) Rules, which are primarily intended for experience-based heuristic knowledge; (2) Deffunctions and generic functions, which are primarily intended for procedural knowledge; and (3) Object-oriented programming, also aimed primarily at procedural knowledge. The five generally accepted features of object-oriented programming are supported: classes, message handlers, abstraction, encapsulation, inheritance, and polymorphism. Rules can combine patterns in objects and facts (Giarratano 1996). In CLIPS, the knowledge engineer can develop software using only rules, only objects or a mixture of objects and rules, in this work we used a mixture of objects and rules, which form an integrated system, as the rules can combine patterns in facts and objects.

In the diagram of Fig. 2, it is possible to identify how the knowledge base is characterized in CLIPS. It is represented by the set of facts (the set of rules relate and manipulate these facts, the chain of rules forms a chain of inference that allows to derive a conclusion from a set of premises or facts); rules that are IF–THEN structures of which the syllogism is a particular case; and the rule relationship model is called the inference mechanism (it is worth mentioning that the inference mechanism proposed by CLIPS itself was used in this study). Therefore, a conclusion can only be obtained from such characteristics and thus generate a model of logical relationships between the rules capable of establishing a chain of inference (or line of reasoning).

Fig. 2
figure 2

(Source: Matelli (2008))

Knowledge base features

Still in the same segment, there is Fig. 3, which is a more detailed schematic of a knowledge-based system. It is possible to verify some sets such as the knowledge base, where the rules are represented and that are long-term, over time this base is only fed more and more to measures that new knowledge is being acquired, it is about the incremental development (for this set it is usually said that it is never finished but improved). There is a working memory, where the facts are kept and they are short-term because you tend to forget after a while. It has the inference mechanism, associated with the CLIPS schedule. A knowledge acquisition module that is not used much for validation reasons, as it automatically creates the rules. There is also a super relevant item that is the explanation generation module, which addresses the understanding of why a specific rule was activated and generated a conclusion from it. And finally, the user interface, where all interaction with CLIPS is addressed. In the following paragraphs an applied example of the study of each mentioned item is shown.

Fig. 3
figure 3

(Source: Matelli (2008))

Knowledge-based system

Rules in Clips must be in parentheses as should each of the default rules and actions. An action is actually a function that normally has no return value, but performs some useful action, such as an (assert) or (retract). Figure 4 shows an example of a rule applied in the form of prioritization of the payment method of the photovoltaic system. In this rule, there are options for cash payment or financed payment and from this information entered by the user, the inference is generated based on the characteristic.

Fig. 4
figure 4

Example of an applied rule

The symbol “” that follows the patterns in a rule is called an arrow, in the example of Fig. 4 it is exemplified in the seventh line. The arrow represents the start of the THEN part of an IF–THEN rule (and can be read as “implies”). The part of the rule before the arrow is called the left side (LHS) and the part of the rule after the arrow is called the right side (RHS). If no default is specified, CLIPS automatically activates the rule when a (reset) command is entered (Giarratano 1996).

The Fig. 5 shows how the facts are represented in the CLIPS window. In this study, six entries were included. This is an applied example because facts are dynamic information. Facts are one of the basic high-level ways to represent information in a CLIPS system. Each fact represents information that has been placed in the current list of facts, called the list of facts. Facts are the fundamental unit of data used by rules (Giarratano 1996).

Fig. 5
figure 5

How facts are represented in the CLIPS window

Facts can be removed or retracted. When a fact is retracted, the other facts do not have their indexes changed, and there may be indexes of “missing” facts. As an analogy, when a football player leaves a team and is not replaced, the shirt numbers of the other players are not all adjusted because of the missing number (Giarratano 1996). Like the example shown in Fig. 5, the facts used were the <f-0>, <f-3>, <f-6>, <f-8>, <f-13>, <f-16> , <f-18 > e <f-19>.

And finally, the schedule, which is characterized by the collection of activations that are those rules that match standard entities (zero or more activations can be in the schedule). When multiple activations are on the schedule, CLIPS automatically determines which activation is appropriate to trigger. CLIPS orders the activations in the schedule in terms of increasing priority or salience. In Fig. 6 we have an example of three active rules in the CLIPS schedule.

Fig. 6
figure 6

Example of three active rules in the CLIPS schedule

Regarding the inputs used in the knowledge-based system, the Fig. 7 identifies each aspect and its secondary relationships. The consumer “PROFILE” interacts with the tariff “MOBILITY” and has the options “B1”, “B2” and “B3”; the “SOCIAL CLASS” aspect and the “D” and “E” branches; the “TARIFF” aspect; the “CONSUMPTION” aspect, which can be “LOW”, “MEDIUM” and “HIGH”; the tariff "FLAGS" characterized by “GREEN”, “YELLOW”, “RED 1” (level 1) and “RED2” (level 2); and finally the “PAYMENT”, being “CASHDOWN” or “FINANCED”.

Fig. 7
figure 7

Inputs used in the knowledge-based system

Object orientation

The base program of this study, CLIPS, is called the ES tool because it is a complete environment for developing expert systems that includes features such as an integrated editor and a debugging tool. In this sense, we have the word shell, which is reserved for that part of CLIPS that performs inferences or reasoning. The CLIPS shell provides the basic elements of an ES: (I) list of facts and list of instances: global memory for data; (II) knowledge base: contains all the rules, the rule base; and (III) inference mechanism: controls the general execution of rules (Giarratano 1996).

It is worth mentioning that the knowledge related to the objective of the work, to develop an ES prototype for preliminary diagnosis and evaluation of solar energy for residences and businesses, is represented in the form of rules and object orientation and that synthesis problems naturally present direct chaining, the chosen shell is CLIPS.

The object orientation used in the study is characterized as a programming paradigm that allows the implementation of knowledge represented through frames and semantic networks, which facilitates the management and expansion of computational code and can also serve as a way of representing knowledge. It is based on four fundamental concepts: Abstraction; Heritage; Polymorphism and Encapsulation.

Abstraction: encompasses the choice of classes and respective attributes and procedures relevant to the representation of knowledge. Thus, an object is a model of some real-world entity, which are represented through classes, a class is described by a collection of attributes and procedures, and a specific object of a class is an instance of it. An object in CLIPS is defined as a symbol, an expression (string), a decimal number (a floating-point), an integer number or a multifield value.

In the present study, the classes were divided as follows (Fig. 8): the attributes “modality”, “tariff”, “social class”, “payment”, “tariff flag” and procedure being the exit “indicator”. For this syntax, the objects of “SYMBOL” and “FLOAT” were used in the attributes.

Fig. 8
figure 8


Inheritance: classes can be hierarchized into superclasses, classes, and subclasses. A subclass inherits procedures and attributes from its parent class. The same happens with attributes: those defined in the superclass are inherited by the subclasses; those specific to the subclass are restricted to it.

Polymorphism: characterized by inherited procedures that can take different forms in different classes, in other words, polymorphism is the ability of different objects to respond to the same message in a specialized way.

Encapsulation: it is the restricted validity of a procedure in the context of a class, the form that the same procedure assumes in the context of a class is valid only in this context. Thus, if any procedure is modified, it does not affect the procedures of the others. The procedures, indicators in this study, are encapsulated, meaning that they are valid only in the context of the class in which they are defined, which helps to facilitate management and any subsequent change or inclusion in the code.


CLIPS has windows for communicating with the user. The Fig. 9 shows the facts window (facts MAIN); the instances window (instances MAIN) displays objects and attributes, there is also a global window (globals MAIN) that registers global variables, those that have validity that transcends the context of the rules.

Fig. 9
figure 9

(Source: Giarratano (1996))

Facts, instances and globals windows in CLIPS

There are also two important windows, the dialog window and the agenda (MAIN agenda) (Fig. 10). The schedule is the list of all rules that have their conditions met (and have not yet been executed). Each module has its own agenda. The schedule works similarly to a stack (the schedule’s main rule is executed first). When a rule is recently activated, its placement on the schedule is based (in order) on the following factors:

  1. a)

    Newly activated rules are placed above all rules of lesser relevance and below all rules of greater salience;

  2. b)

    The actions on the right side (RHS) of the selected rule are performed. Using the “return” function in a rule’s RHS can remove the current focus from the focus stack. The number of triggered rules is incremented for use with the rule trigger threshold.

  3. c)

    If a rule is activated (along with several other rules) by the same assertion or retraction of a fact, and steps a and b fail to specify an ordering, the rule is ordered arbitrarily (not randomly) relative to other rules with which it has been activated. Thus, the order in which rules are defined has an arbitrary effect on conflict resolution (which is highly dependent on the current underlying implementation of the rules).

Fig. 10
figure 10

(Source: Giarratano (1996))

Windows dialog and schedule in CLIPS

Finally, there is the dialog window, in which the communication between the user and the ES prototype takes place. In order to facilitate reaching various groups of people, a simple interface was created. The UI runs on the main thread and each command entered is executed using a separate newly created thread. In the Fig. 11 shows a part of the options menu of the dialog window, the main questions. As the questions are answered, some sub-questions linked to the main question are still asked.

Fig. 11
figure 11

Dialog window created in CLIPS

In the consumption part of the options menu, the user is asked to provide qualitative information about the average consumption, whether low, medium or high (the menu itself specifies and guides the user about the range). The reference of the month is also asked for the verification of the tariff flag, the method of payment of the photovoltaic system and the tariff modality of the consumer.

Output data: proposed indicators

According to the information provided by the user, one or more indicators can be output in HTML files. Each indicator has a different description. Figure 12 shows an example of output from two indicators.

Fig. 12
figure 12

Description of indicators 1 and 13

In this sense, with the information provided by the users of the two examples mentioned, a report on the applicability of the PV solar system is generated with theoretical information about the characteristics of each consumer profile. The way of having theoretical information contributes to a more assertive understanding for the end user, in view of coming in text form and easy to understand.


This article proposes the application of an Artificial Intelligence technique called Expert System as a Knowledge Management tool. To demonstrate the adequacy of this scope, a prototype of an expert system was developed, equipped with an explanation generation module, for preliminary diagnosis and evaluation of solar energy for residences and businesses.

The system’s knowledge base was built and validated from the experience of multidisciplinary experts in the field of photovoltaic solar energy, which is certainly a valuable resource for a knowledge management context. This initial study illustrates the potential to considerably clarify energy consumers for the adoption of photovoltaic solar energy in their residences or businesses, an expert system that has as an end user a person who is completely unaware of the subject of solar energy, contributing to the accessibility of any individual.

In the area of solar energy, the technological aspects of equipment are explored in the studies, empirical studies such as this article, with theoretical results, have as a result the practical applicability for a wide group of people, thus contributing to the social impact.

As suggestions for future research, it is relevant to create the method for the industrial sector in order to expand the computer code and include new utilities and the editing and adaptation of factors for application in other countries.

Availability of data and materials

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.


  • Ahmed F, Baig F, Khattak YH (2021) Enhanced system architecture for smart home energy management system using Knapsack algorithm with integration of solar photovoltaic energy source. Appl Sol Energy.

    Article  Google Scholar 

  • ANEEL—Agência Nacional de Energia Elétrica (2022) Accessed 5 Sept 2022

  • Beaudin M, Zareipour H, Schellenberg A (2012) Residential energy management using a moving window algorithm. In: Proc. ISGT Europe. 1–8

  • Capehart B, Muth EJ, Storin MO (1982) Minimizing residential electrical energy costs using microcomputer energy management systems. Comput Ind Eng 6:261–269

    Article  Google Scholar 

  • David TM, Buccieri GP, Rizol PMSR (2021) Photovoltaic systems in residences: a concept of efficiency energy consumption and sustainability in Brazilian culture. J Clean Prod 298:0959–6526.

    Article  Google Scholar 

  • Dincer I, Ezzat M (2018) 3.5 Solar energy production. Comprehensive energy systems. Elsevier, Amsterdam

    Google Scholar 

  • Figueiredo CJ (2011) Uso de Sistemas Especialistas para a avaliação de um processo agroindustrial

  • Giarratano JC (1996) CLIPS 6.4 user’s guide

  • Ha T, Zhang Y, Thang VV (2017) Energy hub modeling to minimize residential energy costs considering solar energy and BESS. J Modern Power Syst Clean Energy 5:389–399.

    Article  Google Scholar 

  • International Energy Agency—IEA (2021) Best practices handbook for the collection and use of solar resource data for solar energy applications, 3rd edition. Report IEA-PVPS 16-04:2021

  • International Energy Agency—IEA (2022) Technology report—September 2022. Accessed 2 Sept 2022

  • Joelsson A, Gustavsson L (2009) District heating and energy efficiency in detached houses of differing size and construction. Appl Energy 86:134

    Article  Google Scholar 

  • Karaca AE, Dincer I (2020) A new integrated solar energy based system for residential houses. Energy Convers Manag.

    Article  Google Scholar 

  • Lai LF (2007) A knowledge engineering approach to knowledge management. Inf Sci 177(19):4072–4094

    Article  Google Scholar 

  • Li X, Lin A, Young CH, Dai Y, Wang CH (2019) Energetic and economic evaluation of hybrid solar energy systems in a residential net-zero energy building. Appl Energy 254:0306–2619.

    Article  Google Scholar 

  • Luo F, Ranzi G, Wan C, Xu Z, Dong ZY (2019) A multistage home energy management system with residential photovoltaic penetration. IEEE Trans Ind Inform 15:116–126.

    Article  Google Scholar 

  • Mabvutoa M, Mwansa K, Chilala KB, Numan SÇ, Koray U (2017) The potential of solar energy for sustainable water resource development and averting national social burden in rural areas of Zambia. Period Eng Nat Sci 5(1):1–7

    Google Scholar 

  • Martinez-Pabon M, Eveleigh T, Tanju B (2017) Optimizing residential energy management using an autonomous scheduler system. Expert Syst Appl.

    Article  Google Scholar 

  • Martinez-Pabon M, Eveleigh T, Tanju B (2018) Optimizing residential energy management using an autonomous scheduler system. Expert Syst Appl 96:373–387

    Article  Google Scholar 

  • Matelli JA (2008) Sistemas baseados em conhecimento para projeto de plantas de cogeração a gás natural. Tese de doutorado. Universidade Federal de Santa Catarina

  • Py MX (2006) Sistemas Especialistas: uma Introdução

  • Rahman S, Bhatnagar R (1986) Computerized energy management systems—why and how. J Microcomput Appl 9:261–270

    Article  Google Scholar 

  • Ryle G (1949) The concept of Mind. Penquin Books, Mitchan

    Google Scholar 

  • Santos AJL, Lucena AFP (2020) Potenciais Técnico e de Mercado de Energia Solar Fotovoltaica de Geração Distribuída no Setor Residencial Brasileiro. Anais CBENS

  • Shadbolt N, Milton N (1999) From knowledge engineering to knowledge management. Br J Manag 10:309–322

    Article  Google Scholar 

  • Shareef H, Ahmed MS, Mohamed A, Hassan EA (2018) Review on home energy management system considering demand responses, smart technologies, and intelligent controllers. Comput Sci IEEE 6:24498–24509

    Google Scholar 

  • Shen C, Peng J, Wang D, Pei G (2023) Recent advances in multispectral solar energy technologies for the building sector. Renew Energy 202:1146–1147

    Article  Google Scholar 

  • Siano P (2014) Demand response and smart grids—a survey. Renew Sustain Energy Rev 30:461–478

    Article  Google Scholar 

  • Swan LG, Ugursal VI (2009) Modeling of end-use energy consumption in the residential sector: a review of modeling techniques. Renew Sustain Energy Rev 13:1819–1835

    Article  Google Scholar 

  • Wang Y, Hasani J (2022) Energy generation from a system based on solar energy and fuel cell technology with the option of storing electrical energy. Energy Rep 8:4988–5004

    Article  Google Scholar 

  • Wielinga B, Sandberg J, Schreiber G (1997) Methods and techniques for knowledge management: what has knowledge engineering to offer? Expert Syst Appl 13(1):73–84

    Article  Google Scholar 

  • Yeison Alberto GG, Henao-Céspedes V, Sánchez DMG, Trujillo AAL, García NT (2021) Social impact of renewable energy systems: solar energy system in vulnerable community case study. Bull Electr Eng Inform 10(5):2337–2344

    Article  Google Scholar 

Download references


This work was supported by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior [001].

Author information

Authors and Affiliations



All authors listed have significantly contributed to the development and the writing of this article and TMD collected the generated data, participated in the study method as well as writing the article. PMSRR participated in the study method as well as writing the article. TMS participated in the study method as well as writing the article. All authors read and approved the final manuscript.

Authors’ information

The PHD student Thamyres David has extensive knowledge on the subject of the article, having some publications, some in journals of high impact factor.

David, Thamyres Machado; Buccieri, Gilberto Paschoal; Silva Rocha Rizol, Paloma Maria. Photovoltaic systems in residences: a concept of efficiency energy consumption and sustainability in Brazilian culture. Journal of Cleaner Production, vol. 298, p. 126836, 2021.

David, Thamyres Machado; Silva Rocha Rizol, Paloma Maria; Guerreiro Machado, Marcela Aparecida; Buccieri, Gilberto Paschoal. Future research tendencies for solar energy management using a bibliometric analysis, 2000–2019. Heliyon, vol. 6, p. e04452-10, 2020.

The PDH Paloma Rizol has years of experience in scientific research and, among various activities in the area, develops research involving applications of Artificial Intelligence in the area of Engineering. She also has publications in high-impact journals.

Paula, M. R.; Rizol, Paloma M. S. Rocha; Matelli, J. A.; Balestieri, J. A. P.; Mattos, C. R.; Dias, Rubens Alves. Energy education: reflections over the last fifteen years. Renewable & Sustainable Energy Reviews, vol. 141, p. 110845, 2021.

David, Thamyres Machado; Buccieri, G. P.; Rizol, Paloma M. S. Rocha. Photovoltaic systems in residences: a concept of efficiency energy consumption and sustainability in Brazilian culture. Journal of Cleaner Production, vol. 298, p. 126,836, 2021.

David, Thamyres Machado; Silva Rocha Rizol, Paloma Maria; Guerreiro Machado, Marcela Aparecida; Buccieri, Gilberto Paschoal. Future research tendencies for solar energy management using a bibliometric analysis, 2000–2019. Heliyon, vol. 6, p. e04452, 2020.

The PDH Teófilo Miguel de Souza has years of experience in scientific research and, among various activities in the area, develops research involving energy and energy efficiency. He also has publications in high-impact journals.

Micena, Raul Pereira; Llerena-Pizarro, Omar R.; De Souza, Teófilo Miguel; Silveira, José Luz. Solar-powered Hydrogen Refueling Stations: a techno-economic analysis. International Journal of Hydrogen Energy, vol. 45, p. 2308–2318, 2019.

Valverde-Granja, Agustín; De Souza, Teófilo M.; Magalhães-Sobrinho, Pedro. Estudio de la calidad de la energía en el punto común de conexión entre una red de baja tensión y un sistema solar fotovoltaico de 7.8 kWp. Ingeniería y Competitividad, vol. 20, p. 63–73, 2018.

Granja, Agustín; De Souza, Teófilo; Sobrinho, Pedro; Santos, Daniel. Study of power quality at the point of common coupling of a low voltage grid and a distributed generation system of 7.8 kWp in a tropical region. Energies, vol. 11, p. 1539, 2018.

C Astro, T. S.; Souza, Teófilo Miguel de; Silveira, José Luz. Feasibility of electric vehicle: electricity by grid × photovoltaic energy. Renewable & Sustainable Energy Reviews, vol. 69, p. 1077–1084, 2017.

Silva, F. S.; Souza, Teófilo Miguel. Novel materials for solid oxide fuel cell technologies: a literature review. International Journal of Hydrogen Energy, vol. 42, p. 26020–26036, 2017.

Corresponding author

Correspondence to Thamyres Machado David.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

David, T.M., de Souza, T.M. & Rizol, P.M.S.R. Expert system: use of CLIPS software to evaluate solar energy for residences and businesses. Energy Inform 6, 2 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: