Camilo Correa
email: camilo.correa-restrepo@univ-paris1.fr

Raul Mazo
email: raul.mazo@ensta-bretagne.fr

Andres López
email: andresorlandolopez@gmail.com

Jacques Robin
email: jacques.robin@esiea.fr

A Lightweight Method to Define Solver-Agnostic Semantics of Domain Specific Languages for Software Product Line Variability Models

Keywords: Variability Modeling, Formal Semantics, Modeling Language Specification, Common Logic

We propose a method to address the current lack of standards for both software product line variability modeling languages and their formal semantics. It allows specifying, in an agile, declarative, and solver-agnostic fashion the formal semantics of a domain-specific variability modeling language through a simple JSON based specification format. Our approach leverages the Common Logic Interchange Format (CLIF) standard for interoperability among logical inference engines. We demonstrate our approach with two concrete examples of Variability Models, and present the tooling and architecture that makes this possible.

I. INTRODUCTION

Software Product Lines Engineering (SPLE) [START_REF] Pohl | Software Product Line Engineering: Foundations, Principles, and Techniques[END_REF] is a method to systematically coordinate and automate the engineering and evolution of a large set of related software products with overlapping functionalities and reusable software assets over long life-cycles, whose products, put together, form a Software Product Line (SPL). In modeldriven SPLE, these assets are both models and code files while, in code-driven SPLE, these assets are mostly code files implementing services, components, classes, decorators, aspects and functions. The key artifact that distinguishes an SPL from a single software product is its Variability Model (VM). It explicitly identifies sets of requirements, generally called features, that are cohesive from a business or technical perspective and determines how they partially overlap across the different products of the line. This VM generally organizes those features into an abstraction and composition hierarchy and associates the lowest level ones with reusable and composable concrete software assets implementing them. Developing an SPL VM and such composable assets requires a large upfront investment. However, once done, it enables the automated generation of a very large number of product variants, which, in turn, supports the simultaneously low-cost and rapid delivery of very many customized software products, all maintained and evolved in coordination. It has provided great returns on investment mostly within industries such as transportation, healthcare and energy [START_REF]Systems and Software Product Line Conference[END_REF] where systems have a long lifecycle and have a critical nature.

Initially, an SPL VM was a purely design-time artifact used to interactively choose a valid set of features and attribute value choices to then generate the source code of a product variant (a.k.a. an SPL configuration) resulting from these choices by composing and/or transforming the associated SPL's reusable assets. More recently, they have started to be used as Models-at-Run-Time (M@RT) [START_REF] Cheng | Using models at runtime to address assurance for self-adaptive systems[END_REF] artifacts for context-aware self-adaptive systems that continuously monitor their execution context for changes that might require a runtime reconfiguration. In this approach, called dynamic SPLE [START_REF] Hallsteinsen | Dynamic software product lines[END_REF], an additional context model needs to be included into the SPL VM and the whole SPL and its configuration tool are embedded into each deployed product they generate. When monitoring systems detect that in a new context, the current configuration no longer satisfies some system requirements, it triggers the SPL configuration tool to search the SPL VM for alternative configurations better adapted to this new context and then update the implementation with it. To contrast them from dynamic SPLs, the original, purely design-time SPLs are called static SPLs.

In the current state of the art, there is no accepted standard for SPL VMs, so every SPLE tool uses its own Domain Specific Language (DSL) to model the VM. Nonetheless, almost all of these languages used for VMs share four key expressive capabilities. The first is to distinguish between mandatory and optional elements. The second is to specify ranges of alternative possible values for a given element parameter. The third is to specify ranges of alternative possibilities for the refinement of a higher-level elements into a set of lowerlevel elements. The fourth is to specify complex business and regulatory constraints concerning the co-occurrence of various elements or values across the abstraction hierarchy, that any product must satisfy, while also being implementable by a subset of the reusable assets available in the SPL. The existence of this common core results from the main purpose of any VM: supporting semi-or fully-automated configuration of a particular product out of the product line. Typically, this configuration process is divided into two stages. The first consists of choosing one valid point in the problem space represented by alternatives in the VM. The second consists of deriving a working implementation solution from the reusable assets associated with the options selected during the first stage.

As SPLs grow larger, VMs grow increasingly complex. Real-life industrial SPLs routinely contain over 10K elements and constraints. Since the problem and solution spaces are subtly but sparsely constrained combinations of the optional and alternative VM elements, their sizes are subject to a combinatorial explosion. This makes fully manual configuration impractical. It also inevitably leads to the introduction of inconsistent elements or constraints during the engineering and evolution of the VM. Therefore, as with any software artifact, the VM needs to be verified and validated with the help of automation tools.

A wide variety of approaches have been proposed to implement SPL VM verification and VM-guided SPL configuration tools. Just like for SPL VM languages, there is also currently no accepted standard API for such tools, though the overwhelming majority of them share a key feature in common: they rely on some form of logical knowledge representation and automated reasoning. This allows them to reuse practically scalable inference engines developed over the last 50 years by two research communities, the formal software engineering methods community and the artificial intelligence community. Four main classes of such engines have been extensively proposed and evaluated to automate SPL VM verification and VM-guided configurations: SATisfiability (SAT) solvers and their Satisfiability Modulo Theories (SMT) successors, Constraint Satisfaction Problem (CSP) solvers, Logic Programming (LP) engines and their Constraint LP (CLP) successors and Description Logic (DL) engines and their semantic web successors. No member of these engine families is a silver bullet for all SPL VM verification or VM-guided SPL configuration problems. They have subtle differences in expressiveness and performance on different kinds of problems, even if expressed in the same DSL VM language.

In this paper we propose a novel, light weight approach to bridge the gap between, on the one hand, the existing diversity and lack of standardization in VM languages, and, on the other hand, the existing diversity of logical languages that have been proposed to provide VM languages with formal semantics and are accepted as input by various classes of inference engines. Our approach is based on two key ideas. The first is to use a lightweight, declarative, textual syntax to specify both the concrete and abstract syntax of a VM DSL. This textual syntax is encoded both as Python objects from the Pydantic library [START_REF]Pydantic[END_REF] and as JSON files in the Open API web service standard [START_REF]OpenAPI Specification[END_REF]. It can be seen as a more agile alternative to the traditional Model-Driven Engineering [START_REF] Brambilla | Model-driven software engineering in practice[END_REF] based on diagrammatic models, metamodels, and meta-meta-models. It is the subject of another publication under preparation. The second key idea, which is the focus of the present paper, is the proposal of the Common Logic Interchange Format (CLIF) [START_REF]Information Technology -Common Logic (CL) -A framework for a family of logic-based languages[END_REF] standard from the International Organization for Standardization (ISO), originally put forward to support interoperability among logical inference engines, to represent the formal semantics of any VM DSL in a solver-agnostic fashion. It starts from realizing that the four main classes of logical languages listed above and commonly used for VM verification and VMguided SPL configuration are all essentially sub-languages of CLIF in terms of their expressiveness. In addition, CLIF is also the language used to define the formal semantics of the fUML [START_REF]Semantics of a Foundational Subset for Executable UML Models (fUML), version 1[END_REF] standard, the formal core of the Unified Modeling Language (UML) [START_REF] Cook | Unified Modeling Language (UML), version 2.5.1[END_REF]. Therefore, any model-driven SPLE approach using the UML to model assets, could leverage the mapping from VM models to CLIF to provide a uniform formal semantics for the whole SPL model comprising both the VM and the asset model.

The main contribution of this paper is to propose a first step towards a common formal semantics for SPL VM based on an ISO standard. We show, with a couple of illustrative examples, how the semantics of two very different SPL VM graphical languages, Extended Feature Models for static SPL VMs and Sawyer et al's [START_REF] Sawyer | Using constraint programming to manage configurations in self-adaptive systems[END_REF] extension of the Knowledge Acquisition in autOmated Specification (KAOS) modeling language [START_REF] Van Lamsweerde | Requirements Engineering: From System Goals to UML Models to Software[END_REF] for context-aware dynamic SPL VMs, can both be uniformly expressed in CLIF. We also describe the architecture of the VariaMos tool that validates the approach by allowing one to specify, in CLIF, the semantics of a SPL VM DSL and then automatically generate the CLIF formula to logically represent this semantics for a specific, graphically edited SPL VM. Given that CLIF is expressive enough to capture the restricted subsets of First Order Logic (FOL) accepted as input by most constraint solvers (which will be touched upon in the following section), this contribution will allow the subsequent use of a variety of inference engines that can be tailored to each VM language. We demonstrate our approach within an open-source tool called VariaMos [START_REF] Team | VariaMos Framework[END_REF] that allows its users to specify the concrete visual syntax, the abstract syntax and the formal semantics in agile, declarative, textual and uniform fashion as JSON files. The formal semantics JSON specification then serves to associate abstract syntax elements with CLIF elements formulas.

