AUTOMATED MULTI-DOMAIN ENGINEERING DESIGN THROUGH LINEAR GRAPHS AND GENETIC PROGRAMMING, 160-170.

Eric McCormick, Haoxiang Lang, and Clarence W. de Silva

References

  1. [1] H. Li, S. Zhang, J, Shi, and Y, Hu, Research and design of in-telligent learning system based on recommendation technology,Mechatronic Systems and Control, 47(1), 2019, 43–49.
  2. [3]. This systemconsists of a pump, which transmits fluid through a resis-161Figure 1. (a) Schematic model [5] and (b) LG model of the hydraulically actuated mechanical system.tive pipe into a hydraulic piston. This piston then convertsthe hydraulic pressure into force in the mechanical trans-lational domain in order to actuate a mass attached to aspring, which slides on a resistive surface. The schematicdiagram and the LG model of this system are shown inFig. 1.The required inputs to the LGtheory MATLAB Tool-box for this system are as follows:S = [2 2 3 4 4 4 4];T = [1 3 1 1 1 1 1];Type = [1 5 4 4 5 6 2];Domain = [4 4 4 2 2 2];syms s R A_p b K mVar_Names = [s R 1/A_p 1/A_p b K m];syms v_m(t)y = [v_m(t)];[A,B,C,D,F,x,u] = LGtheory(S,T,Type,Domain,Var_Names,y);An updated input method is now utilized by the LGtheoryToolbox since its introduction [3]. The user is no longer re-quired to input the incidence matrix form of the LG model;instead, the user defines the model topology through theSource (S) and Target (T) vectors. The column-wise in-dex values of the Source vector inform the program thatnodes the corresponding elements are leaving, while theindex values of the Target vector inform the program whichnodes the elements are entering.The Type and Domain vectors are thus formed usingTable 2 with the corresponding index values related to eachelement.The Var Names vector allows the user to define thevariable names for each element. These names can eitherbe individual symbolic variables or expressions contain-ing symbolic variables, such as the gyrator ratio of thepiston being equal to the reciprocal of the piston’s cross-sectional area (GY = 1/Ap), as seen in the example inputsabove.Table 2Index Values for Element Types and Energy DomainsIndex Element Type Index Energy Domain1 A-Source 1 Electrical2 A-Type Element 2 Mech. Translational3 Transformer 3 Mech. Rotational4 Gyrator 4 Hydraulic/Fluid5 D-Type Element 5 Thermal6 T-Type Element7 T-SourceThe user then specifies the output variables of interestin the output vector (y); for this example, the variable ofinterest is the velocity of the mass element, vm (t).The state-space model output by the MATLAB tool-box is as follows:⎡⎣˙vm˙FK⎤⎦ =⎡⎣−(R · A2p + b)/m −1/mK 0⎤⎦⎡⎣vmFK⎤⎦+⎡⎣−Ap/m0⎤⎦ Ps(t)vm = 1 0⎡⎣vmFK⎤⎦ + [0] Ps(t)The dynamic response of this system for the specifiedoutput (velocity of the mass element) is shown in Fig. 2.This system was evaluated using a 100 kPa pressure source,a pipe resistance of 100 Pa·s/m3, a sliding resistance of 50N·s/m, and a spring coefficient of 150 N/m for a mass of100 kg, and a piston with a 10 cm diameter.By observing the velocity response of the mass element,it can be determined that the force of the piston, created viathe pressure source, and accelerates the block towards thespring element in the negative direction (shown as negativevelocity). Once the compression of the spring becomes toogreat, the block is then pushed back towards the pistonbriefly until the velocity oscillations settle. By observingthe position response of the mass element, which was foundby integrating the velocity response, it can be seen that162Figure 2. Dynamic response of the hydraulically actuatedmass system.the piston pushes the block approximately 8 m before thepiston force is eventually equalized with the spring forceand the mass settles at around the 5-m position.As can be observed by the results obtained in thisexample, the LGtheory MATLAB Toolbox is a simpleand robust method of evaluating multi-domain dynamicsystems using the LG approach. This toolbox will beutilized to facilitate the design evolution of electronic filtercircuits by evaluating the dynamic frequency response ofthe generated system models.2.2 Genetic ProgrammingGP is a machine learning technique that generates com-puter programs consisting of various functions and ter-minals in an evolutionary manner based on the conceptof natural evolution. In natural evolution, members of apopulation adapt to changing environments over numer-ous generations, with some members who inherit or adaptbeneficial characteristics being more likely to survive, re-produce, and, therefore, pass on these benefits, while othermembers who do not are more likely to die off beforereproduction. This process of natural selection meansthat, over time, the weaker members of the population areunable to pass on their unbeneficial characteristics, thusstrengthening the total population.GP represents members of the population in the formof tree structures, consisting primarily of two main compo-nents: functions, which are sub-programs that conduct aspecific procedure or routine based on input values and re-turn or perform some output action; and terminals, whichcan either be functions, having no inputs, or operands,which provide input values to other functions in the tree.The topological structure of these trees is represented bynodes that denote the aforementioned functions and termi-nals and lines, which represent the hierarchical connectionsbetween nodes. In the tree structure, all inner nodes mustbe functions as they can accept input actions from othernodes and provide an output action, whereas all outer-most nodes of the tree must be terminals as they can onlyprovide output actions.All functions and terminals used in GP must satisfy theproperty of closure, which requires that all functions takeinto consideration type consistency and evaluation safety[18]. This is important because as the GP process adaptsand manipulates trees stochastically through crossover andmutation operations, it is possible that any combinationof functions and terminals may occur; thus, consistency infunction input/output types, or a method of predictablyconverting types, is required to ensure that any possibletree structure can be evaluated properly. Similarly, evalu-ation safety is required as some functions may fail duringruntime under certain conditions (i.e., a divide functionmay fail if the operand of the denominator is 0). It is com-mon practice to ensure that these functions are protectedby checking for conditions that would lead to failure and,if so, perform some predetermined output action instead(e.g., if dividing by 0, always return 1). Alternatively, itis possible to allow these failures to occur while applying alarge fitness penalty to these solutions in order to poten-tially eliminate them from the population in subsequentgenerations.2.2.1 Fitness FunctionSimilar to how the environment tests an individual’s abilityto survive in natural evolution, the fitness function inGP evaluates a solution’s ability to produce a desiredresult. This method of evaluation can be conducted in anynumber of ways that the user sees fit and can optimizefor either maximizing or minimizing the resulting fitnessvalues. One of the most common ways to determine fitnessis to calculate the absolute error between the producedresult and the desired outcome. For this particular type offitness measurement, it is desired to minimize the fitnessof each member as the fitness value relates directly tothe total error for that individual. By prioritizing theminimization of fitness for this type of fitness function,preceding generations will strive to achieve increasinglylower fitness values, thus minimizing the error. Ultimately,after every member of each generation has been producedand evaluated, the individual with the most desirablefitness value, be it lowest or highest, is chosen as thesolution to the GP problem.2.2.2 SelectionOnce the fitness of the population has been evaluated,the selection process occurs. Again, this process can beconducted in a number of ways depending on the specificapplication, but one of the most common methods used isthe roulette wheel approach. This method involves spin-ning a roulette wheel where each member of the popu-lation occupies a portion of the wheel with a size corre-sponding to their fitness with respect to the total fitnessof the population. This means that members with moredesirable fitness values will be more likely to be selectedfor reproduction than members with less desirable fitnessvalues. Other methods of selection include variations of163the roulette wheel approach, and the tournament selectionapproach, which involves pitting individuals against eachother randomly, with the individual selected to reproducebeing the one with the most desirable fitness.2.2.3 Genetic OperationsIn GP, two primary genetic operations (and many variantsof these operations) are utilized during the reproductionprocess in order to introduce new individuals and diversecharacteristics into the population. These operations arecrossover and mutation:The crossover operation occurs between two individ-uals that have been selected as parents for reproduction.A node is selected from each of these parents, and theassociated branches are swapped with one another. Thisprocess results in two new children who differ slightly fromtheir parents in order to further explore the solution space.The mutation operation involves one individual whohas been selected to be a parent. A random node isselected in this individual, and the associated tree branchis replaced with a random branch that is created using theavailable functions and terminals. This process results inone new child who differs from its parent and is beneficialfor introducing more solution diversity into the population.2.2.4 GPLABGPLAB is a GP-based MATLAB toolbox developed bySara Silva at the University of Coimbra, Portugal, whichwas released for public use in July of 2003 [19]. Thistoolbox has been under consistent development since itsinitial release, with the most recent version at the timeof writing, version 4.04, being released in June of 2018.While GPLAB’s default configuration is for more basictasks such as symbolic regression, it is also possible tocustomize various aspects of the toolbox, such as functionsand terminal sets, fitness functions, selection procedures,genetic operations, and so on, in order to facilitate theneeds of more advanced research.Since GPLAB is written in MATLAB, along withother benefits such as its robustness and flexibility for usermodification, it can be easily adapted to be compatiblewith any other MATLAB-based scripts or toolboxes suchas our LGtheory MATLAB Toolbox. Due to these reasons,GPLAB was selected for implementation with LGtheoryfor the present work.3. Design Evolution of Electronic FiltersElectronic filters are signal processing electric circuits con-sisting of discrete electrical components with the purposeof attenuating unwanted frequencies while maintaining thewanted ones. There are many types of electronic filterswith different functions and benefits. The purpose of thepresent section is to explore the application of LG andGP in the design of linear passive low-pass, high-pass, andband-pass filter circuits, and thereby validate the proposedmethod. Passive filters are filter circuits that contain pas-sive electrical components, such as capacitors, inductors,Figure 3. Embryo model for evolved filter circuits.and resistors. They do not contain active components, suchas operational amplifiers, which require external powersources to operate.3.1 Embryo ModelThe design evolution process begins with an initial embryomodel in order to provide a basis on which the evolutionaryprocess can commence. For all three filters that will bedesigned in the following sections, the embryo model willconsist of a voltage source, VS, in series with a resistiveelement, RS, representing the source internal resistance,and another resistive element, RL, representing the loadresistance, which will be placed in parallel with the lastelement added to the model between the nthnode andthe ground node, 1. The values pertaining to the sourcevoltage and the resistances of the embryo model are speci-fied by the user during setup in order to accommodate thespecific needs of the designed system. Figure 3 representsthe embryo system model; the evolved filter circuit is con-structed within this embryo between the nodes highlightedwith the red squares, 3 and n. In order to evaluate theevolved models, the voltage of the load resistance elementis selected as the output of the state-space model, and thefrequency response of this element is observed via a Bodeplot for each iteration of the evolutionary design process.3.2 FunctionsThe following sections describe the functions utilized bythe GP toolbox to facilitate the construction of the LGmodels of the filter circuits.3.2.1 SeriesThe series function takes two input actions and constructsthe resulting sub-models in series. In the simplest case, ifboth actions are the addition of elements to the model, theseries function will place both of these elements in serieswith one another in the system model. For more complexcases, this function will produce the sub-models that resultfrom the associated input branches in such a way that theresulting system components are constructed in series withone another as well.3.2.2 SplitThe split function takes two input actions and constructsthe resulting sub-models independently of one another.164After a split occurs, each resulting sub-model will beconstructed separately from one another and groundedindependently, resulting in each sub-model being parallelwith one another between the node where the split occursand the ground node. The splitting function is importantfor the design of electronic filters as it results in a ladder-like topology that is required for constructing higher orderfilter circuits.3.3 TerminalsThe Add A, Add D, and Add T terminals each add theirrespective passive elements to the embryo system model.These terminals perform the addition of their respectiveelements in an identical manner, with the exception of theelement type index value which must correspond with typeof element that is being added to the system. When anelement is added, a new node is also created, upon whichthe model can be built further. If this newly created nodeis not to be further built upon during the GP process, itwill be converted into a ground node. Additionally, theseterminals randomly select the parameter values associatedwith the newly added element within a range of valuesthat are determined based on the source/load resistancevalues and the cut-off frequencies specified by the user.This parameter selection process is done in order to ensurethat the GP fitness will converge towards an optimal valuequickly by reducing the solution space which the algorithmmust explore.3.4 Fitness FunctionEach model generated by the GP algorithm is subsequentlysent to the LGtheory toolbox in order to extract the state-space model of the system. If this toolbox determines thatit is impossible to extract the state-space models of theevolved systems due to any issues with the model con-struction by the GP (e.g., excess or lack of state variables,incomplete models, etc.), an error message is returned tothe fitness function by the toolbox. Upon detection of sucherror messages, the fitness function will end for that par-ticular system and a large penalty value shall be appliedto the fitness of that individual.If a state-space model can be extracted, the frequencyresponse of the system is evaluated using the “bode” func-tion in MATLAB. From the data produced by the “bode”function, the magnitude of the output voltage at each pointalong the plot is evaluated against the desired voltage out-put for that specific frequency. Ideally, this means that forfrequencies that are desired to be passed, the magnitudeof the output voltage will be equal to the input voltage,and for unwanted frequencies, the magnitude of the outputvoltage will be equal to zero. The absolute error valuesfound between the desired and the actual voltage valueswithin the entire frequency range are summed and equatedto the fitness of the evolved system. In band-pass filterevolution, the absolute error values associated with thepass band frequencies are squared to increase their im-pact on the fitness value. This is due to the pass bandgenerally being narrow compared to the total frequencyFigure 4. Tree structure of the evolved low-pass filter withthe directionality of node execution.range, squaring the error of the pass band helps to equalizethe algorithm’s prioritization of the pass band and attenu-ated frequencies, thus tending to generate a more optimalsystem.The GP algorithm is run for the specified amount ofgenerations and population size, and the evolved modelthat results in the lowest fitness value is selected andpresented to the user as the final design.3.5 Interpreting Tree StructuresFigure 4 shows the tree structure evolved for the low-passfilter model. The GP algorithm executes functions ina manner that the first sub-tree from the function nodeis evaluated in its entirety before the second sub-tree isconsidered. This is represented in the figure by the arrowslining the perimeter of the tree in a counter-clockwisedirection, which represents the order in which the terminalnodes are executed, and thus, the order in which elementsare added to the system.This tree structure is interpreted as follows: at (Start),a split is created at node 3 of the embryo model. At (1), aninductor (T-Type) element is added to the model at node3 and a new node, 4, is created. Another split is createdat node 4, and at (2), a second inductor element and node,5, are added to the model. At this newly created node,another split occurs with the addition of a resistive (D-Type) element at (3), with the node created by the additionof this element being connected to ground. A seriesconnection of the third inductor and the second resistorelements are added to node 5 at (4) and (5), creating newnodes 6 and 7. Following the arrow from (5) to (6) resultsin the grounding of node 7, and the addition of a capacitor(A-Type) element between the previously split node 4 anda new node, which is subsequently grounded. Finally,following the arrow from (6) through (7) to (End) resultsin the addition of a second capacitor element between node3 and ground.After the tree has been interpreted by the GP algo-rithm and the LG model constructed, the load resistance165Figure 5. (a) Fitness and (b) structural complexity for the evolution of the low-pass filter.Figure 6. (a) LG model and (b) circuit diagram of the evolved low-pass filter.element is added to the system between the highest integernode, in this case 6, and ground. This results in the finallow-pass filter LG model, as shown in Fig. 6.4. Results and Discussion4.1 Low-Pass Filter EvolutionThe low-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistance of750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a cut-off frequency of 50 kHz over 100generations with a population size of 50. Figure 4 ofthe previous section shows the tree structure that wasconstructed by the GP algorithm for these input values.The two graphs shown in Fig. 5 demonstrate the evolu-tion of the fitness and structural complexity, respectively,of the evolved tree structures over the course of the 100generations. The left graph shows the change in the fitnessof the “best so far” tree structure, as well as the medianand average finesses and the average standard deviationsof all trees for each generation of the evolution process.Similarly, the right graph shows the evolving structuralcomplexity of the “best so far” solution in the form ofdepth, size, and percentage of introns of the associated treestructure.Figure 7. Frequency response function of the evolved low-pass filter.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 6.The frequency response of the system is shown inFig. 7.166Figure 8. Tree structure of the evolved high-pass filter.Figure 9. (a) Fitness and (b) structural complexity for the evolution of the high-pass filter.4.2 High-Pass Filter EvolutionThe high-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. Thefilter was designed for a cut-off frequency of 300 kHz over100 generations, with a population size of 50. Figure 8shows the tree structure that was constructed by the GPalgorithm for these input values.The two graphs shown in Fig. 9 demonstrate the evolu-tion of the fitness and structural complexity of the evolvedtree structures over the course of the 100 generations.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 10.The frequency response function of the system is shownin Fig. 11.4.3 Band-Pass Filter EvolutionThe band-pass filter evolution program was run for a sys-tem containing a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a lower cut-off frequency of 20 kHz and anupper cut-off frequency of 250 kHz, over 100 generationswith a population size of 50. Figure 12 shows the treestructure, which was constructed by the GP algorithm forthese input values.The two graphs shown in Fig. 13 demonstrate theevolution of the fitness and structural complexity of theevolved tree structures over the course of the 100 genera-tions.The resulting LG model and equivalent circuit dia-grams are shown in Fig. 14.167Figure 10. (a) LG model and (b) circuit diagram of the evolved high-pass filter.Figure 11. Frequency response function of the evolved high-pass filter.Figure 12. Tree structure of the evolved band-pass filter.168Figure 13. (a) Fitness and (b) structural complexity for the evolution of the band-pass filter.Figure 14. (a) LG model and (b) circuit diagram of the evolved band-pass filter.Figure 15. Frequency response function of the evolvedband-pass filter.The frequency response function of the system is shownin Fig. 15.5. ConclusionThis paper presented the application of the combined LGmodelling and GP design approach for the evolutionarydesign of passive electronic filter circuits. While the useof GP for the design of electronic filters is not new, thisapplication of design evolution was utilized in order todemonstrate the capabilities of LG modelling and theLGtheory MATLAB Toolbox for automated design byevaluating the evolved systems via dynamic simulation.In this paper, three types of passive filter circuits (low-pass, high-pass, and band-pass filters) were designed usingthe combination of LG modelling and GP. The results ofthe frequency response of these systems demonstrated thatthe LG/GP program was able to successfully evolve high-order filter circuits that were effective at attenuating thevoltages of undesirable frequencies while maintaining thevoltages of desired frequencies.While the present application of designing filter circuitsis only concerned with the electrical energy domain, dueto the unified and integrated nature of LG modelling,a characteristic that other single-domain evaluation toolslack, it is possible to extend the present work to other169domains, and even combinations of different domains, forthe design of complex multi-domain mechatronic system.The present paper further validates the capabilities of theLGtheory MATLAB Toolbox, which has been developedby us, as a robust and reliable software package for thedesign and simulation of complex dynamic systems.References[1] H. Li, S. Zhang, J, Shi, and Y, Hu, Research and design of in-telligent learning system based on recommendation technology,Mechatronic Systems and Control, 47(1), 2019, 43–49.[2] P. Chattopadhyay and S. Ghoshal, Design and control of abio-inspired climbing robot, Mechatronic Systems and Control,47(3), 2019, 144–152.[3] E. McCormick, H. Lang, and C.W. de Silva, Research and de-velopment of a linear graph-based MATLAB toolbox, The 14thInternational Conference on Computer Science & Education(ICCSE 2019), Toronto, 2019, 942–947.
  3. [5] and (b) LG model of the hydraulically actuated mechanical system.tive pipe into a hydraulic piston. This piston then convertsthe hydraulic pressure into force in the mechanical trans-lational domain in order to actuate a mass attached to aspring, which slides on a resistive surface. The schematicdiagram and the LG model of this system are shown inFig. 1.The required inputs to the LGtheory MATLAB Tool-box for this system are as follows:S = [2 2 3 4 4 4 4];T = [1 3 1 1 1 1 1];Type = [1 5 4 4 5 6 2];Domain = [4 4 4 2 2 2];syms s R A_p b K mVar_Names = [s R 1/A_p 1/A_p b K m];syms v_m(t)y = [v_m(t)];[A,B,C,D,F,x,u] = LGtheory(S,T,Type,Domain,Var_Names,y);An updated input method is now utilized by the LGtheoryToolbox since its introduction [3]. The user is no longer re-quired to input the incidence matrix form of the LG model;instead, the user defines the model topology through theSource (S) and Target (T) vectors. The column-wise in-dex values of the Source vector inform the program thatnodes the corresponding elements are leaving, while theindex values of the Target vector inform the program whichnodes the elements are entering.The Type and Domain vectors are thus formed usingTable 2 with the corresponding index values related to eachelement.The Var Names vector allows the user to define thevariable names for each element. These names can eitherbe individual symbolic variables or expressions contain-ing symbolic variables, such as the gyrator ratio of thepiston being equal to the reciprocal of the piston’s cross-sectional area (GY = 1/Ap), as seen in the example inputsabove.Table 2Index Values for Element Types and Energy DomainsIndex Element Type Index Energy Domain1 A-Source 1 Electrical2 A-Type Element 2 Mech. Translational3 Transformer 3 Mech. Rotational4 Gyrator 4 Hydraulic/Fluid5 D-Type Element 5 Thermal6 T-Type Element7 T-SourceThe user then specifies the output variables of interestin the output vector (y); for this example, the variable ofinterest is the velocity of the mass element, vm (t).The state-space model output by the MATLAB tool-box is as follows:⎡⎣˙vm˙FK⎤⎦ =⎡⎣−(R · A2p + b)/m −1/mK 0⎤⎦⎡⎣vmFK⎤⎦+⎡⎣−Ap/m0⎤⎦ Ps(t)vm = 1 0⎡⎣vmFK⎤⎦ + [0] Ps(t)The dynamic response of this system for the specifiedoutput (velocity of the mass element) is shown in Fig. 2.This system was evaluated using a 100 kPa pressure source,a pipe resistance of 100 Pa·s/m3, a sliding resistance of 50N·s/m, and a spring coefficient of 150 N/m for a mass of100 kg, and a piston with a 10 cm diameter.By observing the velocity response of the mass element,it can be determined that the force of the piston, created viathe pressure source, and accelerates the block towards thespring element in the negative direction (shown as negativevelocity). Once the compression of the spring becomes toogreat, the block is then pushed back towards the pistonbriefly until the velocity oscillations settle. By observingthe position response of the mass element, which was foundby integrating the velocity response, it can be seen that162Figure 2. Dynamic response of the hydraulically actuatedmass system.the piston pushes the block approximately 8 m before thepiston force is eventually equalized with the spring forceand the mass settles at around the 5-m position.As can be observed by the results obtained in thisexample, the LGtheory MATLAB Toolbox is a simpleand robust method of evaluating multi-domain dynamicsystems using the LG approach. This toolbox will beutilized to facilitate the design evolution of electronic filtercircuits by evaluating the dynamic frequency response ofthe generated system models.2.2 Genetic ProgrammingGP is a machine learning technique that generates com-puter programs consisting of various functions and ter-minals in an evolutionary manner based on the conceptof natural evolution. In natural evolution, members of apopulation adapt to changing environments over numer-ous generations, with some members who inherit or adaptbeneficial characteristics being more likely to survive, re-produce, and, therefore, pass on these benefits, while othermembers who do not are more likely to die off beforereproduction. This process of natural selection meansthat, over time, the weaker members of the population areunable to pass on their unbeneficial characteristics, thusstrengthening the total population.GP represents members of the population in the formof tree structures, consisting primarily of two main compo-nents: functions, which are sub-programs that conduct aspecific procedure or routine based on input values and re-turn or perform some output action; and terminals, whichcan either be functions, having no inputs, or operands,which provide input values to other functions in the tree.The topological structure of these trees is represented bynodes that denote the aforementioned functions and termi-nals and lines, which represent the hierarchical connectionsbetween nodes. In the tree structure, all inner nodes mustbe functions as they can accept input actions from othernodes and provide an output action, whereas all outer-most nodes of the tree must be terminals as they can onlyprovide output actions.All functions and terminals used in GP must satisfy theproperty of closure, which requires that all functions takeinto consideration type consistency and evaluation safety[18]. This is important because as the GP process adaptsand manipulates trees stochastically through crossover andmutation operations, it is possible that any combinationof functions and terminals may occur; thus, consistency infunction input/output types, or a method of predictablyconverting types, is required to ensure that any possibletree structure can be evaluated properly. Similarly, evalu-ation safety is required as some functions may fail duringruntime under certain conditions (i.e., a divide functionmay fail if the operand of the denominator is 0). It is com-mon practice to ensure that these functions are protectedby checking for conditions that would lead to failure and,if so, perform some predetermined output action instead(e.g., if dividing by 0, always return 1). Alternatively, itis possible to allow these failures to occur while applying alarge fitness penalty to these solutions in order to poten-tially eliminate them from the population in subsequentgenerations.2.2.1 Fitness FunctionSimilar to how the environment tests an individual’s abilityto survive in natural evolution, the fitness function inGP evaluates a solution’s ability to produce a desiredresult. This method of evaluation can be conducted in anynumber of ways that the user sees fit and can optimizefor either maximizing or minimizing the resulting fitnessvalues. One of the most common ways to determine fitnessis to calculate the absolute error between the producedresult and the desired outcome. For this particular type offitness measurement, it is desired to minimize the fitnessof each member as the fitness value relates directly tothe total error for that individual. By prioritizing theminimization of fitness for this type of fitness function,preceding generations will strive to achieve increasinglylower fitness values, thus minimizing the error. Ultimately,after every member of each generation has been producedand evaluated, the individual with the most desirablefitness value, be it lowest or highest, is chosen as thesolution to the GP problem.2.2.2 SelectionOnce the fitness of the population has been evaluated,the selection process occurs. Again, this process can beconducted in a number of ways depending on the specificapplication, but one of the most common methods used isthe roulette wheel approach. This method involves spin-ning a roulette wheel where each member of the popu-lation occupies a portion of the wheel with a size corre-sponding to their fitness with respect to the total fitnessof the population. This means that members with moredesirable fitness values will be more likely to be selectedfor reproduction than members with less desirable fitnessvalues. Other methods of selection include variations of163the roulette wheel approach, and the tournament selectionapproach, which involves pitting individuals against eachother randomly, with the individual selected to reproducebeing the one with the most desirable fitness.2.2.3 Genetic OperationsIn GP, two primary genetic operations (and many variantsof these operations) are utilized during the reproductionprocess in order to introduce new individuals and diversecharacteristics into the population. These operations arecrossover and mutation:The crossover operation occurs between two individ-uals that have been selected as parents for reproduction.A node is selected from each of these parents, and theassociated branches are swapped with one another. Thisprocess results in two new children who differ slightly fromtheir parents in order to further explore the solution space.The mutation operation involves one individual whohas been selected to be a parent. A random node isselected in this individual, and the associated tree branchis replaced with a random branch that is created using theavailable functions and terminals. This process results inone new child who differs from its parent and is beneficialfor introducing more solution diversity into the population.2.2.4 GPLABGPLAB is a GP-based MATLAB toolbox developed bySara Silva at the University of Coimbra, Portugal, whichwas released for public use in July of 2003 [19]. Thistoolbox has been under consistent development since itsinitial release, with the most recent version at the timeof writing, version 4.04, being released in June of 2018.While GPLAB’s default configuration is for more basictasks such as symbolic regression, it is also possible tocustomize various aspects of the toolbox, such as functionsand terminal sets, fitness functions, selection procedures,genetic operations, and so on, in order to facilitate theneeds of more advanced research.Since GPLAB is written in MATLAB, along withother benefits such as its robustness and flexibility for usermodification, it can be easily adapted to be compatiblewith any other MATLAB-based scripts or toolboxes suchas our LGtheory MATLAB Toolbox. Due to these reasons,GPLAB was selected for implementation with LGtheoryfor the present work.3. Design Evolution of Electronic FiltersElectronic filters are signal processing electric circuits con-sisting of discrete electrical components with the purposeof attenuating unwanted frequencies while maintaining thewanted ones. There are many types of electronic filterswith different functions and benefits. The purpose of thepresent section is to explore the application of LG andGP in the design of linear passive low-pass, high-pass, andband-pass filter circuits, and thereby validate the proposedmethod. Passive filters are filter circuits that contain pas-sive electrical components, such as capacitors, inductors,Figure 3. Embryo model for evolved filter circuits.and resistors. They do not contain active components, suchas operational amplifiers, which require external powersources to operate.3.1 Embryo ModelThe design evolution process begins with an initial embryomodel in order to provide a basis on which the evolutionaryprocess can commence. For all three filters that will bedesigned in the following sections, the embryo model willconsist of a voltage source, VS, in series with a resistiveelement, RS, representing the source internal resistance,and another resistive element, RL, representing the loadresistance, which will be placed in parallel with the lastelement added to the model between the nthnode andthe ground node, 1. The values pertaining to the sourcevoltage and the resistances of the embryo model are speci-fied by the user during setup in order to accommodate thespecific needs of the designed system. Figure 3 representsthe embryo system model; the evolved filter circuit is con-structed within this embryo between the nodes highlightedwith the red squares, 3 and n. In order to evaluate theevolved models, the voltage of the load resistance elementis selected as the output of the state-space model, and thefrequency response of this element is observed via a Bodeplot for each iteration of the evolutionary design process.3.2 FunctionsThe following sections describe the functions utilized bythe GP toolbox to facilitate the construction of the LGmodels of the filter circuits.3.2.1 SeriesThe series function takes two input actions and constructsthe resulting sub-models in series. In the simplest case, ifboth actions are the addition of elements to the model, theseries function will place both of these elements in serieswith one another in the system model. For more complexcases, this function will produce the sub-models that resultfrom the associated input branches in such a way that theresulting system components are constructed in series withone another as well.3.2.2 SplitThe split function takes two input actions and constructsthe resulting sub-models independently of one another.164After a split occurs, each resulting sub-model will beconstructed separately from one another and groundedindependently, resulting in each sub-model being parallelwith one another between the node where the split occursand the ground node. The splitting function is importantfor the design of electronic filters as it results in a ladder-like topology that is required for constructing higher orderfilter circuits.3.3 TerminalsThe Add A, Add D, and Add T terminals each add theirrespective passive elements to the embryo system model.These terminals perform the addition of their respectiveelements in an identical manner, with the exception of theelement type index value which must correspond with typeof element that is being added to the system. When anelement is added, a new node is also created, upon whichthe model can be built further. If this newly created nodeis not to be further built upon during the GP process, itwill be converted into a ground node. Additionally, theseterminals randomly select the parameter values associatedwith the newly added element within a range of valuesthat are determined based on the source/load resistancevalues and the cut-off frequencies specified by the user.This parameter selection process is done in order to ensurethat the GP fitness will converge towards an optimal valuequickly by reducing the solution space which the algorithmmust explore.3.4 Fitness FunctionEach model generated by the GP algorithm is subsequentlysent to the LGtheory toolbox in order to extract the state-space model of the system. If this toolbox determines thatit is impossible to extract the state-space models of theevolved systems due to any issues with the model con-struction by the GP (e.g., excess or lack of state variables,incomplete models, etc.), an error message is returned tothe fitness function by the toolbox. Upon detection of sucherror messages, the fitness function will end for that par-ticular system and a large penalty value shall be appliedto the fitness of that individual.If a state-space model can be extracted, the frequencyresponse of the system is evaluated using the “bode” func-tion in MATLAB. From the data produced by the “bode”function, the magnitude of the output voltage at each pointalong the plot is evaluated against the desired voltage out-put for that specific frequency. Ideally, this means that forfrequencies that are desired to be passed, the magnitudeof the output voltage will be equal to the input voltage,and for unwanted frequencies, the magnitude of the outputvoltage will be equal to zero. The absolute error valuesfound between the desired and the actual voltage valueswithin the entire frequency range are summed and equatedto the fitness of the evolved system. In band-pass filterevolution, the absolute error values associated with thepass band frequencies are squared to increase their im-pact on the fitness value. This is due to the pass bandgenerally being narrow compared to the total frequencyFigure 4. Tree structure of the evolved low-pass filter withthe directionality of node execution.range, squaring the error of the pass band helps to equalizethe algorithm’s prioritization of the pass band and attenu-ated frequencies, thus tending to generate a more optimalsystem.The GP algorithm is run for the specified amount ofgenerations and population size, and the evolved modelthat results in the lowest fitness value is selected andpresented to the user as the final design.3.5 Interpreting Tree StructuresFigure 4 shows the tree structure evolved for the low-passfilter model. The GP algorithm executes functions ina manner that the first sub-tree from the function nodeis evaluated in its entirety before the second sub-tree isconsidered. This is represented in the figure by the arrowslining the perimeter of the tree in a counter-clockwisedirection, which represents the order in which the terminalnodes are executed, and thus, the order in which elementsare added to the system.This tree structure is interpreted as follows: at (Start),a split is created at node 3 of the embryo model. At (1), aninductor (T-Type) element is added to the model at node3 and a new node, 4, is created. Another split is createdat node 4, and at (2), a second inductor element and node,5, are added to the model. At this newly created node,another split occurs with the addition of a resistive (D-Type) element at (3), with the node created by the additionof this element being connected to ground. A seriesconnection of the third inductor and the second resistorelements are added to node 5 at (4) and (5), creating newnodes 6 and 7. Following the arrow from (5) to (6) resultsin the grounding of node 7, and the addition of a capacitor(A-Type) element between the previously split node 4 anda new node, which is subsequently grounded. Finally,following the arrow from (6) through (7) to (End) resultsin the addition of a second capacitor element between node3 and ground.After the tree has been interpreted by the GP algo-rithm and the LG model constructed, the load resistance165Figure 5. (a) Fitness and (b) structural complexity for the evolution of the low-pass filter.Figure 6. (a) LG model and (b) circuit diagram of the evolved low-pass filter.element is added to the system between the highest integernode, in this case 6, and ground. This results in the finallow-pass filter LG model, as shown in Fig. 6.4. Results and Discussion4.1 Low-Pass Filter EvolutionThe low-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistance of750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a cut-off frequency of 50 kHz over 100generations with a population size of 50. Figure 4 ofthe previous section shows the tree structure that wasconstructed by the GP algorithm for these input values.The two graphs shown in Fig. 5 demonstrate the evolu-tion of the fitness and structural complexity, respectively,of the evolved tree structures over the course of the 100generations. The left graph shows the change in the fitnessof the “best so far” tree structure, as well as the medianand average finesses and the average standard deviationsof all trees for each generation of the evolution process.Similarly, the right graph shows the evolving structuralcomplexity of the “best so far” solution in the form ofdepth, size, and percentage of introns of the associated treestructure.Figure 7. Frequency response function of the evolved low-pass filter.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 6.The frequency response of the system is shown inFig. 7.166Figure 8. Tree structure of the evolved high-pass filter.Figure 9. (a) Fitness and (b) structural complexity for the evolution of the high-pass filter.4.2 High-Pass Filter EvolutionThe high-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. Thefilter was designed for a cut-off frequency of 300 kHz over100 generations, with a population size of 50. Figure 8shows the tree structure that was constructed by the GPalgorithm for these input values.The two graphs shown in Fig. 9 demonstrate the evolu-tion of the fitness and structural complexity of the evolvedtree structures over the course of the 100 generations.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 10.The frequency response function of the system is shownin Fig. 11.4.3 Band-Pass Filter EvolutionThe band-pass filter evolution program was run for a sys-tem containing a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a lower cut-off frequency of 20 kHz and anupper cut-off frequency of 250 kHz, over 100 generationswith a population size of 50. Figure 12 shows the treestructure, which was constructed by the GP algorithm forthese input values.The two graphs shown in Fig. 13 demonstrate theevolution of the fitness and structural complexity of theevolved tree structures over the course of the 100 genera-tions.The resulting LG model and equivalent circuit dia-grams are shown in Fig. 14.167Figure 10. (a) LG model and (b) circuit diagram of the evolved high-pass filter.Figure 11. Frequency response function of the evolved high-pass filter.Figure 12. Tree structure of the evolved band-pass filter.168Figure 13. (a) Fitness and (b) structural complexity for the evolution of the band-pass filter.Figure 14. (a) LG model and (b) circuit diagram of the evolved band-pass filter.Figure 15. Frequency response function of the evolvedband-pass filter.The frequency response function of the system is shownin Fig. 15.5. ConclusionThis paper presented the application of the combined LGmodelling and GP design approach for the evolutionarydesign of passive electronic filter circuits. While the useof GP for the design of electronic filters is not new, thisapplication of design evolution was utilized in order todemonstrate the capabilities of LG modelling and theLGtheory MATLAB Toolbox for automated design byevaluating the evolved systems via dynamic simulation.In this paper, three types of passive filter circuits (low-pass, high-pass, and band-pass filters) were designed usingthe combination of LG modelling and GP. The results ofthe frequency response of these systems demonstrated thatthe LG/GP program was able to successfully evolve high-order filter circuits that were effective at attenuating thevoltages of undesirable frequencies while maintaining thevoltages of desired frequencies.While the present application of designing filter circuitsis only concerned with the electrical energy domain, dueto the unified and integrated nature of LG modelling,a characteristic that other single-domain evaluation toolslack, it is possible to extend the present work to other169domains, and even combinations of different domains, forthe design of complex multi-domain mechatronic system.The present paper further validates the capabilities of theLGtheory MATLAB Toolbox, which has been developedby us, as a robust and reliable software package for thedesign and simulation of complex dynamic systems.References[1] H. Li, S. Zhang, J, Shi, and Y, Hu, Research and design of in-telligent learning system based on recommendation technology,Mechatronic Systems and Control, 47(1), 2019, 43–49.[2] P. Chattopadhyay and S. Ghoshal, Design and control of abio-inspired climbing robot, Mechatronic Systems and Control,47(3), 2019, 144–152.[3] E. McCormick, H. Lang, and C.W. de Silva, Research and de-velopment of a linear graph-based MATLAB toolbox, The 14thInternational Conference on Computer Science & Education(ICCSE 2019), Toronto, 2019, 942–947.[4] C. Schemike, K. Morency, and J. McPhee, Using graph theoryand symbolic computing to generate efficient models for multi-body vehicle dynamics, Proceedings of the Institution of Me-chanical Engineers. Part K, Journal of Multi-Body Dynamics,222(4), 2008, 339–352.[5] H.M. Paynter, Analysis and design of engineering systems(Boston: The MIT Press, 1961).
  4. [7], [16], [17] provide a fundamental formulation of theLG modelling approach, introduce the basic concepts ofLG theory, and several examples of various single- andmulti-domain systems.2.1.1 LG Modelling ExampleThe following example of a hydraulically actuated mechan-ical system from [7] will be evaluated using the LGtheoryMATLAB Toolbox developed in our lab [3]. This systemconsists of a pump, which transmits fluid through a resis-161Figure 1. (a) Schematic model [5] and (b) LG model of the hydraulically actuated mechanical system.tive pipe into a hydraulic piston. This piston then convertsthe hydraulic pressure into force in the mechanical trans-lational domain in order to actuate a mass attached to aspring, which slides on a resistive surface. The schematicdiagram and the LG model of this system are shown inFig. 1.The required inputs to the LGtheory MATLAB Tool-box for this system are as follows:S = [2 2 3 4 4 4 4];T = [1 3 1 1 1 1 1];Type = [1 5 4 4 5 6 2];Domain = [4 4 4 2 2 2];syms s R A_p b K mVar_Names = [s R 1/A_p 1/A_p b K m];syms v_m(t)y = [v_m(t)];[A,B,C,D,F,x,u] = LGtheory(S,T,Type,Domain,Var_Names,y);An updated input method is now utilized by the LGtheoryToolbox since its introduction [3]. The user is no longer re-quired to input the incidence matrix form of the LG model;instead, the user defines the model topology through theSource (S) and Target (T) vectors. The column-wise in-dex values of the Source vector inform the program thatnodes the corresponding elements are leaving, while theindex values of the Target vector inform the program whichnodes the elements are entering.The Type and Domain vectors are thus formed usingTable 2 with the corresponding index values related to eachelement.The Var Names vector allows the user to define thevariable names for each element. These names can eitherbe individual symbolic variables or expressions contain-ing symbolic variables, such as the gyrator ratio of thepiston being equal to the reciprocal of the piston’s cross-sectional area (GY = 1/Ap), as seen in the example inputsabove.Table 2Index Values for Element Types and Energy DomainsIndex Element Type Index Energy Domain1 A-Source 1 Electrical2 A-Type Element 2 Mech. Translational3 Transformer 3 Mech. Rotational4 Gyrator 4 Hydraulic/Fluid5 D-Type Element 5 Thermal6 T-Type Element7 T-SourceThe user then specifies the output variables of interestin the output vector (y); for this example, the variable ofinterest is the velocity of the mass element, vm (t).The state-space model output by the MATLAB tool-box is as follows:⎡⎣˙vm˙FK⎤⎦ =⎡⎣−(R · A2p + b)/m −1/mK 0⎤⎦⎡⎣vmFK⎤⎦+⎡⎣−Ap/m0⎤⎦ Ps(t)vm = 1 0⎡⎣vmFK⎤⎦ + [0] Ps(t)The dynamic response of this system for the specifiedoutput (velocity of the mass element) is shown in Fig. 2.This system was evaluated using a 100 kPa pressure source,a pipe resistance of 100 Pa·s/m3, a sliding resistance of 50N·s/m, and a spring coefficient of 150 N/m for a mass of100 kg, and a piston with a 10 cm diameter.By observing the velocity response of the mass element,it can be determined that the force of the piston, created viathe pressure source, and accelerates the block towards thespring element in the negative direction (shown as negativevelocity). Once the compression of the spring becomes toogreat, the block is then pushed back towards the pistonbriefly until the velocity oscillations settle. By observingthe position response of the mass element, which was foundby integrating the velocity response, it can be seen that162Figure 2. Dynamic response of the hydraulically actuatedmass system.the piston pushes the block approximately 8 m before thepiston force is eventually equalized with the spring forceand the mass settles at around the 5-m position.As can be observed by the results obtained in thisexample, the LGtheory MATLAB Toolbox is a simpleand robust method of evaluating multi-domain dynamicsystems using the LG approach. This toolbox will beutilized to facilitate the design evolution of electronic filtercircuits by evaluating the dynamic frequency response ofthe generated system models.2.2 Genetic ProgrammingGP is a machine learning technique that generates com-puter programs consisting of various functions and ter-minals in an evolutionary manner based on the conceptof natural evolution. In natural evolution, members of apopulation adapt to changing environments over numer-ous generations, with some members who inherit or adaptbeneficial characteristics being more likely to survive, re-produce, and, therefore, pass on these benefits, while othermembers who do not are more likely to die off beforereproduction. This process of natural selection meansthat, over time, the weaker members of the population areunable to pass on their unbeneficial characteristics, thusstrengthening the total population.GP represents members of the population in the formof tree structures, consisting primarily of two main compo-nents: functions, which are sub-programs that conduct aspecific procedure or routine based on input values and re-turn or perform some output action; and terminals, whichcan either be functions, having no inputs, or operands,which provide input values to other functions in the tree.The topological structure of these trees is represented bynodes that denote the aforementioned functions and termi-nals and lines, which represent the hierarchical connectionsbetween nodes. In the tree structure, all inner nodes mustbe functions as they can accept input actions from othernodes and provide an output action, whereas all outer-most nodes of the tree must be terminals as they can onlyprovide output actions.All functions and terminals used in GP must satisfy theproperty of closure, which requires that all functions takeinto consideration type consistency and evaluation safety[18]. This is important because as the GP process adaptsand manipulates trees stochastically through crossover andmutation operations, it is possible that any combinationof functions and terminals may occur; thus, consistency infunction input/output types, or a method of predictablyconverting types, is required to ensure that any possibletree structure can be evaluated properly. Similarly, evalu-ation safety is required as some functions may fail duringruntime under certain conditions (i.e., a divide functionmay fail if the operand of the denominator is 0). It is com-mon practice to ensure that these functions are protectedby checking for conditions that would lead to failure and,if so, perform some predetermined output action instead(e.g., if dividing by 0, always return 1). Alternatively, itis possible to allow these failures to occur while applying alarge fitness penalty to these solutions in order to poten-tially eliminate them from the population in subsequentgenerations.2.2.1 Fitness FunctionSimilar to how the environment tests an individual’s abilityto survive in natural evolution, the fitness function inGP evaluates a solution’s ability to produce a desiredresult. This method of evaluation can be conducted in anynumber of ways that the user sees fit and can optimizefor either maximizing or minimizing the resulting fitnessvalues. One of the most common ways to determine fitnessis to calculate the absolute error between the producedresult and the desired outcome. For this particular type offitness measurement, it is desired to minimize the fitnessof each member as the fitness value relates directly tothe total error for that individual. By prioritizing theminimization of fitness for this type of fitness function,preceding generations will strive to achieve increasinglylower fitness values, thus minimizing the error. Ultimately,after every member of each generation has been producedand evaluated, the individual with the most desirablefitness value, be it lowest or highest, is chosen as thesolution to the GP problem.2.2.2 SelectionOnce the fitness of the population has been evaluated,the selection process occurs. Again, this process can beconducted in a number of ways depending on the specificapplication, but one of the most common methods used isthe roulette wheel approach. This method involves spin-ning a roulette wheel where each member of the popu-lation occupies a portion of the wheel with a size corre-sponding to their fitness with respect to the total fitnessof the population. This means that members with moredesirable fitness values will be more likely to be selectedfor reproduction than members with less desirable fitnessvalues. Other methods of selection include variations of163the roulette wheel approach, and the tournament selectionapproach, which involves pitting individuals against eachother randomly, with the individual selected to reproducebeing the one with the most desirable fitness.2.2.3 Genetic OperationsIn GP, two primary genetic operations (and many variantsof these operations) are utilized during the reproductionprocess in order to introduce new individuals and diversecharacteristics into the population. These operations arecrossover and mutation:The crossover operation occurs between two individ-uals that have been selected as parents for reproduction.A node is selected from each of these parents, and theassociated branches are swapped with one another. Thisprocess results in two new children who differ slightly fromtheir parents in order to further explore the solution space.The mutation operation involves one individual whohas been selected to be a parent. A random node isselected in this individual, and the associated tree branchis replaced with a random branch that is created using theavailable functions and terminals. This process results inone new child who differs from its parent and is beneficialfor introducing more solution diversity into the population.2.2.4 GPLABGPLAB is a GP-based MATLAB toolbox developed bySara Silva at the University of Coimbra, Portugal, whichwas released for public use in July of 2003 [19]. Thistoolbox has been under consistent development since itsinitial release, with the most recent version at the timeof writing, version 4.04, being released in June of 2018.While GPLAB’s default configuration is for more basictasks such as symbolic regression, it is also possible tocustomize various aspects of the toolbox, such as functionsand terminal sets, fitness functions, selection procedures,genetic operations, and so on, in order to facilitate theneeds of more advanced research.Since GPLAB is written in MATLAB, along withother benefits such as its robustness and flexibility for usermodification, it can be easily adapted to be compatiblewith any other MATLAB-based scripts or toolboxes suchas our LGtheory MATLAB Toolbox. Due to these reasons,GPLAB was selected for implementation with LGtheoryfor the present work.3. Design Evolution of Electronic FiltersElectronic filters are signal processing electric circuits con-sisting of discrete electrical components with the purposeof attenuating unwanted frequencies while maintaining thewanted ones. There are many types of electronic filterswith different functions and benefits. The purpose of thepresent section is to explore the application of LG andGP in the design of linear passive low-pass, high-pass, andband-pass filter circuits, and thereby validate the proposedmethod. Passive filters are filter circuits that contain pas-sive electrical components, such as capacitors, inductors,Figure 3. Embryo model for evolved filter circuits.and resistors. They do not contain active components, suchas operational amplifiers, which require external powersources to operate.3.1 Embryo ModelThe design evolution process begins with an initial embryomodel in order to provide a basis on which the evolutionaryprocess can commence. For all three filters that will bedesigned in the following sections, the embryo model willconsist of a voltage source, VS, in series with a resistiveelement, RS, representing the source internal resistance,and another resistive element, RL, representing the loadresistance, which will be placed in parallel with the lastelement added to the model between the nthnode andthe ground node, 1. The values pertaining to the sourcevoltage and the resistances of the embryo model are speci-fied by the user during setup in order to accommodate thespecific needs of the designed system. Figure 3 representsthe embryo system model; the evolved filter circuit is con-structed within this embryo between the nodes highlightedwith the red squares, 3 and n. In order to evaluate theevolved models, the voltage of the load resistance elementis selected as the output of the state-space model, and thefrequency response of this element is observed via a Bodeplot for each iteration of the evolutionary design process.3.2 FunctionsThe following sections describe the functions utilized bythe GP toolbox to facilitate the construction of the LGmodels of the filter circuits.3.2.1 SeriesThe series function takes two input actions and constructsthe resulting sub-models in series. In the simplest case, ifboth actions are the addition of elements to the model, theseries function will place both of these elements in serieswith one another in the system model. For more complexcases, this function will produce the sub-models that resultfrom the associated input branches in such a way that theresulting system components are constructed in series withone another as well.3.2.2 SplitThe split function takes two input actions and constructsthe resulting sub-models independently of one another.164After a split occurs, each resulting sub-model will beconstructed separately from one another and groundedindependently, resulting in each sub-model being parallelwith one another between the node where the split occursand the ground node. The splitting function is importantfor the design of electronic filters as it results in a ladder-like topology that is required for constructing higher orderfilter circuits.3.3 TerminalsThe Add A, Add D, and Add T terminals each add theirrespective passive elements to the embryo system model.These terminals perform the addition of their respectiveelements in an identical manner, with the exception of theelement type index value which must correspond with typeof element that is being added to the system. When anelement is added, a new node is also created, upon whichthe model can be built further. If this newly created nodeis not to be further built upon during the GP process, itwill be converted into a ground node. Additionally, theseterminals randomly select the parameter values associatedwith the newly added element within a range of valuesthat are determined based on the source/load resistancevalues and the cut-off frequencies specified by the user.This parameter selection process is done in order to ensurethat the GP fitness will converge towards an optimal valuequickly by reducing the solution space which the algorithmmust explore.3.4 Fitness FunctionEach model generated by the GP algorithm is subsequentlysent to the LGtheory toolbox in order to extract the state-space model of the system. If this toolbox determines thatit is impossible to extract the state-space models of theevolved systems due to any issues with the model con-struction by the GP (e.g., excess or lack of state variables,incomplete models, etc.), an error message is returned tothe fitness function by the toolbox. Upon detection of sucherror messages, the fitness function will end for that par-ticular system and a large penalty value shall be appliedto the fitness of that individual.If a state-space model can be extracted, the frequencyresponse of the system is evaluated using the “bode” func-tion in MATLAB. From the data produced by the “bode”function, the magnitude of the output voltage at each pointalong the plot is evaluated against the desired voltage out-put for that specific frequency. Ideally, this means that forfrequencies that are desired to be passed, the magnitudeof the output voltage will be equal to the input voltage,and for unwanted frequencies, the magnitude of the outputvoltage will be equal to zero. The absolute error valuesfound between the desired and the actual voltage valueswithin the entire frequency range are summed and equatedto the fitness of the evolved system. In band-pass filterevolution, the absolute error values associated with thepass band frequencies are squared to increase their im-pact on the fitness value. This is due to the pass bandgenerally being narrow compared to the total frequencyFigure 4. Tree structure of the evolved low-pass filter withthe directionality of node execution.range, squaring the error of the pass band helps to equalizethe algorithm’s prioritization of the pass band and attenu-ated frequencies, thus tending to generate a more optimalsystem.The GP algorithm is run for the specified amount ofgenerations and population size, and the evolved modelthat results in the lowest fitness value is selected andpresented to the user as the final design.3.5 Interpreting Tree StructuresFigure 4 shows the tree structure evolved for the low-passfilter model. The GP algorithm executes functions ina manner that the first sub-tree from the function nodeis evaluated in its entirety before the second sub-tree isconsidered. This is represented in the figure by the arrowslining the perimeter of the tree in a counter-clockwisedirection, which represents the order in which the terminalnodes are executed, and thus, the order in which elementsare added to the system.This tree structure is interpreted as follows: at (Start),a split is created at node 3 of the embryo model. At (1), aninductor (T-Type) element is added to the model at node3 and a new node, 4, is created. Another split is createdat node 4, and at (2), a second inductor element and node,5, are added to the model. At this newly created node,another split occurs with the addition of a resistive (D-Type) element at (3), with the node created by the additionof this element being connected to ground. A seriesconnection of the third inductor and the second resistorelements are added to node 5 at (4) and (5), creating newnodes 6 and 7. Following the arrow from (5) to (6) resultsin the grounding of node 7, and the addition of a capacitor(A-Type) element between the previously split node 4 anda new node, which is subsequently grounded. Finally,following the arrow from (6) through (7) to (End) resultsin the addition of a second capacitor element between node3 and ground.After the tree has been interpreted by the GP algo-rithm and the LG model constructed, the load resistance165Figure 5. (a) Fitness and (b) structural complexity for the evolution of the low-pass filter.Figure 6. (a) LG model and (b) circuit diagram of the evolved low-pass filter.element is added to the system between the highest integernode, in this case 6, and ground. This results in the finallow-pass filter LG model, as shown in Fig. 6.4. Results and Discussion4.1 Low-Pass Filter EvolutionThe low-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistance of750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a cut-off frequency of 50 kHz over 100generations with a population size of 50. Figure 4 ofthe previous section shows the tree structure that wasconstructed by the GP algorithm for these input values.The two graphs shown in Fig. 5 demonstrate the evolu-tion of the fitness and structural complexity, respectively,of the evolved tree structures over the course of the 100generations. The left graph shows the change in the fitnessof the “best so far” tree structure, as well as the medianand average finesses and the average standard deviationsof all trees for each generation of the evolution process.Similarly, the right graph shows the evolving structuralcomplexity of the “best so far” solution in the form ofdepth, size, and percentage of introns of the associated treestructure.Figure 7. Frequency response function of the evolved low-pass filter.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 6.The frequency response of the system is shown inFig. 7.166Figure 8. Tree structure of the evolved high-pass filter.Figure 9. (a) Fitness and (b) structural complexity for the evolution of the high-pass filter.4.2 High-Pass Filter EvolutionThe high-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. Thefilter was designed for a cut-off frequency of 300 kHz over100 generations, with a population size of 50. Figure 8shows the tree structure that was constructed by the GPalgorithm for these input values.The two graphs shown in Fig. 9 demonstrate the evolu-tion of the fitness and structural complexity of the evolvedtree structures over the course of the 100 generations.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 10.The frequency response function of the system is shownin Fig. 11.4.3 Band-Pass Filter EvolutionThe band-pass filter evolution program was run for a sys-tem containing a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a lower cut-off frequency of 20 kHz and anupper cut-off frequency of 250 kHz, over 100 generationswith a population size of 50. Figure 12 shows the treestructure, which was constructed by the GP algorithm forthese input values.The two graphs shown in Fig. 13 demonstrate theevolution of the fitness and structural complexity of theevolved tree structures over the course of the 100 genera-tions.The resulting LG model and equivalent circuit dia-grams are shown in Fig. 14.167Figure 10. (a) LG model and (b) circuit diagram of the evolved high-pass filter.Figure 11. Frequency response function of the evolved high-pass filter.Figure 12. Tree structure of the evolved band-pass filter.168Figure 13. (a) Fitness and (b) structural complexity for the evolution of the band-pass filter.Figure 14. (a) LG model and (b) circuit diagram of the evolved band-pass filter.Figure 15. Frequency response function of the evolvedband-pass filter.The frequency response function of the system is shownin Fig. 15.5. ConclusionThis paper presented the application of the combined LGmodelling and GP design approach for the evolutionarydesign of passive electronic filter circuits. While the useof GP for the design of electronic filters is not new, thisapplication of design evolution was utilized in order todemonstrate the capabilities of LG modelling and theLGtheory MATLAB Toolbox for automated design byevaluating the evolved systems via dynamic simulation.In this paper, three types of passive filter circuits (low-pass, high-pass, and band-pass filters) were designed usingthe combination of LG modelling and GP. The results ofthe frequency response of these systems demonstrated thatthe LG/GP program was able to successfully evolve high-order filter circuits that were effective at attenuating thevoltages of undesirable frequencies while maintaining thevoltages of desired frequencies.While the present application of designing filter circuitsis only concerned with the electrical energy domain, dueto the unified and integrated nature of LG modelling,a characteristic that other single-domain evaluation toolslack, it is possible to extend the present work to other169domains, and even combinations of different domains, forthe design of complex multi-domain mechatronic system.The present paper further validates the capabilities of theLGtheory MATLAB Toolbox, which has been developedby us, as a robust and reliable software package for thedesign and simulation of complex dynamic systems.References[1] H. Li, S. Zhang, J, Shi, and Y, Hu, Research and design of in-telligent learning system based on recommendation technology,Mechatronic Systems and Control, 47(1), 2019, 43–49.[2] P. Chattopadhyay and S. Ghoshal, Design and control of abio-inspired climbing robot, Mechatronic Systems and Control,47(3), 2019, 144–152.[3] E. McCormick, H. Lang, and C.W. de Silva, Research and de-velopment of a linear graph-based MATLAB toolbox, The 14thInternational Conference on Computer Science & Education(ICCSE 2019), Toronto, 2019, 942–947.[4] C. Schemike, K. Morency, and J. McPhee, Using graph theoryand symbolic computing to generate efficient models for multi-body vehicle dynamics, Proceedings of the Institution of Me-chanical Engineers. Part K, Journal of Multi-Body Dynamics,222(4), 2008, 339–352.[5] H.M. Paynter, Analysis and design of engineering systems(Boston: The MIT Press, 1961).[6] H.E. Koenig and W.A. Blackwell, Linear graph theory –A fundamental engineering discipline, IRE Transactions onEducation, 3(2), 1960, 42–49.[7] D. Rowell and D.N. Wormley, System dynamics: An introduc-tion (Upper Saddle River: Prentice Hall, 1997).
  5. [8] J. McPhee, C. Schmitke, and S. Redmond, Dynamic mod-elling of mechatronic multibody systems with symbolic com-puting and linear graph theory, Mathematical and ComputerModelling of Dynamical Systems, 10(1), 2004, 1–23.
  6. [9] S. Silva and J. Almeida, GPLAB – A genetic programmingtoolbox for MATLAB (2008).
  7. [10] J.R. Koza, Genetic programming: A paradigm for geneticallybreeding populations of computer programs to solve problems(Stanford University, Stanford, 1990).
  8. [11] M.T. Ahvanooey, Q. Li, M. Wu, and S. Wang, A survey ofgenetic programming and its applications, KSII Transactionson Internet and Information Systems, 13(4), 2019, 1765–1794.
  9. [12] J.R. Koza, F.H. Bennett III, D. Andre, and M.A. Keane, Auto-mated design of both the topology and sizing of analog electri-cal circuits using genetic programming, Artificial Intelligencein Design 1996, Stanford, 1996.
  10. [13] V. Durev and E. Gadjeva, Passive circuit synthesis using geneticalgorithms in MATLAB, 9th WSEAS International Conferenceon Evolutionary Computing (EC 2008), Sofia, 2008.
  11. [14] O.J. Ushie, M.F. Abbod, and J.C. Ogbulezie, The use of geneticprogramming to evolve passive filter circuits, InternationalJournal of Engineering and Technology Innovation, 7(4), 2017,255–268.
  12. [16],
  13. [17] provide a fundamental formulation of theLG modelling approach, introduce the basic concepts ofLG theory, and several examples of various single- andmulti-domain systems.2.1.1 LG Modelling ExampleThe following example of a hydraulically actuated mechan-ical system from [7] will be evaluated using the LGtheoryMATLAB Toolbox developed in our lab [3]. This systemconsists of a pump, which transmits fluid through a resis-161Figure 1. (a) Schematic model [5] and (b) LG model of the hydraulically actuated mechanical system.tive pipe into a hydraulic piston. This piston then convertsthe hydraulic pressure into force in the mechanical trans-lational domain in order to actuate a mass attached to aspring, which slides on a resistive surface. The schematicdiagram and the LG model of this system are shown inFig. 1.The required inputs to the LGtheory MATLAB Tool-box for this system are as follows:S = [2 2 3 4 4 4 4];T = [1 3 1 1 1 1 1];Type = [1 5 4 4 5 6 2];Domain = [4 4 4 2 2 2];syms s R A_p b K mVar_Names = [s R 1/A_p 1/A_p b K m];syms v_m(t)y = [v_m(t)];[A,B,C,D,F,x,u] = LGtheory(S,T,Type,Domain,Var_Names,y);An updated input method is now utilized by the LGtheoryToolbox since its introduction [3]. The user is no longer re-quired to input the incidence matrix form of the LG model;instead, the user defines the model topology through theSource (S) and Target (T) vectors. The column-wise in-dex values of the Source vector inform the program thatnodes the corresponding elements are leaving, while theindex values of the Target vector inform the program whichnodes the elements are entering.The Type and Domain vectors are thus formed usingTable 2 with the corresponding index values related to eachelement.The Var Names vector allows the user to define thevariable names for each element. These names can eitherbe individual symbolic variables or expressions contain-ing symbolic variables, such as the gyrator ratio of thepiston being equal to the reciprocal of the piston’s cross-sectional area (GY = 1/Ap), as seen in the example inputsabove.Table 2Index Values for Element Types and Energy DomainsIndex Element Type Index Energy Domain1 A-Source 1 Electrical2 A-Type Element 2 Mech. Translational3 Transformer 3 Mech. Rotational4 Gyrator 4 Hydraulic/Fluid5 D-Type Element 5 Thermal6 T-Type Element7 T-SourceThe user then specifies the output variables of interestin the output vector (y); for this example, the variable ofinterest is the velocity of the mass element, vm (t).The state-space model output by the MATLAB tool-box is as follows:⎡⎣˙vm˙FK⎤⎦ =⎡⎣−(R · A2p + b)/m −1/mK 0⎤⎦⎡⎣vmFK⎤⎦+⎡⎣−Ap/m0⎤⎦ Ps(t)vm = 1 0⎡⎣vmFK⎤⎦ + [0] Ps(t)The dynamic response of this system for the specifiedoutput (velocity of the mass element) is shown in Fig. 2.This system was evaluated using a 100 kPa pressure source,a pipe resistance of 100 Pa·s/m3, a sliding resistance of 50N·s/m, and a spring coefficient of 150 N/m for a mass of100 kg, and a piston with a 10 cm diameter.By observing the velocity response of the mass element,it can be determined that the force of the piston, created viathe pressure source, and accelerates the block towards thespring element in the negative direction (shown as negativevelocity). Once the compression of the spring becomes toogreat, the block is then pushed back towards the pistonbriefly until the velocity oscillations settle. By observingthe position response of the mass element, which was foundby integrating the velocity response, it can be seen that162Figure 2. Dynamic response of the hydraulically actuatedmass system.the piston pushes the block approximately 8 m before thepiston force is eventually equalized with the spring forceand the mass settles at around the 5-m position.As can be observed by the results obtained in thisexample, the LGtheory MATLAB Toolbox is a simpleand robust method of evaluating multi-domain dynamicsystems using the LG approach. This toolbox will beutilized to facilitate the design evolution of electronic filtercircuits by evaluating the dynamic frequency response ofthe generated system models.2.2 Genetic ProgrammingGP is a machine learning technique that generates com-puter programs consisting of various functions and ter-minals in an evolutionary manner based on the conceptof natural evolution. In natural evolution, members of apopulation adapt to changing environments over numer-ous generations, with some members who inherit or adaptbeneficial characteristics being more likely to survive, re-produce, and, therefore, pass on these benefits, while othermembers who do not are more likely to die off beforereproduction. This process of natural selection meansthat, over time, the weaker members of the population areunable to pass on their unbeneficial characteristics, thusstrengthening the total population.GP represents members of the population in the formof tree structures, consisting primarily of two main compo-nents: functions, which are sub-programs that conduct aspecific procedure or routine based on input values and re-turn or perform some output action; and terminals, whichcan either be functions, having no inputs, or operands,which provide input values to other functions in the tree.The topological structure of these trees is represented bynodes that denote the aforementioned functions and termi-nals and lines, which represent the hierarchical connectionsbetween nodes. In the tree structure, all inner nodes mustbe functions as they can accept input actions from othernodes and provide an output action, whereas all outer-most nodes of the tree must be terminals as they can onlyprovide output actions.All functions and terminals used in GP must satisfy theproperty of closure, which requires that all functions takeinto consideration type consistency and evaluation safety
  14. [18]. This is important because as the GP process adaptsand manipulates trees stochastically through crossover andmutation operations, it is possible that any combinationof functions and terminals may occur; thus, consistency infunction input/output types, or a method of predictablyconverting types, is required to ensure that any possibletree structure can be evaluated properly. Similarly, evalu-ation safety is required as some functions may fail duringruntime under certain conditions (i.e., a divide functionmay fail if the operand of the denominator is 0). It is com-mon practice to ensure that these functions are protectedby checking for conditions that would lead to failure and,if so, perform some predetermined output action instead(e.g., if dividing by 0, always return 1). Alternatively, itis possible to allow these failures to occur while applying alarge fitness penalty to these solutions in order to poten-tially eliminate them from the population in subsequentgenerations.2.2.1 Fitness FunctionSimilar to how the environment tests an individual’s abilityto survive in natural evolution, the fitness function inGP evaluates a solution’s ability to produce a desiredresult. This method of evaluation can be conducted in anynumber of ways that the user sees fit and can optimizefor either maximizing or minimizing the resulting fitnessvalues. One of the most common ways to determine fitnessis to calculate the absolute error between the producedresult and the desired outcome. For this particular type offitness measurement, it is desired to minimize the fitnessof each member as the fitness value relates directly tothe total error for that individual. By prioritizing theminimization of fitness for this type of fitness function,preceding generations will strive to achieve increasinglylower fitness values, thus minimizing the error. Ultimately,after every member of each generation has been producedand evaluated, the individual with the most desirablefitness value, be it lowest or highest, is chosen as thesolution to the GP problem.2.2.2 SelectionOnce the fitness of the population has been evaluated,the selection process occurs. Again, this process can beconducted in a number of ways depending on the specificapplication, but one of the most common methods used isthe roulette wheel approach. This method involves spin-ning a roulette wheel where each member of the popu-lation occupies a portion of the wheel with a size corre-sponding to their fitness with respect to the total fitnessof the population. This means that members with moredesirable fitness values will be more likely to be selectedfor reproduction than members with less desirable fitnessvalues. Other methods of selection include variations of163the roulette wheel approach, and the tournament selectionapproach, which involves pitting individuals against eachother randomly, with the individual selected to reproducebeing the one with the most desirable fitness.2.2.3 Genetic OperationsIn GP, two primary genetic operations (and many variantsof these operations) are utilized during the reproductionprocess in order to introduce new individuals and diversecharacteristics into the population. These operations arecrossover and mutation:The crossover operation occurs between two individ-uals that have been selected as parents for reproduction.A node is selected from each of these parents, and theassociated branches are swapped with one another. Thisprocess results in two new children who differ slightly fromtheir parents in order to further explore the solution space.The mutation operation involves one individual whohas been selected to be a parent. A random node isselected in this individual, and the associated tree branchis replaced with a random branch that is created using theavailable functions and terminals. This process results inone new child who differs from its parent and is beneficialfor introducing more solution diversity into the population.2.2.4 GPLABGPLAB is a GP-based MATLAB toolbox developed bySara Silva at the University of Coimbra, Portugal, whichwas released for public use in July of 2003
  15. [19]. Thistoolbox has been under consistent development since itsinitial release, with the most recent version at the timeof writing, version 4.04, being released in June of 2018.While GPLAB’s default configuration is for more basictasks such as symbolic regression, it is also possible tocustomize various aspects of the toolbox, such as functionsand terminal sets, fitness functions, selection procedures,genetic operations, and so on, in order to facilitate theneeds of more advanced research.Since GPLAB is written in MATLAB, along withother benefits such as its robustness and flexibility for usermodification, it can be easily adapted to be compatiblewith any other MATLAB-based scripts or toolboxes suchas our LGtheory MATLAB Toolbox. Due to these reasons,GPLAB was selected for implementation with LGtheoryfor the present work.3. Design Evolution of Electronic FiltersElectronic filters are signal processing electric circuits con-sisting of discrete electrical components with the purposeof attenuating unwanted frequencies while maintaining thewanted ones. There are many types of electronic filterswith different functions and benefits. The purpose of thepresent section is to explore the application of LG andGP in the design of linear passive low-pass, high-pass, andband-pass filter circuits, and thereby validate the proposedmethod. Passive filters are filter circuits that contain pas-sive electrical components, such as capacitors, inductors,Figure 3. Embryo model for evolved filter circuits.and resistors. They do not contain active components, suchas operational amplifiers, which require external powersources to operate.3.1 Embryo ModelThe design evolution process begins with an initial embryomodel in order to provide a basis on which the evolutionaryprocess can commence. For all three filters that will bedesigned in the following sections, the embryo model willconsist of a voltage source, VS, in series with a resistiveelement, RS, representing the source internal resistance,and another resistive element, RL, representing the loadresistance, which will be placed in parallel with the lastelement added to the model between the nthnode andthe ground node, 1. The values pertaining to the sourcevoltage and the resistances of the embryo model are speci-fied by the user during setup in order to accommodate thespecific needs of the designed system. Figure 3 representsthe embryo system model; the evolved filter circuit is con-structed within this embryo between the nodes highlightedwith the red squares, 3 and n. In order to evaluate theevolved models, the voltage of the load resistance elementis selected as the output of the state-space model, and thefrequency response of this element is observed via a Bodeplot for each iteration of the evolutionary design process.3.2 FunctionsThe following sections describe the functions utilized bythe GP toolbox to facilitate the construction of the LGmodels of the filter circuits.3.2.1 SeriesThe series function takes two input actions and constructsthe resulting sub-models in series. In the simplest case, ifboth actions are the addition of elements to the model, theseries function will place both of these elements in serieswith one another in the system model. For more complexcases, this function will produce the sub-models that resultfrom the associated input branches in such a way that theresulting system components are constructed in series withone another as well.3.2.2 SplitThe split function takes two input actions and constructsthe resulting sub-models independently of one another.164After a split occurs, each resulting sub-model will beconstructed separately from one another and groundedindependently, resulting in each sub-model being parallelwith one another between the node where the split occursand the ground node. The splitting function is importantfor the design of electronic filters as it results in a ladder-like topology that is required for constructing higher orderfilter circuits.3.3 TerminalsThe Add A, Add D, and Add T terminals each add theirrespective passive elements to the embryo system model.These terminals perform the addition of their respectiveelements in an identical manner, with the exception of theelement type index value which must correspond with typeof element that is being added to the system. When anelement is added, a new node is also created, upon whichthe model can be built further. If this newly created nodeis not to be further built upon during the GP process, itwill be converted into a ground node. Additionally, theseterminals randomly select the parameter values associatedwith the newly added element within a range of valuesthat are determined based on the source/load resistancevalues and the cut-off frequencies specified by the user.This parameter selection process is done in order to ensurethat the GP fitness will converge towards an optimal valuequickly by reducing the solution space which the algorithmmust explore.3.4 Fitness FunctionEach model generated by the GP algorithm is subsequentlysent to the LGtheory toolbox in order to extract the state-space model of the system. If this toolbox determines thatit is impossible to extract the state-space models of theevolved systems due to any issues with the model con-struction by the GP (e.g., excess or lack of state variables,incomplete models, etc.), an error message is returned tothe fitness function by the toolbox. Upon detection of sucherror messages, the fitness function will end for that par-ticular system and a large penalty value shall be appliedto the fitness of that individual.If a state-space model can be extracted, the frequencyresponse of the system is evaluated using the “bode” func-tion in MATLAB. From the data produced by the “bode”function, the magnitude of the output voltage at each pointalong the plot is evaluated against the desired voltage out-put for that specific frequency. Ideally, this means that forfrequencies that are desired to be passed, the magnitudeof the output voltage will be equal to the input voltage,and for unwanted frequencies, the magnitude of the outputvoltage will be equal to zero. The absolute error valuesfound between the desired and the actual voltage valueswithin the entire frequency range are summed and equatedto the fitness of the evolved system. In band-pass filterevolution, the absolute error values associated with thepass band frequencies are squared to increase their im-pact on the fitness value. This is due to the pass bandgenerally being narrow compared to the total frequencyFigure 4. Tree structure of the evolved low-pass filter withthe directionality of node execution.range, squaring the error of the pass band helps to equalizethe algorithm’s prioritization of the pass band and attenu-ated frequencies, thus tending to generate a more optimalsystem.The GP algorithm is run for the specified amount ofgenerations and population size, and the evolved modelthat results in the lowest fitness value is selected andpresented to the user as the final design.3.5 Interpreting Tree StructuresFigure 4 shows the tree structure evolved for the low-passfilter model. The GP algorithm executes functions ina manner that the first sub-tree from the function nodeis evaluated in its entirety before the second sub-tree isconsidered. This is represented in the figure by the arrowslining the perimeter of the tree in a counter-clockwisedirection, which represents the order in which the terminalnodes are executed, and thus, the order in which elementsare added to the system.This tree structure is interpreted as follows: at (Start),a split is created at node 3 of the embryo model. At (1), aninductor (T-Type) element is added to the model at node3 and a new node, 4, is created. Another split is createdat node 4, and at (2), a second inductor element and node,5, are added to the model. At this newly created node,another split occurs with the addition of a resistive (D-Type) element at (3), with the node created by the additionof this element being connected to ground. A seriesconnection of the third inductor and the second resistorelements are added to node 5 at (4) and (5), creating newnodes 6 and 7. Following the arrow from (5) to (6) resultsin the grounding of node 7, and the addition of a capacitor(A-Type) element between the previously split node 4 anda new node, which is subsequently grounded. Finally,following the arrow from (6) through (7) to (End) resultsin the addition of a second capacitor element between node3 and ground.After the tree has been interpreted by the GP algo-rithm and the LG model constructed, the load resistance165Figure 5. (a) Fitness and (b) structural complexity for the evolution of the low-pass filter.Figure 6. (a) LG model and (b) circuit diagram of the evolved low-pass filter.element is added to the system between the highest integernode, in this case 6, and ground. This results in the finallow-pass filter LG model, as shown in Fig. 6.4. Results and Discussion4.1 Low-Pass Filter EvolutionThe low-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistance of750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a cut-off frequency of 50 kHz over 100generations with a population size of 50. Figure 4 ofthe previous section shows the tree structure that wasconstructed by the GP algorithm for these input values.The two graphs shown in Fig. 5 demonstrate the evolu-tion of the fitness and structural complexity, respectively,of the evolved tree structures over the course of the 100generations. The left graph shows the change in the fitnessof the “best so far” tree structure, as well as the medianand average finesses and the average standard deviationsof all trees for each generation of the evolution process.Similarly, the right graph shows the evolving structuralcomplexity of the “best so far” solution in the form ofdepth, size, and percentage of introns of the associated treestructure.Figure 7. Frequency response function of the evolved low-pass filter.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 6.The frequency response of the system is shown inFig. 7.166Figure 8. Tree structure of the evolved high-pass filter.Figure 9. (a) Fitness and (b) structural complexity for the evolution of the high-pass filter.4.2 High-Pass Filter EvolutionThe high-pass filter evolution program was run for a systemcontaining a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. Thefilter was designed for a cut-off frequency of 300 kHz over100 generations, with a population size of 50. Figure 8shows the tree structure that was constructed by the GPalgorithm for these input values.The two graphs shown in Fig. 9 demonstrate the evolu-tion of the fitness and structural complexity of the evolvedtree structures over the course of the 100 generations.The resulting LG model and the equivalent circuitdiagrams are shown in Fig. 10.The frequency response function of the system is shownin Fig. 11.4.3 Band-Pass Filter EvolutionThe band-pass filter evolution program was run for a sys-tem containing a 10-volt source with an internal resistanceof 750 Ohms and a load resistance of 50 Ohms. The filterwas designed for a lower cut-off frequency of 20 kHz and anupper cut-off frequency of 250 kHz, over 100 generationswith a population size of 50. Figure 12 shows the treestructure, which was constructed by the GP algorithm forthese input values.The two graphs shown in Fig. 13 demonstrate theevolution of the fitness and structural complexity of theevolved tree structures over the course of the 100 genera-tions.The resulting LG model and equivalent circuit dia-grams are shown in Fig. 14.167Figure 10. (a) LG model and (b) circuit diagram of the evolved high-pass filter.Figure 11. Frequency response function of the evolved high-pass filter.Figure 12. Tree structure of the evolved band-pass filter.168Figure 13. (a) Fitness and (b) structural complexity for the evolution of the band-pass filter.Figure 14. (a) LG model and (b) circuit diagram of the evolved band-pass filter.Figure 15. Frequency response function of the evolvedband-pass filter.The frequency response function of the system is shownin Fig. 15.5. ConclusionThis paper presented the application of the combined LGmodelling and GP design approach for the evolutionarydesign of passive electronic filter circuits. While the useof GP for the design of electronic filters is not new, thisapplication of design evolution was utilized in order todemonstrate the capabilities of LG modelling and theLGtheory MATLAB Toolbox for automated design byevaluating the evolved systems via dynamic simulation.In this paper, three types of passive filter circuits (low-pass, high-pass, and band-pass filters) were designed usingthe combination of LG modelling and GP. The results ofthe frequency response of these systems demonstrated thatthe LG/GP program was able to successfully evolve high-order filter circuits that were effective at attenuating thevoltages of undesirable frequencies while maintaining thevoltages of desired frequencies.While the present application of designing filter circuitsis only concerned with the electrical energy domain, dueto the unified and integrated nature of LG modelling,a characteristic that other single-domain evaluation toolslack, it is possible to extend the present work to other169domains, and even combinations of different domains, forthe design of complex multi-domain mechatronic system.The present paper further validates the capabilities of theLGtheory MATLAB Toolbox, which has been developedby us, as a robust and reliable software package for thedesign and simulation of complex dynamic systems.References[1] H. Li, S. Zhang, J, Shi, and Y, Hu, Research and design of in-telligent learning system based on recommendation technology,Mechatronic Systems and Control, 47(1), 2019, 43–49.[2] P. Chattopadhyay and S. Ghoshal, Design and control of abio-inspired climbing robot, Mechatronic Systems and Control,47(3), 2019, 144–152.[3] E. McCormick, H. Lang, and C.W. de Silva, Research and de-velopment of a linear graph-based MATLAB toolbox, The 14thInternational Conference on Computer Science & Education(ICCSE 2019), Toronto, 2019, 942–947.[4] C. Schemike, K. Morency, and J. McPhee, Using graph theoryand symbolic computing to generate efficient models for multi-body vehicle dynamics, Proceedings of the Institution of Me-chanical Engineers. Part K, Journal of Multi-Body Dynamics,222(4), 2008, 339–352.[5] H.M. Paynter, Analysis and design of engineering systems(Boston: The MIT Press, 1961).[6] H.E. Koenig and W.A. Blackwell, Linear graph theory –A fundamental engineering discipline, IRE Transactions onEducation, 3(2), 1960, 42–49.[7] D. Rowell and D.N. Wormley, System dynamics: An introduc-tion (Upper Saddle River: Prentice Hall, 1997).[8] J. McPhee, C. Schmitke, and S. Redmond, Dynamic mod-elling of mechatronic multibody systems with symbolic com-puting and linear graph theory, Mathematical and ComputerModelling of Dynamical Systems, 10(1), 2004, 1–23.[9] S. Silva and J. Almeida, GPLAB – A genetic programmingtoolbox for MATLAB (2008).[10] J.R. Koza, Genetic programming: A paradigm for geneticallybreeding populations of computer programs to solve problems(Stanford University, Stanford, 1990).[11] M.T. Ahvanooey, Q. Li, M. Wu, and S. Wang, A survey ofgenetic programming and its applications, KSII Transactionson Internet and Information Systems, 13(4), 2019, 1765–1794.[12] J.R. Koza, F.H. Bennett III, D. Andre, and M.A. Keane, Auto-mated design of both the topology and sizing of analog electri-cal circuits using genetic programming, Artificial Intelligencein Design 1996, Stanford, 1996.[13] V. Durev and E. Gadjeva, Passive circuit synthesis using geneticalgorithms in MATLAB, 9th WSEAS International Conferenceon Evolutionary Computing (EC 2008), Sofia, 2008.[14] O.J. Ushie, M.F. Abbod, and J.C. Ogbulezie, The use of geneticprogramming to evolve passive filter circuits, InternationalJournal of Engineering and Technology Innovation, 7(4), 2017,255–268.[15] L.B. Gamage, C.W. de Silva, and R. Campos, Design evolutionof mechatronic systems through modeling, on-line monitoring,and evolutionary optimization, Mechatronics, 22(1), 2012, 83–94.[16] C.W. de Silva, Linear graphs, in modeling of dynamic systems –With engineering applications (Boca Raton: Taylor & Francis,CRC Press, 2018), 199–391.[17] C.W. de Silva, Linear graphs, in mechatronics: A foundationcourse (Boca Raton: CRC Press, 2010), 122–147.[18] R. Poli, W.B. Langdon, and N.F. McPee, A field guide togenetic programming, Published via http://lulu.com and freelyavailable at http://www.gp-field-guide.org.uk (With contribu-tions by J.R. Koza), 2008.[19] S. Silva, GPLAB – A Genetic Programming Toolbox forMATLAB, June 2018. [Online]. Available: http://gplab.sourceforge.net/W9345

Important Links:

Go Back