{"id":4154,"date":"2023-03-18T11:33:21","date_gmt":"2023-03-18T10:33:21","guid":{"rendered":"http:\/\/mosaic-modeling.de\/?page_id=4154"},"modified":"2023-08-22T09:52:57","modified_gmt":"2023-08-22T08:52:57","slug":"model-function","status":"publish","type":"page","link":"https:\/\/mosaic-modeling.de\/?page_id=4154","title":{"rendered":"Model: Function"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">On this page<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mosaic-modeling.de\/?page_id=4154\/#Purpose\" >Purpose<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mosaic-modeling.de\/?page_id=4154\/#Explanation-of-the-editor\" >Explanation of the editor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mosaic-modeling.de\/?page_id=4154\/#Workflow\" >Workflow<\/a><\/li><\/ul><\/nav><\/div>\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong>Optional element<\/strong><\/p>\n\n\n<h3><span class=\"ez-toc-section\" id=\"Purpose\"><\/span>Purpose<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Functions are very useful when values need to be calculated and it is undesirable to introduce additional variables or equations. Possible applications include calculation of enthalpy, phase equilibrium factors, etc. Functions in MOSAICmodeling have one output value and several input values. MOSAICmodeling functions have two different purposes:<\/p>\n<ol>\n<li>They can replace explicit equations, e.g., an equation to calculate the investment costs within your model.<\/li>\n<li>They provide an interface to external software via external function calls, e.g., to calculate thermodynamic calculations.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Explanation-of-the-editor\"><\/span>Explanation of the editor<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In general, the notation of a function is independent of the notation used in the equation system. However, there must be a mechanism to define which of the variables in the equation system are the input values and which is the output value. In programming languages, the input values are assigned according to the order in which they appear within the function call.<\/p>\n<p>The modeling in MOSAICmodeling, however, is focused on the variable naming and pursues the concept of synonymous variable namings. Thus, the function is applied by assigning the variable namings of the input variables and the output variable of the function explicitly to the namings of the corresponding variables in the equation system. The advantage of applying the function in this way is that the focus is kept on the physical meaning of the variable. Errors from handing over variables in the wrong order are thus eliminated.<\/p>\n<p>The function editor is shown in Figure 1.<\/p>\n<figure id=\"attachment_3001\" aria-describedby=\"caption-attachment-3001\" style=\"width: 1005px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/mosaic-modeling.de\/wp-content\/uploads\/2016\/12\/FunctionEditor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3001 size-full\" src=\"http:\/\/mosaic-modeling.de\/wp-content\/uploads\/2016\/12\/FunctionEditor.png\" alt=\"\" width=\"1005\" height=\"693\" srcset=\"https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2016\/12\/FunctionEditor.png 1005w, https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2016\/12\/FunctionEditor-300x207.png 300w, https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2016\/12\/FunctionEditor-768x530.png 768w\" sizes=\"auto, (max-width: 1005px) 100vw, 1005px\" \/><\/a><figcaption id=\"caption-attachment-3001\" class=\"wp-caption-text\">Figure 1: The function editor inside MOSAICmodeling lets you define the function body, i.e., the calculating equation, that returns the output based on the given inputs.<\/figcaption><\/figure>\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Element<\/th><th class=\"has-text-align-left\" data-align=\"left\">Explanation<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">File<\/td><td class=\"has-text-align-left\" data-align=\"left\">Filename of your function once you have saved or loaded it<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Notation<\/td><td class=\"has-text-align-left\" data-align=\"left\">Notation on which your function is based<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Parameters<\/td><td class=\"has-text-align-left\" data-align=\"left\">Optionally defined parameters from a parameter list<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Description<\/td><td class=\"has-text-align-left\" data-align=\"left\">Description of the function<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Keywords<\/td><td class=\"has-text-align-left\" data-align=\"left\">Optional keywords for the current function<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Usages<\/td><td class=\"has-text-align-left\" data-align=\"left\">Model elements, i.e., equations or functions, in which the function is used<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Interface &amp; Body Settings<\/td><td class=\"has-text-align-left\" data-align=\"left\">Lets you set the interface and body settings below<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Interface Settings<\/td><td class=\"has-text-align-left\" data-align=\"left\">Select whether you want to define a free interface or load a previously defined interface<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Body Settings<\/td><td class=\"has-text-align-left\" data-align=\"left\">Select whether you want to supply a specific formula or use an empty body (for now)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Interface Specification<\/td><td class=\"has-text-align-left\" data-align=\"left\">Add all input and output variables for the function. The used symbols must be defined in the loaded notation<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">Body Specification<\/td><td class=\"has-text-align-left\" data-align=\"left\">Should you have selected &#8220;specific formula&#8221; in the body settings, you can supply the respective function here<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Table 1: Elements of the function editor.<\/figcaption><\/figure>\n\n\n<h3><span class=\"ez-toc-section\" id=\"Workflow\"><\/span>Workflow<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Figure 2 illustrates the workflow to set up a function.<\/p>\n<figure id=\"attachment_3012\" aria-describedby=\"caption-attachment-3012\" style=\"width: 804px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3012\" src=\"http:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8.png\" alt=\"\" width=\"804\" height=\"1386\" srcset=\"https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8.png 804w, https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8-174x300.png 174w, https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8-768x1324.png 768w, https:\/\/mosaic-modeling.de\/wp-content\/uploads\/2015\/08\/drawit-diagram-8-594x1024.png 594w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/a><figcaption id=\"caption-attachment-3012\" class=\"wp-caption-text\">Figure 2: Workflow to set up a function.<\/figcaption><\/figure>","protected":false},"excerpt":{"rendered":"<p>Optional element Purpose Functions are very useful when values need to be calculated and it is undesirable to introduce additional variables or equations. Possible applications include calculation of enthalpy, phase equilibrium factors, etc. Functions in MOSAICmodeling have one output value and several input values. MOSAICmodeling functions have two different purposes: They can replace explicit equations, [&hellip;]<\/p>\n","protected":false},"author":252,"featured_media":0,"parent":4140,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4154","page","type-page","status-publish","czr-hentry"],"_links":{"self":[{"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/pages\/4154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/users\/252"}],"replies":[{"embeddable":true,"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4154"}],"version-history":[{"count":7,"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/pages\/4154\/revisions"}],"predecessor-version":[{"id":5683,"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/pages\/4154\/revisions\/5683"}],"up":[{"embeddable":true,"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=\/wp\/v2\/pages\/4140"}],"wp:attachment":[{"href":"https:\/\/mosaic-modeling.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}