The rest of the paper is organized as follows: in Section II, we present an overview of the background and work related to our approach; in Section III, we present our proposal for the use of CLIF as the standard formal semantics for Variability Modeling; in Section IV, present our CLIF translation mechanism by example, by examining the translation of two different modeling languages; in Section V, we elaborate on our use of CLIF and the specific dialect we have chosen; in Section VI, we present the overall architecture of our prototype and its implementation; in Section VII, we cover the limitations of our approach and outline planned future work; and, finally, in Section VIII, we present our conclusions.

II. BACKGROUND AND RELATED WORK

There have been many approaches to establishing formal semantics for variability modeling languages; these have generally always been defined in the context of performing automated analyses of the constructed models. Since the constructs for each language vary, the corresponding semantics have always been defined as a function of the expressiveness of each language. Some of the first exploratory works on this topic proposed the use of first-order logic to provide the semantics for Basic Feature Models (BFMs) [START_REF] Mannion | Using first-order logic for product line model validation[END_REF] (the simplest and original type of VM), though they essentially remained within the propositional core of FOL and only needed first order constructs to encode their semantics into manually constructed Prolog programs. As BFMs evolved, so too did their semantics, and, in particular, Benavides et al. [START_REF] Benavides | A first step towards a framework for the automated analysis of feature models[END_REF] provided a characterization of Cardinality-based feature models as Satisfiability [START_REF] Gomes | Satisfiability solvers[END_REF], Binary Decision Diagram [START_REF] Drechsler | Binary decision diagrams in theory and practice[END_REF] and (Boolean) Constraint Satisfaction Problems [START_REF] Dechter | Constraint Processing[END_REF], all falling into the purview of first order theories.

There exist many variability modeling languages that are used for SPLE and beyond. The models constructed with these languages aim to capture the variability relations that exist within a given domain with the aim of expressing the set of allowable combinations of domain elements in products. These domain elements are commonly modeled as "features" that encode an end-user-facing piece of functionality [START_REF] Pohl | Software Product Line Engineering: Foundations, Principles, and Techniques[END_REF]. The relations among these features make explicit the design constraints imposed both by the domain itself and the technological choices involved. There has been a considerable amount of work regarding the automated analysis of these models during the past few decades [START_REF] Benavides | Variability Modelling and Analysis During 30 Years[END_REF], such as automated configuration of products or finding errors in the models. These efforts primarily focused on models of a particular type, that is, feature models, which were originally proposed in [START_REF] Kang | Feature-Oriented Domain Analysis (FODA) Feasibility Study[END_REF] and have been since extended with additional constructs that increase their expressivity. A considerable amount of alternative modeling languages, and even syntactic variations of the aforementioned variability models have been proposed, each aiming to improve upon the characteristics of these feature models to support more expressive models that better capture the nature of the domain.

It has been noted in the literature that (finite domain) constraint solving approaches are those best suited to handle the expressivity of features models extended with numerical and symbolic constructs as surveyed by Benavides et al. [START_REF] Benavides | Automated analysis of feature models 20 years later: A literature review[END_REF]. This survey highlights several other semantic approaches that have been proposed in the literature, like the use of Description Logic [START_REF] Baader | The Description Logic Handbook: Theory, Implementation and Applications[END_REF] originally proposed by Wang et al. [START_REF] Wang | A semantic web approach to feature modeling and verification[END_REF]. That being said, the overwhelming majority of approaches fit squarely in the realm of classical predicate (first order) logic.

In addition, most of the works here cited, and cited in the above surveys [START_REF] Benavides | Variability Modelling and Analysis During 30 Years[END_REF] [START_REF] Benavides | Automated analysis of feature models 20 years later: A literature review[END_REF], demonstrate that the approaches, whenever constructed to support tooling, transform the variability models directly into the representations amenable for analysis by the underlying solver technologies. This makes these formalizations difficult to reuse, compare, debug and render them inflexible to changes in the input language. We therefore diverge from these approaches and aim to construct a representation that directly encodes first order formulas, i.e., Common Logic [START_REF]Information Technology -Common Logic (CL) -A framework for a family of logic-based languages[END_REF], and in particular its machine-and humaninterpretable syntax, the Common Logic Interchange Format or CLIF.

III. CLIF AS STANDARD FORMAL SEMANTICS FOR VARIABILITY MODELING

One of the main contributions of this article is the proposal of the Common Logic [START_REF]Information Technology -Common Logic (CL) -A framework for a family of logic-based languages[END_REF] standard as the ideal target representation of the logical semantics of variability models. In particular, we propose the use of a fully conformant subset of the Common Logic Interchange Format (CLIF) as the preferred notation towards which transformation procedures should aim to produce their results. While CLIF's expressivity surpasses that of First Order Logic (FOL) through some additional constructs allowing for infinite expressions, we consider that there is only need to support the constructs effectively contained in FOL (c.f. Section 6.5 of [START_REF]Information Technology -Common Logic (CL) -A framework for a family of logic-based languages[END_REF] for a deeper justification and discussion as to why this is admissible and does not fundamentally limit our expressiveness). The justifications for choosing Common Logic (and CLIF in particular) are threefold: first, its capacity to be as expressive as FOL means that it easily represents all constructs that are handled by the most commonly used tools for analysis [START_REF] Benavides | Variability Modelling and Analysis During 30 Years[END_REF] [START_REF] Benavides | Automated analysis of feature models 20 years later: A literature review[END_REF], namely Constraint Logic Programming over finite domains [START_REF] Jaffar | Constraint logic programming[END_REF], constraint programming [START_REF] Dechter | Constraint Processing[END_REF], SAT solvers [START_REF] Gomes | Satisfiability solvers[END_REF] and SMT [START_REF] Barrett | Satisfiability Modulo Theories[END_REF] solvers, among others; second, its status as an international standard with a normative and fully defined representation format (CLIF) makes it easily interoperable with other systems and understandable by humans and machines alike; and, finally, the Lisp-like S-expression derived syntax make parsing and managing models represented in CLIF simple. In addition, this same structure facilitates the generation of these expressions from model elements.

There is an additional angle to consider as to why CLIF is particularly suitable for providing the semantics of models. Real world SPL projects go beyond domain VMs, and model the concrete software assets or artifacts that are to be used to assemble software products. UML models model the structure and behaviour of software systems, and are one possible type of asset model. As highlighted in the introduction, there have been ongoing efforts to provide formal semantics for UML models for automated execution and analysis, which have been defined in CLIF [START_REF]Semantics of a Foundational Subset for Executable UML Models (fUML), version 1[END_REF] for a subset of UML models. This opens the door to a possible avenue for investigating the logical integration between variability models and UML-derived asset models within a single analysis framework. CLIF has also found use in other domains, such as the basis for a large Fig. 1. An extended feature model with an arbitrary cross tree constraint depicted in VariaMos. Adapated from the example in Figure 2 in [START_REF] Carbonnel | Towards complex product line variability modelling: Mining relationships from non-boolean descriptions[END_REF].

repository of formal ontologies [START_REF]COLORE[END_REF], or as the input language for a tool that brings together heterogenous theorem provers [START_REF] Mossakowski | Proof support for common logic[END_REF].

IV. ILLUSTRATING VM LANGUAGE AGNOSTICISM BY

EXAMPLE

In this section, we aim to demonstrate the genericity of our approach by examining the translation of two different VM languages into CLIF. The key idea behind both of these examples is that, by providing each VM language with a specification for its semantics, we can transform any model constructed with said language into its corresponding logical semantics. These semantics could, in turn, be used as the input for inference engines with which different analyses could be performed. To achieve this, we make use of JSON [START_REF] Crockford | The application/json Media Type for JavaScript Object Notation (JSON)[END_REF] specifications that act as sets of templates for each of the elements present in each language's abstract syntax. These templates generate logic formulas with CLIF syntax, and, when collected together (with an implicit conjunction of all these formulas), form a complete CLIF model, that acts as the logical theory one associates to a given model.

To capture as large a gammut as possible of VM languages, we allow the semantics to be defined for all syntactic constructs that can be depicted in our modeling tool. In addition, some languages include constructs that reify, for instance, one-to-many relations that, to render their semantics, need information from neighboring nodes in the graph; therefore, we explicitly allow translation rules to capture information about neighboring elements in the graph to generate the CLIF formulas. portrayed in Figure 2. The correspondence between the model and its semantics is as follows:

A. Feature Models

• Line 2 depicts the semantics of F1 as a boolean variable, and, since it is a root feature, it also models a constraint that obligates it to be present, i.e., set to 1. • Lines 3-5, 7-8, and 15-16 represent features F2-5 and F7-9 as boolean variables. • Line 6 represents the Version attribute (not visible in the figure) of F4 as an integer variable. • Line 9 represents the semantics of the reified relation B1, giving a range of 1 to 2 selected features if feature F2 is present. • Line 11 represents the semantics of F6, a feature that, unlike the others, is not boolean, but can instead be present as up to 5 instances (also called clones in the literature). • Line 14 represents the reified "and" relation B2, implying that if the parent feature F3 is present both F8 and F9 must be present aswell. • Line 17 represents the mandatory relation R1, i.e., the two features must be bound to the same value. • Lines 18 and 19 represent the optional relations from F1 to F3 and F4. • Line 20 encodes the exclusion relation between F7 and F4. • Line 21 encodes a complex constraint between F9 and the Version attribute of F4. The transformation of the model and its elements is done through the specification of the semantics of the VM language's syntax elements in a JSON format. This JSON serves to provide a set of "templates" to turn these abstract syntax elements of the model into CLIF expressions. Figure 3 presents a fragment of the translation rules necessary to transform a feature model into its corresponding CLIF model. These templates form a bridge between the graph structure of the model and the CLIF expressions that represent them:

• Lines 1-7 define the semantics of the (boolean) features "param": "F", "constraint": "(bool F)", ... as boolean variables where where bool is a distinguished unary predicate defining the domain of the variable F, i.e., F ∈ {0, 1}.

• Lines 8-21 define the semantics of the relations between features as CLIF expressions with arithmetic predicates and the mechanism for determining their type according to their properties. • Lines 23-34 define the semantics of the bundles, and,

given their one-to-many nature, define which of the two sides (ingoing or outgoing) contains multiple edges to expand expressions like sum or use their length in the CLIF expressions. In addition, depending on the type of the bundle, additional properties of the node may play a role, like the min/max properties for a range.

B. Sawyer et al.'s Variability Modeling Langauge

Figure 4 depicts a fragment of the principal model, using a modified KAOS [START_REF] Van Lamsweerde | Requirements Engineering: From System Goals to UML Models to Software[END_REF] language, proposed in [START_REF] Sawyer | Using constraint programming to manage configurations in self-adaptive systems[END_REF]. It models a flood early-warning system and how the system can modify its operational configuration depending on the state of its environment as reported through sensors. The language they have defined is structured as follows:

• Goals, with labels in green, determine the functional requirements of the system and are analogous to features in feature models. Goals form a hierarchy wherein the lower level goals imply how the goals they point to are to be achieved.

• Soft Goals, depicted as clouds annotated in Blue, encode the non-functional requirements of the system and can be satisfied in a 0 to 4 scale, which is encoded as "--", "-", "=", "+", "++" in the model. They themselves form a hierarchy in a manner analogous to goals. • Context Variables, annotated in light red, encode the state of the system's environment among a set possible choices enconded as an enumeration of strings. • Operationalizations, labeled in gray, specify the ways in which a goal can be satisfied and correspond to concrete modes of operation of the system. They are tied to a goal through Bundles, in light orange, which behave analogously to feature models (though with the edge direction reversed). • Claims, annotated in magenta, express the level to which operationalizations satisfy the Soft Goals as a function of which has been selected. • Soft Influences, labeled in yellow, relate the context variables to the Soft Goals, and determine the required level of satisfaction when the given state is determined by the context, e.g., if CV1 is "Low", the required level of satisfaction of SG5 is "++". The aim with this language is to construct an optimization problem where the largest amount of claims can be satisfied in terms of the selected operationalizations, and therefore ensure that the Soft Goals are satisfied to a given level.

As before, we can interpret the semantics interpretation of the CLIF model in Figure 5 as follows:

• Lines 2-4, 11-14 encode the the Goals G1-3 and the operationalizations O1-4 as boolean variables. In addition, lines 45 and 46 encode the relations of the subgoals to the main goal. • Lines 5-10 encode the value relations of the Softgoals with those above them in the hierarchy as their average. • Lines 15-18 encode the bundles B1-2 as the choices between the operationalizations. • Lines 19-30 encode the consequences of the claims C1-4 on the Soft Goals, with the claims themselves being a boolean variable that is true iff their claims are satisfied in the resulting configuration. variables. In Section V, we will continue with the analysis of this example, its semantic specification and the implications for representing VMs in CLIF.

V. DIFFERENCES BETWEEN THE DIALECT USED FOR SEMANTIC SPECIFICATION AND (STANDARD) CLIF

As was hinted at in the previous section, while we target CLIF as our representation, there are some practical consid- erations for its use that mean that we differ from CLIF as presented in the standard. These deviations, though small, have important consequences for the models produced through the semantic specification mechanism. The first of these departures is that we expressly recognize a set of distinguished predicates beyond the sole equality recognized by CLIF, such as unary or binary predicates like int and bool relating to the domains of variables used in the program. This is motivated by a desire to facilitate the construction of executable representations in different solvers that generally cannot automatically infer domain membership or require it outright for every variable. The other quite salient departure from the standard presentation of CLIF relates to the treatment of quantifiers; in effect, to enable complex arbitrary constraints, or even merely support the conjunction of the sentences outlined in the example from subsection IV-B, the reocurrence of the same variables must imply that they refer to the same object. Therefore, variables that occur free in the generated semantics are to be interpreted as being implicitly universally quantified over the conjunction of all the generated sentences; we do this following the tradition set by the standard first-order semantics for (pure) Prolog programs given by Clark's completion [START_REF] Lloyd | Foundations of Logic Programming[END_REF] and that of the Knowledge Interchange Format [START_REF] Genesereth | Knowledge interchange formatversion 3.0: Reference manual[END_REF] language from which CLIF itself was derived. For example, the full logical reading of the exclusion relation in Figure 1 and therefore lines 5,8 and 20 from Figure 2 would be (using their annotated names for brevity):

∀F 4 , F 7 {(F 4 ∈ {0, 1}), (F 7 ∈ {0, 1}), (F 4 + F 7 ≤ 1)}
This naturally leads to the question of handling quantifiers within each of the sentences. We have not yet found it necessary to introduce existential quantifiers for the semantics of the models languages we have dealt with so far; however, we have found very important applications of universal quantifiers, in particular, as a construct allowing one to deal with sentences that involve sets of incoming or outgoing edges to a given node in the directed graph. We currently consider, then, that the quantifiers range over finite sets that are defined precisely by the multiplicity of possible connections. This, in turn, leads to an important transformation that can be done directly without any loss of expressivity, namely that one can transform the universal quantification over a single variable and over a sentence into the iterated conjunction of a set of sentences each being the original sentence with the bound variable replaced by a member of the set. This is due to the following equivalence:

Let S be a finite set and ϕ an arbitrary first order sentence with only s unbound.

∀s ∈ Sϕ(s) ⇔ s∈S ϕ(s)
This greatly simplifies, and augments the power of, the semantics we can express and in turn greatly simplifies the translation from CLIF towards some solver paradigms where there is no pure or declarative handling of classical universal quantification, e.g., Prolog. To be clear, the quantifier expansion draws its values from the graph's elements and not from the variable domains over which we are solving. This subtle point means that we retain the intensive expression of the semantics but are able to write more general rules that have potentially varying amounts of appearances of certain elements from neighboring elements.

To demonstrate these mechanisms and differences in practice, consider the example from Figure 4, and in particular centered on the element SI3 and its relation with its neighbors SG6, SG7 and CV2. We have defined the semantics of the Soft Influence as shown in Figure 6. Within this semantic specification, we "bind" the set over which the x variable is quantified as the target nodes of the outbound edges, corresponding to X s in the translation rule and to SG 6 and SG 7 in Figure 4. We also have distinguished functions relating to intrinsic properties of the directed graph, such as edge(x) whose value is the edge leading to the x node, and we also allow references to arbitrary custom properties defined on graph elements through the :: operator.

The corresponding logical reading of these semantics would be as follows:

Let X be the set of nodes in the graph, X s ⊂ X be the set of nodes corresponding to the outgoing edges in the model, E be the set of edges in the model, edge be a function edge : X → E, V the set of attribute types and V s the set of attribute values, :: be an infix binary function (::) : E ∪ X × V → V s , S be the variable corresponding to the id of the soft influence node, and F ∈ {0, 1} the variable corresponding to the id of the unique inbound node. It is to be understood that the predicate imposing bounds on the F variable would also be part of the semantics. ∀S, F bool(S) ∧ (S = 1) ⇐⇒ (F = edge(F ) :: V alue =⇒ ∀x ∈ X s (x = edge(x) :: Satisf actionLevel))

However, given the equivalence cited above, the rendered semantics would be (lines 37-38): This removes the need to handle the internal quantifier, and simplifies the reading of the rendered formula.

VI. VARIABILITY MODEL TO CLIF TRANSLATION ARCHITECTURE AND IMPLEMENTATION

We propose a distributed architecture for CLIF semantic translation, as depicted in Figure 7. The necessary tooling for modeling is served from a cloud infrastructure avoiding the need to perform any installation on the client beyond browsing to the website, where the user is served the user interface (shown in green) by the FrontEnd HTTP server. Within the cloud infrastructure, all concerns relating to the storage of the languages are handled, including their syntax and semantics, with a database backing these operations and providing a source of persistence between client interactions. An additional service that can perform certain checks on graph validity, such as allowed element amounts and connections beyond what can be handled natively by the graphics library used by the client is proposed in the architecture, to offload some responsibilities from the client. All of these services are deployed as containers, and are shown in white in our logical architecture diagram.

When it comes to the semantic translator service (shown in yellow), which is the core tool covered by this articles, it has been developed as a Docker [START_REF] Inc | Docker Documentation[END_REF] container which will expose a REST API endpoint over which the translation (and eventual analysis) operations will be served. Since our Front End is inherently configurable, this Back End can be deployed anywhere. For our prototype we have deployed it locally within a test cluster, but it will be made available within the VariaMos cloud infrastructure, where it will be the default point of access for translation. Looking forward, however, to the integration of the underlying solvers (which may also require licenses and hence can only be run locally), it seems clear that decoupling the translation mechanism allows for the best use of the available computational resources by allowing the user to choose where he desires the operations to be run, either sharing a cloud resource with others or deploying a local version of the container if he so wishes. This retains all the benefits of a cloud-native solution, while also being flexible when additional computational resources are required for a particular project.

The high-level operating principles of the translation mechanism are described in Figure 8. The fundamental operations carried out involve performing data validation on both the form of the provided Model and the semantics. Then the serialized model is reconstructed into a Graph; this, put together with the semantics, are then put through the CLIF model generation procedure which ultimately outputs the model's semantics which are the reported back to the user. This is all exposed through the API endpoint served in the translator container.

In terms of the implementation of the translation Back End, we have constructed the server in python with the following software components: Flask [START_REF]The Pallets Projects[END_REF] for the server code, pydantic [START_REF]Pydantic[END_REF] for data schema validation, networkX [START_REF] Hagberg | Exploring network structure, dynamics, and function using networkx[END_REF] for graph representation in python, and textX [START_REF] Dejanović | TextX: A Python tool for Domain-Specific Languages implementation[END_REF] for managing the CLIF grammar. All of the code for the translator is opensource and freely available on GitHub at [START_REF] Restrepo | Semantic Translator[END_REF]. Within this repository are included the full grammar for our subset of CLIF, and complete examples (including models, semantics and syntax) for basic and extended feature models, as well as for Sawyer et al.'s [START_REF] Sawyer | Using constraint programming to manage configurations in self-adaptive systems[END_REF] modified version of KAOS.

VII. LIMITATIONS AND FUTURE WORK

In terms of our approach's limitations, it must be noted that we do not cover the entire CLIF standard, and we have not yet found a need to construct a particular treatment of existential quantification within model's semantics. There are also some limitations tied to the translation mechanism for the generation of the semantics, namely, we require that the elements that participate in a given node's or edge's semantics be directly connected, and thus we cannot yet perform the transitive traversal of the graph for the generation of the semantics. We also have no semantic treatment for elements that can be nested. We also require the user to have some understanding of the internal structure of the graph representation in the front-end client in order to define rules for attribute lookup to, for example, perform type disambiguation when a given node or relation's semantics depends on types defined by these attributes. This means that while we believe our approach is expressive enough to handle most VM languages that have been covered in the literature, it is possible that some others posses constructs that aren't easily expressible or require the aspects of CLIF we have not yet covered, such as deeply nested negation. In addition, we are restricted to languages that form directed graphs, so we are unable to treat languages with more complex graph types like hypergraphs without some measure of reification. We also do not handle the translation of textual languages into CLIF.

As mentioned in Section VI, our principal aim is to continue expanding upon the already implemented aspects of the proposal in order to complete the full end-to-end cycle of model generation and subsequent automated analysis through the use of several solvers. We will initially target constraint solvers as these are the best attested in the literature [START_REF] Pol'la | Analysis of variability models: A systematic literature review[END_REF] and have the most straightforward translation from CLIF into their respective representation, but we ultimately aim to support a larger range of first order logic-based automated analysis tools.

VIII. CONCLUSIONS

In this article, we have presented a proposal for the use of CLIF as the standard representation format for the semantics of Variability models. We also present and demonstrate a mechanism to specify formal semantics for variability modeling languages through a simple JSON based specification format.

Our mechanism leverages the user-friendliness of the JSON format with the ability to quickly construct one's needed (and formally defined) modeling language semantics in such a manner that it spares prospective users from the need to learn the specifics of the programming involved. It also enables the quick evolution of language's semantics with no modifications to the underlying tools.

We believe this will permit the transparent integration of multiple analysis methods and especially solver families through the construction of translation from CLIF into their respective syntaxes.

Figure 1

 1 Figure1depicts an extended feature model for a product line of accesible web browsers featuring cardinalities and attributes. All the elements of the model have been annotated and numbered according to their type: features are in green; relations in blue; and elements that reify one to many relations (with UML-like cardinality ranges), called bundles, are in light orange. The logical semantics of the model in CLIF are

(model 1 ( 2 ( 8 ( 9 ( 10 ( 20 ( 21 ) 22 Fig. 2 .

 1289102021222 Fig. 2. The logical semantics of the feature model from Figure 1 in CLIF.

6 } 7 }, 8 " 9 "relationPropertySchema": { 10 " 11 }, 12 " 13 " 14 " 15 }, 16 " 25 " 26 "paramMapping": { 27 " 29 }, 30 " 36 }Fig. 3 .

 6789101112131415162526272930363 Fig. 3. Fragment of Feature Model Semantic Translation specification JSON.

Fig. 4 .

 4 Fig. 4. A fragment of the model for the run-time variability of a flood early-warning originally proposed in and using the language of Sawyer et al.'s [11].

15 ( 16 ( 18 ( 32 ( 35 ( 36 (Fig. 5 .

 1516183235365 Fig. 5. The logical semantics of the feature model from Figure 1 in CLIF.

3 " 4 " 6 " 7 " 23 Fig. 6 .

 3467236 Fig. 6. Fragment of Sawyer et al.'s language's Semantic Translation specification JSON. The "\" indicates the split in the multiline string for readability and formatting.

Fig. 7 .

 7 Fig. 7. High Level logical architecture of the VariaMos tool and the translation tool.

Fig. 8 .

 8 Fig. 8. High-Level operation of the translation tool.

•

  Lines 31-32, 35-40 encode the semantics of the Soft Influences on the Soft Goals, and, just like the claims, are boolean values that are true iff the requirements are satisfied. • Lines 33-34 encode the Context Variables CV1-2 as enumerations in a fixed range. • Lines 41-44 encode the Soft Goals as bounded integer

ACKNOWLEDGMENT

We would like to thank Mauricio Agudelo for his work on the architecture and development of VariaMos, Jairo Soto for his work on the deployment of the VariaMos cloud infrastructure, and Francisco Piedrahita for his work on an initial version of these ideas.


Drissa Zié

Hervé Diarra

Laurent Chazal

Lauric Gerbaud

Garbuio

Sizing by SQP optimization of an electrical drive: application to a switched capacitor connected to a permanent magnet synchronous generator

Keywords: analytical modelling, permanent magnet synchronous machine, flying capacitor interface, model derivation, SQP

The paper deals with the design by optimization in pre-sizing step of a drive system that combines a switched capacitor system and a permanent magnet synchronous machine (PMSM). The sizing of the converter and the machine are considered strongly dependent due to the series quasi-resonant topology. The system modelling is based on a semi-analytical approach validated by finite element (FE) simulations. It involves an analytical modelling of the electrical machine and a numerical time solving of the electrical circuit sub-model because of the natural switching events of diodes. The optimization is carried out by SQP (Sequential Quadratic Programming). The model gradients are computed combining mathematical laws, symbolic derivation and automatic differentiation. Finally, trade-offs and gains on the machine power density, the magnet volume and the efficiency are investigated through a Pareto approach.

Introduction

Nowadays, power converters that use quasi-resonant operating mode are numerous and are covering a wide application domain from small power energy systems to large power systems as wind turbine systems. In [START_REF] Takaku | Improved Wind Power Conversion System Using Magnetic Energy Recovery Switch (MERS)[END_REF] [START_REF] Morel | Output Power Control of a Surface Mounted Permanent Magnet Synchronous Generator Coupled With Electronic Capacitor System[END_REF] [3], the authors investigate one of those converters named Magnetic Energy Recovery Switch System that works like a quasi-resonant dimmer power circuit. This can be connected in series with a Permanent Magnet Generator and is suitably used to control the output power supplied to the load. Focusing on the same application case depicted in Fig. 1. In the paper, the authors focuses on how this flying capacitor type converter connected in series with a synchronous generator is modifying the design of the machine and the power electronics components. In this so-named pre-sizing step, the principal goal is to evaluate the expected gain on the machine by associating it to a flying capacitor converter and locate the compromises. It is therefore important to have a systemic approach in order to have an overview. Likewise, the use of medium and low fidelity modelling as well as gradients based algorithms is recommended in order to quickly browse all of the possible solutions included in the study space.

Subsequently, the choice of SQP algorithm is made for optimisation. It allows solving of inverse problem with large input number with equality and inequality constraints and is able to converge very rapidly aiming to the gradients.

After presenting the global sizing model, the paper splits up the modelling into two sub-models: the machine model and the electrical drive model.

Firstly, the modelling of the machine is detailed. It involves homogenisation step to describe the machine topology.

It results that teeth and slots are no more considered. It follows that some local outputs as magnetic flux densities in teeth and back-iron, electromotive forces, etc. have to be retrieved from homogenised values. Secondly, the power electronics modelling based on state systems is presented. The solving process detailed in [START_REF] Gerbaud | Obtaining the most exact Jacobian for the time modelling of a power electronics structures to be used by gradient optimization algorithms[END_REF] is no more described and focus is made on how outputs and their derivatives in respect to the inputs are calculated for both sub-models.

Thirdly, optimization results are presented using the Pareto front considering the trade-offs between the total losses versus the volume of the machine. Optimal sizings are then compared to the reference one considering that the output power and the specifications are fixed. Then, Pareto results are extended to specific ones aiming to demonstrate how flying capacitor converters could also change the design trade-off to reduce the permanent magnet volume of the machine.

Global Sizing model

The global sizing model of the drive system is divided into sub-models as depicted in Fig. 2: the electrical machine sub-model and the power electronics one. The modelling of the machine aims to compute: the flux densities, the magnetic and Joule losses that are considered as outputs from geometric sizes and materials properties that are inputs. It must be noticed that other inputs have to be calculated by the power electronics sub-model as the current values (required to compute flux densities and Joule losses). Knowing that a loop appears between the inputs and the outputs of the two sub-models, it is worth to observe that there is no implicit solving. In the power electronics sub-model, the machine is represented by a linear equivalent electrical circuit model. Therefore, current value (rms and peak) are no more required and the equivalent electromotive force and the synchronous inductance are calculated without those.

Electrical waveforms are computed by the power electronics sub-models deducing: rms, average and peak values of the currents and voltages. The power output feeding the load is computed through electrical waveforms so harmonics effects and load angle changes are considered. Finally, as described in the following sections, all the derivatives of the outputs according to the inputs are also calculated by the sub-models.

Electrical machine modelling

The initial electrical machine is an existing one, described in [START_REF] Meier | Theoretical design of surface-mounted permanent magnet motors with field-weakening capability[END_REF]. It is a surface mounted permanent magnet synchronous generator with two pole pairs, 24 stator slots and full-pitch winding. It will be used both to validate the modelling and to estimate the reference operating point given by the generator supplying the load without power electronics converter. All the specifications of the machine are given in Table 1 and the geometric parameters are described in Fig. 3.

The aim of the design by optimization is to guide the engineers in the predesign phase. The goal is to evaluate the expected gain on the machine by associating it to a flying capacitor converter. High fidelity modelling (based on finite element (FE) simulation) used in design phase to reduce time-to-market and prototyping steps are not considered. In pre-design step, when engineers have to make choices, evaluating solutions and to defined specifications, focus is so made on a medium and low-fidelity modelling such as magnetic reluctance circuit [START_REF] Nguyen-Xuan | Efficient Reluctance Network Formulation for Electrical Machine Design Using Optimization[END_REF] and analytical harmonic modelling approach [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF] [8] [START_REF] Djelloul-Khedda | Semi-analytical magnetic field predicting in many structures of permanent-magnet synchronous machines considering the iron permeability[END_REF]. These modelling enable to compute the Jacobians and allowing the use of gradients based algorithms in optimizing framework. Analytical harmonic modelling is chosen here because it basically involves an homogenization step instead of a meshing one used in the other modelling approaches. It allows to describe various complex geometry by only one, replacing cut edges as slots, teeth and non-consequent permanent magnets by only equivalent concentric ring forms [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF].

This modelling was historically applied to various permanent magnet magnetization patterns (radial, parallel or tangential) and was recently improved to step forward both slotting effects and saturation [START_REF] Sprangers | Magnetic saturation in semi-analytical harmonic modelling for electric machine analysis[END_REF] [START_REF] Djelloul-Khedda | Semi-analytical magnetic field predicting in many structures of permanent-magnet synchronous machines considering the iron permeability[END_REF]. In the authors viewpoint, it follows that a modelling that could described in a parametric way various topologies of machines is attractive and should be supported.

It could also be noticed that after solving the field on annular forms, teeth and back-iron flux densities, demagnetizing field on magnets are suitably estimated even if geometrical effects were not precisely described due to the homogenization step.

In addition, the analytical modelling is based on the following hypothesis:

not taking into account 3D effects.

the initial geometry of the machine is replaced by concentric rings described by homogenised areas representing different magnetic regions, as described in Fig. 4.

the currents in the stator are represented by a linear current density at the stator inner diameter, equivalent to the ampere turns created by the coils and whose spatial distribution can be defined by:

(1)

𝑘 𝑠 (𝜑) = ∑ 𝐾 𝑠 𝑘 𝑤 𝑛 𝑠 𝑒 𝑖𝑛 𝑠 𝜑 𝑁 𝑛 𝑠 =0
where 𝑛 𝑠 is the spatial harmonic rank , 𝑘 𝑤 denotes the associated winding factor and 𝐾 𝑠 denotes the current source.

-Rotor and stator magnetic materials are the same and described by linear magnetic behaviour of relative permeability𝜇 𝑟 = 5600; the magnetic flux densities in teeth, back-iron and rotor will be estimated a posteriori and constrained during optimization process.

the permanent magnets are treated as a homogeneous medium depicted by a relative permeability 𝜇 𝑟𝑝𝑚 and a radial remanent magnetisation, continuously described by a Fourier series:

(2)

𝑀(𝜑) = ∑ 1 𝑛 𝐾 𝑝𝑚 𝑛 𝑟 𝑒 𝑖𝑛 𝑟 𝜑 ∞ 𝑛 𝑟 =1
where 𝑛 𝑟 is the spatial harmonic rank, 𝐾 𝑝𝑚 the associated harmonic amplitude of the magnetization given for radial magnetization pattern by:

(3) 𝐾 𝑝𝑚 𝑛 𝑟 = - )

)
where 𝑝 is the number of pair poles per phase and 𝛽 is the opening pole angle.

As depicted in the literature [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF][8], the magneto static field equations are reduced to Poisson and Laplace partial differential equations of the magnetic potential 𝐴 𝑧 ⃗⃗⃗⃗ (𝑟, 𝜑)𝑢 𝑧 ⃗⃗⃗⃗ in cylindrical coordinates , respectively in the permanent magnets and in all other areas: the magnetic stator and rotor, and the air-gap. The solutions of those equations are symbolically obtained by the Fourier method and are expressed as sum of spatial harmonics:

(4)

𝐴 𝑧 (𝑚) (𝑟, 𝜑) = ∑ (𝑎 𝑛 (𝑚) 𝑟 𝑛 + 𝑏 𝑛 (𝑚) 𝑟 -𝑛 ) 𝑒 𝑖𝑛𝜑 ∞ 𝑛=1
The solution of the Poisson equation in the magnet is given by:

(5)

𝐴 𝑧 (2) (𝑟, 𝜑) = ∑ (𝑎 𝑛 (2) 𝑟 𝑛 + 𝑏 𝑛 (2) 𝑟 -𝑛 + 𝐾 𝑝𝑚 𝑛 𝑟 𝑟 1-𝑛 2 ) 𝑒 𝑖𝑛𝜑 ∞ 𝑛=1
where 𝑎 𝑛 𝑚 and 𝑏 𝑛 𝑚 are coefficients that are found using the magnetic field interface conditions between areas denoted by over script (m): rotor (1), Permanent Magnet (PM) (2), air-gap (3) and stator (4) and air [START_REF] Meier | Theoretical design of surface-mounted permanent magnet motors with field-weakening capability[END_REF]. It follows that only eight coefficients are used to define the solutions in all the areas, 𝑏 𝑛 (1) and 𝑎 𝑛 (5) remaining zero due to boundary conditions at 𝑟 = 0 and 𝑟 = ∞. Interface conditions for radial magnetic flux density and orthoradial field strength are finally used to define eight linear equations:

(6)

( 𝜇 𝑟𝑝𝑚 𝜇 𝑟 -1 𝑅 1 -2𝑛 0 0 0 0 0 0 1 -𝑅 2 -2𝑛 -𝜇 𝑟𝑝𝑚 𝜇 𝑟𝑝𝑚 𝑅 2 -2𝑛 0 0 0 0 0 0 𝑢 𝑟 -𝜇 𝑟 𝑅 3 -2𝑛 -1 𝑅 3 -2𝑛 0 0 0 0 0 0 1 -𝑅 4 -2𝑛 𝜇 𝑟 𝑅 4 -2𝑛 1 -1 -𝑅 1 -2𝑛 0 0 0 0 0 0 1 𝑅 2 -2𝑛 -1 -𝑅 2 -2𝑛 0 0 0 0 0 0 1 𝑅 3 -2𝑛 -1 -𝑅 3 -2𝑛 0 0 0 0 0 0 1 𝑅 4 -2𝑛 -𝑅 4 -2𝑛 ) ⋅ ( 𝑎 1 𝑛 𝑎 2 𝑛 𝑏 2 𝑛 𝑎 3 𝑛 𝑏 3 𝑛 𝑎 4 𝑛 𝑏 4 𝑛 𝑎 5 𝑛 ) = ( 𝐾 𝑝𝑚 𝑛 𝑅 1 1-𝑛 𝑛(1-𝑛 2 ) -𝐾 𝑝𝑚 𝑛 𝑅 2 1-𝑛 𝑛(1-𝑛 2 ) 0 0 𝐾 𝑝𝑚 𝑛 𝑅 1 1-𝑛 1-𝑛 2 -𝐾 𝑝𝑚 𝑛 𝑅 2 1-𝑛 1-𝑛 2 0 0 ) or ( 0 0 -𝐾 𝑠 𝑛 𝜇 𝑟 𝑛 𝑅 3 1-𝑛 0 0 0 0 0 )
where 𝑅 1 ,𝑅 2 ,𝑅 3 ,𝑅 4 are radius delimiting areas as described if Fig. 4.

The linear system ( 6) is written as matrix one CX = D and according to superposition property of linear system, the source vector D is splitted up, depending on the source taken into account. The corresponding unknown coefficients are then denoted by subscript "r" for rotor source (magnets) and subscript "s" for stator source (currents).

As rotor and stator saliencies are not taken into account due to homogenisation approach and according to the Curie principle, the harmonic contents to be considered are those of the linear current density (2) and the magnetisation (1) in the PM [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF].

Calculated outputs

Knowing the magnetic potential values in the homogenised areas, a backward calculation from the homogenisation step are applied and the local magnetic flux densities values are estimated in the machine.

The magnetic flux per pole is calculated using the circulation of the magnetic potential around the arc defined by the stator inner radius and the pole angle 𝜋/𝑝:

𝜙 𝑝𝑜𝑙𝑒 = (𝐴 (4) (𝑅 3 , 𝜑 𝑖 , 𝑡) -𝐴 (4)

(𝑅 3 , 𝜑 𝑖 + 𝜋 𝑝 , 𝑡)) ⋅ 𝐿
where L is the active length of the machine, 𝜑 𝑖 is the reference angle of the pole defined by the rotor position, 𝐴 (4) denotes the total potential due to both rotor and stator sources 𝐴 (4) (𝑟, 𝜑) = 𝐴 𝑟 (4) (𝑟, 𝜑 + 𝛼) + 𝐴 𝑠 (4) (𝑟, 𝜑), 𝛼 denotes the load angle.

The magnetic flux flowing in the back-iron is then estimated considering that the flux per pole split up into the two consequent poles. Then the average magnetic flux density is calculated according to the back-iron cross section and will be constrained in the optimization step (see section 6).

The magnetic flux in the teeth are estimated in the same way, considering the pitch angle. To validate our approach, magnetic flux density in two consequent teeth and in the back-iron are compared to FE simulation results for the initial machine in Fig 5 and shows good agreements between waveforms with errors less than 15% on the peak values and 31.5% on the rms derivatives that are quantities used to compute magnetic losses. It demonstrates that the modelling of the machine using simple geometry remains relevant at the scale of teeth when using reverse homogenisation step to estimate local flux densities.

When the magnetic flux densities in the teeth and the back-iron, and their time derivatives are well calculated, the magnetic losses in the stator are estimated by the Bertotti model. This one is based on physical meaning that losses could be separately estimated into hysteresis, Eddy current and excess losses [START_REF] Bertotti | General Properties of Power Losses in Soft Ferromagnetic Materials[END_REF]. The magnetic loss density in W/𝑚 3 is then easily calculated by: ( 8)

𝑃 𝑙𝑜𝑠𝑠𝑒𝑠 = 1 𝑇 ⋅ ∫ (𝑘 ℎ 𝑓𝐵 𝑚 2 + 𝜎𝑑 2 12 ( 𝑑𝐵(𝑡) 𝑑𝑡 ) 2 + 𝑘 𝑒 | 𝑑𝐵(𝑡) 𝑑𝑡 | 3 2 ) 𝑑𝑡 𝑇 0
As depicted in [START_REF] Meier | Theoretical design of surface-mounted permanent magnet motors with field-weakening capability[END_REF], the magnetic cores are made of M800-65A electrical steel sheets with the coefficients:𝑘 ℎ = 279.81 ; 𝜎 = 4 ⋅ 10 -6 ; 𝑘 𝑒 = 1.28.

When designing permanent magnet actuators, one has to consider the field strength in the magnet to avoid their demagnetization. In our application case, magnetic field in the magnets could be increased by the reduction of their thickness and by increasing the stator current. It is so very important to estimate the magnetic flux density in the magnets in the optimization step. According to our modelling, the radial flux density is easily deduced from the magnetic potential in the magnet by:

(9) 𝐵 𝑟 (𝑟, 𝜑) = 1 𝑟 𝜕𝐴 2 (𝑟,𝜑) 𝜕𝜑
The flux density is then estimated depending in the load angle and where the field due to the stator is opposite to the one of the magnet, describing the worst case to be constrained. Fig 6 shows the radial flux density in the magnet for the reference machine and the circle gives the retained value.

Electrical equivalent circuit modelling:

In order to consider the machine in the time simulation involved by power electronics and system modelling, the previous modelling is reduced to an electrical equivalent circuit. Assuming that the machine has no salient poles, and that the saturation is no more acting beyond the slot wedges, the machine is represented by the well-known Behn-Eschenburg circuit per phase (assuming balanced 3 phases).

The electromotive force (emf) denoted by the voltage source E is deduced from the magnetic flux due to permanent magnets (𝜙 𝑟 ) and viewed by the coil considering equation [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF] with 𝐴 𝑟 (4) in respect of 𝐴 (4) . So, it is estimated considering the difference of the magnetic potential calculated at the slot opening. In the case of the initial machine with two slots per pole per phase, it is given by: where, N is the number of turns per slots, 𝜔.is the electrical pulsation.

The electromotive force is depicted in Fig. 6 considering harmonics up to 17 th rank and show good agreement with FE simulations.

In the same way, the inductance is deduced from the total magnetic flux due to the current flowing in the stator and viewed by the coil divided by the current itself. It is expressed by 𝜙 𝑠 replacing here 𝐴 (4) by 𝐴 𝑠 (4) in equation [START_REF] Zhu | Instantaneous field distribution In Brushless Permanent Magnet DC motors. Part I: Open-Circuit Field[END_REF]. The synchronous inductance is thus related to the cyclic inductance and is estimated by: (11)

𝐿 𝑠 = 3 2 𝑁𝛷 𝑠 𝑚𝑎𝑥 𝐼 𝑚𝑎𝑥
where 𝛷 𝑠𝑚𝑎𝑥 and 𝐼 𝑚𝑎𝑥 are respectively the maximum value of the magnetic flux and the current flowing in the coil.

It should also be noticed that all the fluxes are estimated at the stator inner radius. It results that the leackage flux between teeth are not taken into account and may cause some inaccuracies when estimating the average flux in teeth and the synchronous inductance. The error is about 1.7% for the initial machine with 𝐿 𝑠 = 390𝜇𝐻 estimated by the model compared to 𝐿 𝑠 = 397 𝜇𝐻 calculated by FE simulations.

Finally, the resistance 𝑅 𝑠 is only depending on the stator sizes. To validate the resistance calculation, FE simulations are not relevant (2D and the winding not precisely described in slots) and the considered value is the same in both modelling. Finally, the stator Joule losses is simply calculated using:

𝑃 𝐽𝑜𝑢𝑙𝑒 = 3 𝑅 𝐼 𝑟𝑚𝑠 2

Derivatives related to the machine modelling:

Derivatives of all the outputs (𝑃 𝑙𝑜𝑠𝑠𝑒𝑠 , 𝑃 𝐽𝑜𝑢𝑙𝑒 , 𝐿 𝑠 , flux densities, ...) according to the inputs (geometric parameters, magnetic properties) are all deduced from those of magnetic potential coefficients 𝑎 𝑛 (𝑚) by chain rules.

Assuming the matrix equation CX = D and denoting P the vector of all the input parameters, the derivative of the matrix equation C X = D with respect to P, is:

(13) 𝐶 𝜕𝑋 𝜕𝑃 = 𝜕𝐷 𝜕𝑃 -𝑋 𝜕𝐶 𝜕𝑃
This new matrix equation has the same first member matrix C than the initial one [START_REF] Nguyen-Xuan | Efficient Reluctance Network Formulation for Electrical Machine Design Using Optimization[END_REF]. So, the LU decomposition used to solve ( 6) is simply re-use to solve [START_REF] Delinchant | An Optimizer Using the Software Component Paradign for the Optimization of Engineering Systems[END_REF] enabling to compute the derivatives without large additional computational and so time-consuming effort [START_REF] Gerbaud | Selectivity in Frequency Modelling of Electrical Circuit for the Sizing by Optimization of EMC Filter for Power Electronics[END_REF].

Power electronics modelling:

Model:

The power electronics converter is composed of three single-phase full bridge with flying capacitor as depicted in Fig 1 [START_REF] Morel | Output Power Control of a Surface Mounted Permanent Magnet Synchronous Generator Coupled With Electronic Capacitor System[END_REF]. The whole system consisting of the generator and the converter is assumed to operate in a three-phase balanced mode. It results that only an equivalent single phase is then considered.

The main objective is to compute the electrical waveforms at the switching frequency so switches and capacitor are assumed ideal. It results that the converter can be seen as a capacitor connected in one direction or in the other depending of the control or even as a short-circuit bypassing the capacitor when it is fully discharged [START_REF] Takaku | Improved Wind Power Conversion System Using Magnetic Energy Recovery Switch (MERS)[END_REF]. It define three possible circuit topologies during an operating period as shown in Fig. 7 from which three different state systems are derived.

The state systems of circuit representations are solved in time domain using Runge-Kutta method (RK44) combined with an adaptive time step-size control strategy [START_REF] Gerbaud | Obtaining the most exact Jacobian for the time modelling of a power electronics structures to be used by gradient optimization algorithms[END_REF]. Tests on control to detect hard switching events and test on zero crossing of the voltage across the capacitor to detect soft switching of diodes are implemented to manage the solving process between the state systems.

The outputs of the model are extrema, rms values of currents and voltages, as well as average values. They are computed on one operating period, at steady state.

The integral expressions involved in the computation of the rms and average values, are carried out using trapeze method. Extrema are found using an algorithm based on tests on the corresponding variables.

Derivatives

Paper [START_REF] Gerbaud | Obtaining the most exact Jacobian for the time modelling of a power electronics structures to be used by gradient optimization algorithms[END_REF] discusses methods to compute the Jacobian of a time model of power electronics converters in the aim of sizing them using gradients based optimization. The method described in [START_REF] Fisher | From the Electronic Circuit to the Simulation Component: An Automatic Component Building Process[END_REF] is retained and a new state system that involves both state equations and their derivatives with respect to sizing parameters (𝐸, 𝐿 𝑠 , 𝑅 𝑠 , 𝑅 𝑐ℎ ) is derived.

It allows solving the state variables and their derivatives in the same solving process.

Then, derivatives of outputs are obtained using several mathematic methods. The limit of the approach is the fact that derivatives according parameters formulated in a non-continuous way (control variables) are obtained using finite difference.

Implementation

The global sizing model has been implemented using CADES framework [START_REF] Delinchant | An Optimizer Using the Software Component Paradign for the Optimization of Engineering Systems[END_REF]. A specificity of CADES is its ability of coupling different models by exploiting the concept of software components. The electrical machine model and power electronics models, as well as the computation of their derivatives are implemented in Java language. Other analytical equations are defined for the coupling of models and the Joule and core losses. They are implemented in SML language and there derivatives are obtained using the automatic differentiation tool Adol-C implemented in CADES (Fig 8). Optimizations are carried out with SQP (VF-13 from Harwell library).

Optimization results and discussion

Specifications

The pre-design steps aims to determine the trade-offs that are acting on the sizing of the machine when it is driven by a flying capacitor converter. As previously said, the flying capacitor is suitable to boost the voltage across the machine by compensating the reactive energy and so hiding the drop voltage across the synchronous inductance.

It results that, on one hand, the current and voltage could be higher, increasing the output power; or, on the other hand, the electromotive force could be smaller for the same output power. We choose to evaluate the design tradeoff on the second way and we focus on reducing the volume of the machine under the constraint of constant power output. The output power is constrained and defined by the maximum output power supplied by the reference machine (3.6kW) (Initial machine in Table 2) [START_REF] Meier | Theoretical design of surface-mounted permanent magnet motors with field-weakening capability[END_REF] connected to a resistive load without flying capacitor depicting the reference study case. The load resistance remains fixed during the optimization steps (𝑅 𝑙𝑜𝑎𝑑 = 0.12 𝛺), as well as the mechanical speed (1500 rpm). Therefore, mechanical losses are identical for the two machine (the initial machine and the optimized one) and are not taken into account in this study.

The design problem has ten input parameters including six geometrical sizes (magnet thickness, pole opening angle, external stator radius, back-iron thickness and tooth width and slot depth), the number of turns per slot and the current density and two parameters associated to the converter (the capacitor value and the control angle). The active length of the machine is fixed because of the 2D modelling and the lack of describing the end-windings effects. There are five outputs performances: the Joule and magnetic losses, the flux densities in the teeth and in the back iron and the machine volume. The flux densities are constrained to remain below 1.8T in teeth and below 1.4T in the back iron. The demagnetizing field in the magnet is estimated in the worst area of the magnet depending of the load angle of the machine. Its value is constrained to 0.1T to avoid operating point close to the coercive field strength.

Two objectives are considered: the global volume of the machine (related to the power density because output power is fixed) and the total losses. So a Pareto strategy is used.

Pareto front building

The Pareto front is obtained by SQP optimisation minimizing the total losses according to 12 sampled values of the volume. These values are spread out in the range defined by the two limits of the Pareto front obtained from two optimisation: minimizing the total losses and minimizing the machine volume. The Pareto front is computed in approximatively 15 min on standard PC (Windows 10, core i5@2.6GHz, 4Go Ram).

Fig. 9 presents this front. The initial machine (reference) appears in blue in the figure.

Chosen machine

It is valuable to compare the initial machine to the solution from the Pareto curve that offers a good compromise between objectives point circle on Fig. 9 and denoted by Optim N°1 in Table 2.The main difference between the two machines are summarized in Fig. 10 The optimized machine exhibits a volume of 1840cm 3 (35% lower than the initial machine). The output power is fixed at 3.6kW so power density is increased by 35% too. The thermal modelling is not considered here. So one as to notice that the thermal management should be more constrained considering the optimal machine with lower losses decreasing by 14% with an external surface reduced by 19%. However, in the other hand, the ratio between Joule and core losses changes significantly from 2.8 to 1.6 allowing re-considering the thermal management issue.

As expected, the flux densities are increased in the teeth (+12.5%) but mainly in the back-iron (+73%). Whereas the magnetic flux density values goes up, the core volume goes down. So, finally, the magnetic losses increase by 25%.

At the opposite, the Joule losses decreases by 28% because of the reduced number of turns per slot and of the lower sizes of the machine. The current density increases from 3.76A/mm² (reference machine) to 4.38A/mm, so, the slot area decreases by 48% while the current rms value is kept at 100A. It should be noticed that the Ampereturns per slot are reduced, so the magnetic field due to the stator coils is lower in the optimal machine than in the initial one. In addition, the permanent magnet thickness is increased by 59%, increasing the field due to the rotor source. The electromotive force (emf) is at the opposite reduced by 37% due to the lower number of turns per slot.

According to that, it is valuable to highlight that the phase-angle between the emf and the current is reduced as depicted in Fig. 11. The flying capacitor is able to change the current waveform and the phase-angle, with respect to the emf, i.e. the load angle to keep the output power constant. The converter is operating in a discontinuous mode where C is 31.3mF and the control angle 𝛿 is 0.35. The voltage across the capacitor is low compared to the emf values and remains below 10V as shown in Fig. 11 (Optim 1)

In order to validate the optimization results, finite element simulation of the complete drive system (PMSM connected in series with a flying capacitor) are carried out in a transient magnetic application with 𝐴𝑙𝑡𝑎𝑖𝑟 𝐹𝑙𝑢𝑥 𝑇𝑀 software. Flux software is using field-circuit coupling: FE equations are coupled with circuit equations; the converter is defined using ideal switches and diodes as shown in Fig. 12

Other solutions

Finally, the paper focuses on the volume of permanent magnets in the machine. When reducing the volume of the machine (Optim N°1 in Table 2) the volume of the magnets is increased by 87.5% up to 27cm 3 with respect of the initial machine. Two more optimizations are so made to minimize the volume of the magnets. One way is to set the volume of the machine to the one of the reduced machine (Optim N°1) and to minimize the magnet volume instead of the total losses. It results in a poor design (Optim N°2) where the losses are increased by 250% whereas the volume is reduced, leading to an important thermal issue. The other way is to choose to minimize the magnet volume and to set the total losses and volume at their initial values (Optim N°3), avoiding thermal issues. It results that the magnet thickness is greatly reduced down to 1.12mm and the magnet volume is reduced by 60%. It is valuable to noticed that the flux density in the magnet is decreased to 0.25T but above the lower limit: 0.1T. In the same way, the use of the switched capacitor allows the reduction of the phase-angle between the electromotive force and the current as shown in Fig. 11 Optim N°3. It makes possible to provide the same power to load, despite the reduction of the amplitude of electromotive force, compared to the initial electrical drive. However, it can be noticed that the flux densities in airgap (due from one hand to the magnet and to the other hand to the current in stator) are well balanced, as shown in Fig. 14.

According to the converter, the capacitor value is 40mF but the voltage is increased up to 24V and the RMS current flowing in the capacitor is about 100A in DC-offset mode.

Optimization results and discussions

The paper has proposed a complete model of an electrical drives. This model is spilt up in two sub-models: the machine model based on Maxwell equations and the electrical drive model based on ideal circuit representation.

These models are faster than FEM element models or time simulation tools, and they implement their jacobian useful for SQP optimisations. Pareto front are obtained and discussed for the studied electrical drive.

In future works, for the studied drive, it will be interesting to precisely designing the converter for the operating point of the solution (optim N°4) in order to investigate a way that the flying capacitor could efficiently reduce the magnets volume.

Tables Table 1: parameters of the studied permanent magnet synchronous machine.

Geometrical parameters

Rotor radius (𝑅

Figure captions

Fig. 1: Electrical drive of studied application. (Optim N°1 in Table 2).

Fig. 14: Comparison of radial induction created in the airgap for the initial machine and the optimal machine minimizing the volume of magnets (Optim N°3 in Table 2)

( 10 )

 10 𝐸(𝑡) = 𝑁 𝑝 𝜔 (𝐴 𝑟(4) (𝑅 3 , 𝜑 𝑖 , 𝑡) -𝐴 𝑟(4) (𝑅 3 , 𝜑 𝑖 +

Fig. 13 .

 13 Fig. 13. It results that good agreements between both modelling is obtained with errors less than 10% on current and flux densities. The voltage across the capacitor of the converter is miscalculated due to bad zero-crossing detection because the time step is too large in the FE transient application. It also validate the robustness of the sizing model according to parametric variations.

Fig. 2 :Fig. 3 :Fig. 4 :Fig. 5 :

 2345 Fig. 2: Architecture of the global sizing model of the electrical drive Fig. 3: Geometry of one pole of the studied machine.Fig. 4: Modelling of the electrical machine: geometric simplification. Fig. 5: Comparison of magnetic flux densities in teeth and back-iron issue from analytical model and finite element simulation for the initial machine.

Fig. 6 :

 6 Fig. 6: Comparison of electromotive force and flux density in the permanent magnets obtained by analytical model and finite element simulation, for the initial machine.

Fig. 7 :

 7 Fig. 7: Equivalent single-phase circuit representation of studied electrical drives and state circuit topologies.

Fig. 8 :

 8 Fig. 8: Global sizing model: Implementation in CADES Framework.

Fig. 9 :

 9 Fig. 9: The Pareto front minimizing the total losses in the machine according to values the volume.

Fig 10 :

 10 Fig 10: Comparison between the initial machine and the chosen solution (Optim N°1 in Table2) from Pareto front.

Fig. 11 :Fig. 12 :

 1112 Fig. 11: Comparison of waveforms for initial machine and optimums. Fig. 12: Circuit diagram of the drive system in 𝐴𝑙𝑡𝑎𝑖𝑟 𝐹𝑙𝑢𝑥 𝑇𝑀

Fig. 13 :

 13 Fig. 13: Comparison waveforms issues for analytical model and finite element simulation, for the optimal machine

  Figures

Fig. 2 .

 2 Fig. 2.

Fig. 3 .

 3 Fig. 3.

Fig. 4

 4 Fig. 4.

  Fig. 9.

Table 2 :

 2 Optimization results.

	1 ) [mm]	25.89
	Stator radius (𝑅 4 ) [mm]	75
	Average teeth thickness (𝑏 𝑡𝑠 ) [mm]	3.62
	Magnets thickness (ℎ 𝑚 ) [mm]	3.14
	Magnet pole's opening angle (𝜓 𝑚 ) [°]	60
	Slot deep (ℎ 𝑠𝑠 ) [mm]	32.5
	Back-iron thickness (ℎ 𝑠𝑦 ) [mm]	12.5
	Air gap (GAP) [mm]	1
	Active length (L) [mm]	160
	Physical parameters
	Number of turn per slot (N)	5
	Residual induction of the magnet [T]	1.1
	Relative permeability of the magnetic circuit
	material(𝜇 𝑟 )	5600