 <head>
 <script type="text/javascript" id="MathJax-script" async
         src="https://cdn.jsdelivr.net/npm/mathjax@3.0.0/es5/tex-mml-chtml.js">
 </script>
 <style>
         table {
           margin-left: 0;
           margin-right: auto;
           margin-bottom: 24px;
           border-spacing: 0;
           border-bottom: 2px solid black;
           border-top: 2px solid black;
         }
         table th {
           padding: 3px 10px;
           background-color: white;
           border-top: none;
           border-left: 1px solid black;
           border-right: 1px solid black;
           border-bottom: 1px solid black;
           text-align: center;
         }
         table td {
           padding: 3px 10px;
           border-top: 1px solid black;
           border-left: 1px solid black;
           border-bottom: 1px solid black;
           border-right: 1px solid black;
           text-align: center;
         }
</style>
</style>
</head>
<body>
<h1 id="title"> {{ title }} </h1>

{% for values in answers.model.values %}
    
    {% if forloop.counter == 1 %}
        <h1 id="MathematicalModel"> Mathematical Models </h1>
    {% endif %}
    
    <h2 id="MM{{ forloop.counter }}"> MM{{ forloop.counter }}: {{ values.Name }} </h2>

    <p>
        {% if values.Description %}
            <b>Description</b>: {{ values.Description }} <br>
        {% endif %}
        {% if 'not found' in values.ID %} 
            <b>ID</b>: - 
        {% elif 'mathmoddb' in values.ID %} 
            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
        {% elif 'mardi' in values.ID %} 
            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
        {% elif 'wikidata' in values.ID %} 
            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
        {% endif %} 
    <br>
    </p>
    {% if values.Properties %}
        <b>Properties</b>: {% for value in values.Properties.values %} 
                   {% if value == option.isConvex %} 
	    		       Is Convex 
	    		   {% elif value == option.isNotConvex %} 
	    		       Is Not Convex 
	    		   {% elif value == option.isDeterministic %} 
	    		       Is Deterministic 
	    		   {% elif value == option.isStochastic %} 
	    		       Is Stochastic 
	    		   {% elif value == option.isDimensionless %} 
	    		       Is Dimensionless 
	    		   {% elif value == option.isDimensional %} 
	    		       Is Dimensional 
	    		   {% elif value == option.isDynamic %} 
	    		       Is Dynamic 
	    		   {% elif value == option.isStatic %} 
	    		       Is Static 
	    		   {% elif value == option.isLinear %} 
	    		       Is Linear 
	    		   {% elif value == option.isNotLinear %} 
	    		       Is Not Linear 
	    		   {% elif value == option.isSpaceContinuous %} 
	    		       Is Space-Continuous 
	    		   {% elif value == option.isSpaceDiscrete %} 
	    		       Is Space-Discrete 
	    		   {% elif value == option.isSpaceIndependent %} 
	    		       Is Space-Independent 
	    		   {% elif value == option.isTimeContinuous %} 
	    		       Is Time-Continuous 
	    		   {% elif value == option.isTimeDiscrete %} 
	    		       Is Time-Discrete 
	    		   {% elif value == option.isTimeIndependent %} 
	    		       Is Time-Independent 
	    		   {% endif %} 
	    		   {% if not forloop.last %}
	    		       , 
	    		   {% endif %} 
	    	       {% endfor %}
    {% endif %}

    {% for models in values.RelationRP1.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToResearchProblems"> Relations to Research Problems </h3>
        {% endif %}
	models: {{ models.1 }} <br>
    {% endfor %}

    {% for relation in values.RelationMM1.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToMathematicalModels"> Relations to Mathematical Models </h3>
        {% endif %}

        {% if relation.0 == option.generalizedByModel %} 
	    generalized by Model: {{relation.1 }} <br>
        {% elif relation.0 == option.generalizesModel %} 
	    generalizes Model: {{relation.1 }} <br>
        {% elif relation.0 == option.discretizedByModel %} 
	    discretized by Model: {{relation.1 }} <br>
        {% elif relation.0 == option.discretizesModel %} 
	    discretizes Model: {{relation.1 }} <br>
        {% elif relation.0 == option.containedInModel %} 
	    contained in Model: {{relation.1 }} <br>
        {% elif relation.0 == option.containsModel %} 
	    contains Model: {{relation.1 }} <br>
        {% elif relation.0 == option.approximatedByModel %} 
	    approximated by Model: {{relation.1 }} <br>
        {% elif relation.0 == option.approximatesModel %} 
	    approximates Model: {{relation.1 }} <br>
        {% elif relation.0 == option.linearizedByModel %} 
	    linearized by Model: {{relation.1 }} <br>
        {% elif relation.0 == option.linearizesModel %} 
	    linearizes Model: {{relation.1 }} <br>
        {% elif relation.0 == option.similarToModel %} 
	    similar to Model: {{relation.1 }} <br>
        {% endif %}
    {% endfor %}

    {% for values in answers.formulation.values %}
        {% if forloop.counter == 1 %}
            <h2 id="MathematicalFormulations"> List of Mathematical Formulations </h2>
        {% endif %}
        {% for models in values.RelationMM1.values %}
            {% if models.1 == forloop.parentloop.parentloop.counter %}
            <h3 id="MF{{ forloop.parentloop.counter }}"> MF{{ forloop.parentloop.counter }}: {{ values.Name }} </h3>
            <p>
                {% if values.Description %}
                    <b>Description</b>: {{ values.Description }} <br>
                {% endif %}
                {% if 'not found' in values.ID %} 
                    <b>ID</b>: - 
                {% elif 'mathmoddb' in values.ID %} 
                    <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
                {% elif 'mardi' in values.ID %} 
                    <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
                {% elif 'wikidata' in values.ID %} 
                    <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
                {% endif %} 
                <br>
            </p>
            <p>
                {% if values.Formula %}
                    <b>Defining formulations</b>: 
                                                  {%for value in values.Formula.values %} 
                                                      \( {{ value|cut:"$" }} \) 
                                                      {% if not forloop.last %}
                                                          , 
                                                      {% endif %} 
                                                  {% endfor %}
                    </p>
                        <br>
                        <table border="1">
                                    <colgroup>
                                        <col style="width: 10%" />
                                        <col style="width: 15%" />
                                        <col style="width: 15%" />
                                        <col style="width: 15%" />
                                        <col style="width: 15%" />
                            <col style="width: 30%" />
                                    </colgroup>
                                    <thead>
                                        <tr class="header">
                                            <th style="text-align: center; vertical-align: middle;">Symbol</th>
                                            <th style="text-align: center; vertical-align: middle;">Quantity</th>
                                            <th style="text-align: center; vertical-align: middle;">Quantity ID</th>
                                            <th style="text-align: center; vertical-align: middle;">Quantity Kind</th>
                                            <th style="text-align: center; vertical-align: middle;">Quantity Kind ID</th>
                                <th style="text-align: center; vertical-align: middle;">Description</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for value in values.element.values %}
                                            <tr>
                                                <td style="text-align: center; vertical-align: middle;">${{ value.symbol }}$</td>
                                                <td style="text-align: center; vertical-align: middle;">{% if value.Info %} 
                                                                                        {{ value.Info.Name }} 
                                                            {% else %} 
                                                                {{ value.Quantity }} 
                                                            {% endif %}</td>
                                                <td style="text-align: center; vertical-align: middle;">{{ value.Info.QID }}</td>
                                                <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKName }}</td>
                                                <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKID }}</td>
                                                <td style="text-align: center; vertical-align: middle;">{{ value.Info.Description }}</td>				
                                            </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                                <br>
                {% endif %}
            {% if values.Properties %}
                <b>Properties</b>:  
                               {% for value in values.Properties.values %} 
                                   {% if value == option.isConvex %} 
                                        Is Convex 
                                   {% elif value == option.isNotConvex %} 
                                       Is Not Convex 
                                   {% elif value == option.isDeterministic %} 
                                       Is Deterministic 
                                   {% elif value == option.isStochastic %} 
                                       Is Stochastic 
                                   {% elif value == option.isDimensionless %} 
                                       Is Dimensionless 
                                   {% elif value == option.isDimensional %} 
                                       Is Dimensional 
                                   {% elif value == option.isDynamic %} 
                                       Is Dynamic 
                                   {% elif value == option.isStatic %} 
                                       Is Static 
                                   {% elif value == option.isLinear %} 
                                       Is Linear 
                                   {% elif value == option.isNotLinear %} 
                                       Is Not Linear 
                                   {% elif value == option.isSpaceContinuous %} 
                                       Is Space-Continuous 
                                   {% elif value == option.isSpaceDiscrete %} 
                                       Is Space-Discrete 
                                   {% elif value == option.isSpaceIndependent %} 
                                       Is Space-Independent 
                                   {% elif value == option.isTimeContinuous %} 
                                       Is Time-Continuous 
                                   {% elif value == option.isTimeDiscrete %} 
                                       Is Time-Discrete 
                                   {% elif value == option.isTimeIndependent %} 
                                       Is Time-Independent 
                                   {% endif %} 
                                   {% if not forloop.last %}
                                       , 
                                   {% endif %} 
                               {% endfor %}
                    {% endif %}

                {% for values in values.RelationMM1.values %}
                    {% if forloop.counter == 1 %}
                        <h3 id="RelationsToMathematicalModels2"> Relations to Mathematical Models </h3>
                    {% endif %}

                    {%if values.0 == option.containedAsAssumptionIn %} 
		        contained as Assumption in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsBoundaryConditionIn %} 
		        contained as Boundary Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsConstraintConditionIn %} 
		        contained as Constraint Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsCouplingConditionIn %} 
		        contained as Coupling Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFormulationIn %} 
		        contained as Formulation in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsInitialConditionIn %} 
		        contained as Initial Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFinalConditionIn %} 
		        contained as Final Condition in: {{ values.2 }} <br>
                    {% endif %}
                {% endfor %}

                {% for values in values.RelationMF1.values %}
                    {% if forloop.counter == 1 %}
                        <h3 id="RelationsToOtherMathematicalFormulationsI1"> Relations to other Mathematical Formulations I </h3>
                    {% endif %}

                    {% if values.0 == option.containsAssumption %} 
		        contains as Assumption: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsAssumptionIn %} 
		        contained as Assumption in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsBoundaryCondition %} 
		        contains as Boundary Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsBoundaryConditionIn %} 
		        contained as Boundary Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsConstraintCondition %} 
		        contains as Constraint Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsConstraintConditionIn %} 
		        contained as Constraint Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsCouplingCondition %} 
		        contains as Coupling Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsCouplingConditionIn %} 
		        contained as Coupling Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsFormulation %} 
		        contains as Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsFormulationIn %} 
		        contained as Formulation in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsInitialCondition %} 
		        contains as Initial Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsInitialConditionIn %} 
		        contained as Initial Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsFinalCondition %} 
		        contains as Final Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsFinalConditionIn %} 
		        contained as Final Condition in: {{ values.1 }} <br>
                    {% endif %}
                {% endfor %}

                {% for values in values.RelationMF2.values %}
                    {% if forloop.counter == 1 %}
                        <h3 id="RelationsToOtherMathematicalFormulationsII1"> Relations to other Mathematical Formulations II </h3>
                    {% endif %}

                    {% if values.0 == option.approximatedByFormulation %} 
		        approximated by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.approximatesFormulation %} 
		        approximates Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.discretizedByFormulation %} 
		        discretized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.discretizesFormulation %} 
		        discretizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.generalizedByFormulation %} 
		        generalized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.generalizesFormulation %} 
		        generalizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.nondimensionalizedByFormulation %} 
		        nondimensionalized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.nondimensionalzesFormulation %} 
		        nondimensionalizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.linearizedByFormulation %} 
		        linearized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.linearizesFormulation %} 
		        linearizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.similarToFormulation %} 
		        similar to Formulation: {{ values.1 }} <br>
                    {% endif %}
                {% endfor %}
            {% endif %}
        {% endfor %}
    {% endfor %}
{% endfor %}

{% for values in answers.task.values %}

    {% if forloop.counter == 1 %}
        <h1 id="Task"> Tasks </h1>                        
    {% endif %}

    <h2 id="T{{ forloop.counter }}"> T{{ forloop.counter }}: {{ values.Name }} </h2>

    <p>
        {% if values.Description %}
            <b>Description</b>: {{ values.Description }} <br>
        {% endif %}
        <b>Class</b>: {% if values.TaskClass == option.ComputationalTask %} 
			              Computational Task 
                      {% else %}
                          -
			          {% endif %} <br>
        {% if 'not found' in values.ID %} 
            <b>ID</b>: - 
        {% elif 'mathmoddb' in values.ID %} 
            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
        {% elif 'mardi' in values.ID %} 
            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
        {% elif 'wikidata' in values.ID %} 
            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
        {% endif %} 
        <br>
    </p>
    {% if values.Properties %}
    <b>Properties</b>: {% for value in values.Properties.values %} 
                           {% if value == option.isLinear %} 
			       Is Linear 
			   {% elif value == option.isNotLinear %} 
			       Is Not Linear 
			   {% endif %} 
			   {% if not forloop.last %}
			       , 
			   {% endif %} 
		      {% endfor %} <br> 
    {% endif %}

    {% for value in values.RelationMM.values %}
        {% if forloop.counter == 1 %}
	    <h3 id="RelationsToMathematicalModels2"> Relations to Mathematical Models </h3>
        {% endif %}
         applies Mathematical Model: {{ value.1 }}
    {% endfor %}

    {% for value in values.RelationQQK.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToQuantities"> Relations to Quantities / Quantity Kinds </h3>
        {% endif %}
        {% if value.0 == option.containsInput %} 
	    contains Input: {{ value.1 }} <br>
        {% elif value.0 == option.containsOutput %} 
	    contains Output: {{ value.1 }} <br>
        {% elif value.0 == option.containsObjective %} 
	    contains Objective: {{ value.1 }} <br>
        {% elif value.0 == option.containsParameter %} 
	    contains Parameter: {{ value.1 }} <br>
	    {% elif value.0 == option.containsConstant %}
            contains Constant: {{ value.1 }} <br>
        {% endif %}
    {% endfor %}

    {% for value in values.RelationT.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToTasks"> Relations to Tasks </h3>
        {% endif %}
        {% if value.0 == option.generalizedByTask %} 
	    generalized by Task: {{ value.1 }} <br>
        {% elif value.0 == option.generalizesTask %} 
	    generalizes Task: {{ value.1 }} <br>
        {% elif value.0 == option.discretizedByTask %} 
	    discretized by Task: {{ value.1 }} <br>
        {% elif value.0 == option.discretizesTask %} 
	    discretizes Task: {{ value.1 }} <br>
        {% elif value.0 == option.containedInTask %} 
	    contained in Task: {{ value.1 }} <br>
        {% elif value.0 == option.containsTask %} 
	    contains Task: {{ value.1 }} <br>
        {% elif value.0 == option.approximatedByTask %} 
	    approximated by Task: {{ value.1 }} <br>
        {% elif value.0 == option.approximatesTask %} 
	    approximates Task: {{ value.1 }} <br>
        {% elif value.0 == option.linearizedByTask %} 
	    linearized by Task: {{ value.1 }} <br>
        {% elif value.0 == option.linearizesTask %} 
	    linearizes Task: {{ value.1 }} <br>
        {% elif value.0 == option.similarToTask %} 
	    similar to Task: {{ value.1 }} <br>
        {% endif %}
    {% endfor %}

    {% for values in answers.formulation.values %}
        {% if forloop.counter == 1 %}
            <h2 id="MathematicalFormulations2"> List of Mathematical Formulations </h2>
        {% endif %}
        {% for tasks in values.RelationT1.values %}
            {% if tasks.1 == forloop.parentloop.parentloop.counter %}
                <h3 id="MF{{ forloop.parentloop.counter }}"> MF{{ forloop.parentloop.counter }}: {{ values.Name }} </h3>
		            <p>
                        {% if values.Description %}
                            <b>Description</b>: {{ values.Description }} <br>
                        {% endif %}
                        {% if 'not found' in values.ID %} 
                            <b>ID</b>: - 
                        {% elif 'mathmoddb' in values.ID %} 
                            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
                        {% elif 'mardi' in values.ID %} 
                            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
                        {% elif 'wikidata' in values.ID %} 
                            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
                        {% endif %} 
                        <br>
		            </p>
		            <p>
                        {% if values.Formula %}
		                    <b>Defining formulations</b>: 
                                                          {%for value in values.Formula.values %} 
		                                                      \( {{ value|cut:"$" }} \) 
			    		                                      {% if not forloop.last %}
						                                          , 
						                                      {% endif %} 
					                                      {% endfor %}
		                    </p>
                                <br>
	                            <table border="1">
                                            <colgroup>
                                                <col style="width: 10%" />
                                                <col style="width: 15%" />
                                                <col style="width: 15%" />
                                                <col style="width: 15%" />
                                                <col style="width: 15%" />
	                            	<col style="width: 30%" />
                                            </colgroup>
                                            <thead>
                                                <tr class="header">
                                                    <th style="text-align: center; vertical-align: middle;">Symbol</th>
                                                    <th style="text-align: center; vertical-align: middle;">Quantity</th>
                                                    <th style="text-align: center; vertical-align: middle;">Quantity ID</th>
                                                    <th style="text-align: center; vertical-align: middle;">Quantity Kind</th>
                                                    <th style="text-align: center; vertical-align: middle;">Quantity Kind ID</th>
	                            	    <th style="text-align: center; vertical-align: middle;">Description</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                {% for value in values.element.values %}
                                                    <tr>
                                                        <td style="text-align: center; vertical-align: middle;">${{ value.symbol }}$</td>
                                                        <td style="text-align: center; vertical-align: middle;">{% if value.Info %} 
	                            			                                                    {{ value.Info.Name }} 
	                            									{% else %} 
	                            									    {{ value.Quantity }} 
	                            									{% endif %}</td>
                                                        <td style="text-align: center; vertical-align: middle;">{{ value.Info.QID }}</td>
                                                        <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKName }}</td>
                                                        <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKID }}</td>
                                                        <td style="text-align: center; vertical-align: middle;">{{ value.Info.Description }}</td>				
                                                    </tr>
                                                {% endfor %}
                                            </tbody>
                                        </table>
                                        <br>
                        {% endif %}
                    {% if values.Properties %}
                        <b>Properties</b>:  
                                       {% for value in values.Properties.values %} 
	                                       {% if value == option.isConvex %} 
		 		                               Is Convex 
				                           {% elif value == option.isNotConvex %} 
				                               Is Not Convex 
				                           {% elif value == option.isDeterministic %} 
				                               Is Deterministic 
				                           {% elif value == option.isStochastic %} 
				                               Is Stochastic 
				                           {% elif value == option.isDimensionless %} 
				                               Is Dimensionless 
				                           {% elif value == option.isDimensional %} 
				                               Is Dimensional 
				                           {% elif value == option.isDynamic %} 
				                               Is Dynamic 
				                           {% elif value == option.isStatic %} 
				                               Is Static 
				                           {% elif value == option.isLinear %} 
				                               Is Linear 
				                           {% elif value == option.isNotLinear %} 
				                               Is Not Linear 
				                           {% elif value == option.isSpaceContinuous %} 
				                               Is Space-Continuous 
				                           {% elif value == option.isSpaceDiscrete %} 
				                               Is Space-Discrete 
				                           {% elif value == option.isSpaceIndependent %} 
					                           Is Space-Independent 
				                           {% elif value == option.isTimeContinuous %} 
				                               Is Time-Continuous 
				                           {% elif value == option.isTimeDiscrete %} 
				                               Is Time-Discrete 
				                           {% elif value == option.isTimeIndependent %} 
				                               Is Time-Independent 
				                           {% endif %} 
				                           {% if not forloop.last %}
				                               , 
				                           {% endif %} 
				                       {% endfor %}
                            {% endif %}

                {% for values in values.RelationT1.values %}
                    {% if forloop.counter == 1 %}
		        <h3 id="RelationsToTasks2"> Relations to Tasks </h3>
                    {% endif %}

                    {% if values.0 == option.containedAsAssumptionIn %} 
		        contained as Assumption in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsBoundaryConditionIn %} 
		        contained as Boundary Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsConstraintConditionIn %} 
		        contained as Constraint Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsDefinitionIn %} 
		        contained as Definition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFormulationIn %} 
		        contained as Formulation in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsInitialConditionIn %} 
		        contained as Initial Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFinalConditionIn %} 
		        contained as Final Condition in: {{ values.2 }} <br>
                    {% endif %}
                {% endfor %}

                {% for values in values.RelationMM1.values %}
                    {% if forloop.counter == 1 %}
		        <h3 id="RelationsToMathematicalModels3"> Relations to Mathematical Models </h3>
                    {% endif %}

                    {% if values.0 == option.containedAsAssumptionIn %} 
		        contained as Assumption in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsBoundaryConditionIn %} 
		        contained as Boundary Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsConstraintConditionIn %} 
		        contained as Constraint Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsDefintionIn %} 
		        contained as Defintion in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFormulationIn %} 
		        contained as Formulation in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsInitialConditionIn %} 
		        contained as Initial Condition in: {{ values.2 }} <br>
                    {% elif values.0 == option.containedAsFinalConditionIn %} 
		        contained as Final Condition in: {{ values.2 }} <br>
                    {% endif %}
                {% endfor %}

                {% for values in values.RelationMF1.values %}
                    {% if forloop.counter == 1 %}
                        <h3 id="RelationsToOtherMathematicalFormulationsI2"> Relations to other Mathematical Formulations I</h3>
                    {% endif %}

                    {% if values.0 == option.containsAssumption %} 
		        contains as Assumption: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsAssumptionIn %} 
		        contained as Assumption in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsBoundaryCondition %} 
		        contains as Boundary Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsBoundaryConditionIn %} 
		        contained as Boundary Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsConstraintCondition %} 
		        contains as Constraint Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsConstraintConditionIn %} 
		        contained as Constraint Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsCouplingCondition %} 
		        contains as Coupling Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsCouplingConditionIn %} 
		        contained as Coupling Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsFormulation %} 
		        contains as Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsFormulationIn %} 
		        contained as Formulation in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsInitialCondition %} 
		        contains as Initial Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsInitialConditionIn %} 
		        contained as Initial Condition in: {{ values.1 }} <br>
                    {% elif values.0 == option.containsFinalCondition %} 
		        contains as Final Condition: {{ values.1 }} <br>
                    {% elif values.0 == option.containedAsFinalConditionIn %} 
		        contained as Final Condition in: {{ values.1 }} <br>
                    {% endif %}
                {% endfor %}

                {% for values in values.RelationMF2.values %}
                    {% if forloop.counter == 1 %}
                        <h3 id="RelationsToOtherMathematicalFormulationsII2"> Relations to other Mathematical Formulations II </h3>
                    {% endif %}

                    {% if values.0 == option.approximatedByFormulation %} 
		        approximated by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.approximatesFormulation %} 
		        approximates Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.discretizedByFormulation %} 
		        discretized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.discretizesFormulation %} 
		        discretizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.generalizedByFormulation %} 
		        generalized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.generalizesFormulation %} 
		        generalizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.nondimensionalizedByFormulation %} 
		        nondimensionalized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.nondimensionalzesFormulation %} 
		        nondimensionalizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.linearizedByFormulation %} 
		        linearized by Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.linearizesFormulation %} 
		        linearizes Formulation: {{ values.1 }} <br>
                    {% elif values.0 == option.similarToFormulation %} 
		        similar to Formulation: {{ values.1 }} <br>
                    {% endif %}
                {% endfor %}
            {% endif %}
        {% endfor %}
    {% endfor %}
{% endfor %}

{% for values in answers.publication.values %}

    {% if forloop.counter == 1 %}
        <h1 id="Publication"> Publications </h1>
    {% endif %}

    <h2 id="P{{ forloop.counter }}"> P{{ forloop.counter }}: {{ values.Name }} </h2>
    
    <p> {% if values.ID %}
            <b>ID</b>: {{ values.ID }} <br>
        {% endif %}
        {% for reference in values.reference.values %}
            {% if reference.0 == option.DOI %}
                <b>DOI</b>: {{ reference.1 }} <br>
	        {% endif %} 
            {% if reference.0 == option.URL %}
                <b>URL</b>: {{ reference.1 }} <br>
	        {% endif %}
        {% endfor %}
    </p>

    {% for values in values.RelationP.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToEntitiesOfTheMathematicalModels"> Relations to Entities of the Mathematical Models </h3>
        {% endif %}
        {% if values.0 == option.documents %} 
	    documents: {{ values.1 }} <br>
        {% elif values.0 == option.invents %} 
	    invents: {{ values.1 }} <br>
        {% elif values.0 == option.studies %} 
	    studies: {{ values.1 }} <br>
        {% elif values.0 == option.surveys %} 
	    surveys: {{ values.1 }} <br>
        {% elif values.0 == option.uses %} 
	    uses: {{ values.1 }} <br>
        {% endif %}
    {% endfor %}
{% endfor %}

{% for values in answers.field.values %}
    {% if forloop.counter == 1 %}
        <h1 id="ResearchField"> Research Fields </h1>
    {% endif %}

    <h2 id="RF{{ forloop.counter }}"> RF{{ forloop.counter }}: {{ values.Name }} </h2>

    <p>
        {% if values.Description %}
            <b>Description</b>: {{ values.Description }} <br>
        {% endif %}
        {% if 'not found' in values.ID %} 
            <b>ID</b>: - 
        {% elif 'mathmoddb' in values.ID %} 
            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
        {% elif 'mardi' in values.ID %} 
            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
        {% elif 'wikidata' in values.ID %} 
            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
        {% endif %} 
        <br>
    </p>

    {% for relation in values.RelationRF1.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToOtherResearchFields"> Relations to other Research Fields </h3>
	{% endif %}
        {% if relation.0 == option.generalizedByField %} 
            generalized by Field: {{relation.1 }} <br>
        {% elif relation.0 == option.generalizesField %} 
            generalizes Field: {{relation.1 }} <br>
        {% elif relation.0 == option.similarToField %} 
            similar to Field: {{relation.1 }} <br>
        {% endif %}
    {% endfor %}
{% endfor %}

{% for values in answers.problem.values %}
    {% if forloop.counter == 1 %}
        <h1 id="ResearchProblem"> Research Problems </h1>
    {% endif %}
    <h2 id="RP{{ forloop.counter }}"> RP{{ forloop.counter }}: {{ values.Name }} </h2>

    <p>
        {% if values.Description %}
            <b>Description</b>: {{ values.Description }} <br>
        {% endif %}
        {% if 'not found' in values.ID %} 
            <b>ID</b>: - 
        {% elif 'mathmoddb' in values.ID %} 
            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
        {% elif 'mardi' in values.ID %} 
            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
        {% elif 'wikidata' in values.ID %} 
            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
        {% endif %} 
        <br>
    </p>

    {% for researchfield in values.RelationRF1.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToResearchFields"> Relations to Research Fields </h3>
        {% endif %}
	contained in Field: {{ researchfield.1 }} <br>
    {% endfor %}

    {% for relation in values.RelationRP1.values %}
        {% if forloop.counter == 1 %}
            <h3 id="RelationsToOtherResearchProblems"> Relations to other Research Problems </h3>
        {% endif %}
        {% if relation.0 == option.generalizedByProblem %} 
	    generalized by Problem: {{relation.1 }} <br>
        {% elif relation.0 == option.generalizesProblem %} 
	    generalizes Problem: {{relation.1 }} <br>
        {% elif relation.0 == option.similarToProblem %} 
	    similar to Problem: {{relation.1 }} <br>
        {% endif %}
    {% endfor %}
{% endfor %}

{% for values in answers.quantity.values %}
    {% if forloop.counter == 1 %}
        <h1 id="QuantityQuantityKind"> Quantities / Quantity Kinds </h1>
    {% endif %}

    <h2 id="QQK{{ forloop.counter }}"> QQK{{ forloop.counter }}: {{ values.Name }} </h2>

    <p>
        {% if values.Description %}
            <b>Description</b>: {{ values.Description }} <br>
        {% endif %}
        <b>Class</b>: {% if values.QorQK == option.Quantity %}
                          Quantity
                      {% elif values.QorQK == option.QuantityKind %}
                          Quantity Kind
                      {% endif %} <br>
        
        {% if 'not found' in values.ID %} 
            <b>ID</b>: - 
        {% elif 'mathmoddb' in values.ID %} 
            <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
        {% elif 'mardi' in values.ID %} 
            <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
        {% elif 'wikidata' in values.ID %} 
            <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
        {% endif %} 
        <br>
        {% if values.reference %}
            {% for reference in values.reference.values %}
                {% if reference.0 == option.QUDT %}
                    <b>QUDT ID</b>: {{ reference.1 }} <br>
                {% endif %} 
            {% endfor %}
        {% endif %}
        <br>
    </p>
        {% if values.Properties %}
        <b>Properties</b>: {% if values.Properties %}
                            {% for value in values.Properties.values %} 
                                {% if value == option.isDimensionless %} 
			                        Is Dimensionless 
			                    {% elif value == option.isDimensional %} 
			                        Is Dimensional 
			                    {% elif value == option.isLinear %} 
			                        Is Linear 
			                    {% elif value == option.isNotLinear %} 
			                        Is Not Linear
			                    {% endif %} 
			                    {% if not forloop.last %}
			                       , 
			                    {% endif %}
                            {% endfor %}
                           {% endif %}
        {% endif %}

    {% if values.QorQK == option.Quantity %}

        {% for values in values.RelationQQ.values %}
            {% if forloop.counter == 1 %}
	            <h3 id="RelationsToOtherQuantities"> Relations to other Quantities </h3>
            {% endif %}
            {% if values.0 == option.generalizedByQuantity %} 
	            generalized by Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.generalizesQuantity %} 
	            generalizes Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.approximatedByQuantity %} 
	            approximated by Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.approximatesQuantity %} 
	            approximates Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.linearizedByQuantity %} 
	            linearized by Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.linearizesQuantity %} 
	            linearizes Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizedByQuantity %} 
	            nondimensionalized by Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizesQuantity %} 
	            nondimensionalizes Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.similarToQuantity %} 
	            similar to Quantity: {{ values.1 }} <br>
            {% endif %}
        {% endfor %}

        {% for values in values.RelationQQK.values %}
            {% if forloop.counter == 1 %}
	            <h3 id="RelationsToQuantityKinds"> Relations to Quantity Kinds </h3>
            {% endif %}
            {% if values.0 == option.generalizedByQuantity %} 
	            generalized by Quantity Kind: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizedByQuantity %} 
	            nondimensionalized by Quantity Kind: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizesQuantity %} 
	            nondimensionalizes Quantity Kind: {{ values.1 }} <br>
            {% elif values.0 == option.similarToQuantity %} 
	            similar to Quantity Kind: {{ values.1 }} <br>
            {% endif %}
        {% endfor %}

        {% if values.MDef %}

            <h2 id="DefinitionOfQuantity"> Definition of Quantity </h2>

	        <p>
	            <b>Name</b>: {{ values.MDef.Name }} <br>
	            {% if values.Description %}
                    <b>Description</b>: {{ values.Description }} <br>
                {% endif %}
                {% if 'not found' in values.ID %} 
                    <b>ID</b>: - 
                {% elif 'mathmoddb' in values.ID %} 
                    <b>MathModDB ID</b>: {{ values.ID|cut:"mathmoddb:"}}
                {% elif 'mardi' in values.ID %} 
                    <b>MaRDI Portal ID</b>: {{ values.ID|cut:"mardi:"}} 
                {% elif 'wikidata' in values.ID %} 
                    <b>Wikidata ID</b>: {{ values.ID|cut:"wikidata:"}}
                {% endif %} 
                <br>
            </p>
                {% if values.MDef.Formula %}
                <p>
                <b>Defining formulations</b>: {%for value in values.MDef.Formula.values %} 
                                                  \( {{ value|cut:"$" }} \) 
					                              {% if not forloop.last %}
					                                , 
					                              {% endif %} 
					                          {% endfor %}
            </p>
            <br>
            <table border="1">
                <colgroup>
                    <col style="width: 10%" />
                    <col style="width: 15%" />
                    <col style="width: 15%" />
                    <col style="width: 15%" />
                    <col style="width: 15%" />
                    <col style="width: 30%" />
                </colgroup>
                <thead>
                    <tr class="header">
                        <th style="text-align: center; vertical-align: middle;">Symbol</th>
                        <th style="text-align: center; vertical-align: middle;">Quantity</th>
                        <th style="text-align: center; vertical-align: middle;">Quantity ID</th>
                        <th style="text-align: center; vertical-align: middle;">Quantity Kind</th>
                        <th style="text-align: center; vertical-align: middle;">Quantity Kind ID</th>
                        <th style="text-align: center; vertical-align: middle;">Description</th>
                    </tr>
                </thead>
                <tbody>
                    {% for value in values.MDef.Element.values %}
                        <tr>
                            <td style="text-align: center; vertical-align: middle;">${{ value.Symbol }}$</td>
                            <td style="text-align: center; vertical-align: middle;">{% if value.Info %}
                                                                                        {{ value.Info.Name }}
                                                                                    {% else %}
                                                                                        {{ value.Quantity }}
                                                                                    {% endif %}</td>
                            <td style="text-align: center; vertical-align: middle;">{{ value.Info.QID }}</td>
                            <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKName }}</td>
                            <td style="text-align: center; vertical-align: middle;">{{ value.Info.QKID }}</td>
                            <td style="text-align: center; vertical-align: middle;">{{ value.Info.Description }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
            <br>
            {% endif %}
            {% if values.MDef.Properties %}
            <b>Properties</b>: {% for value in values.MDef.Properties.values %}
                                   {% if value == option.isConvex %}
                                       Is Convex
                                   {% elif value == option.isNotConvex %}
                                       Is Not Convex
                                   {% elif value == option.isDeterministic %}
                                       Is Deterministic
                                   {% elif value == option.isStochastic %}
                                       Is Stochastic
                                   {% elif value == option.isDimensionless %}
                                       Is Dimensionless
                                   {% elif value == option.isDimensional %}
                                       Is Dimensional
                                   {% elif value == option.isDynamic %}
                                       Is Dynamic
                                   {% elif value == option.isStatic %}
                                       Is Static
                                   {% elif value == option.isLinear %}
                                       Is Linear
                                   {% elif value == option.isNotLinear %}
                                       Is Not Linear
                                   {% elif value == option.isSpaceContinuous %}
                                       Is Space-Continuous
                                   {% elif value == option.isSpaceDiscrete %}
                                       Is Space-Discrete
                                   {% elif value == option.isSpaceIndependent %}
                                       Is Space-Independent
                                   {% elif value == option.isTimeContinuous %}
                                       Is Time-Continuous
                                   {% elif value == option.isTimeDiscrete %}
                                       Is Time-Discrete
                                   {% elif value == option.isTimeIndependent %}
                                       Is Time-Independent
                                   {% endif %}
                                   {% if not forloop.last %}
                                       ,
                                   {% endif %}
                               {% endfor %}
            {% endif %}
        {% endif %}

    {% elif values.QorQK == option.QuantityKind %}

        {% for values in values.RelationQKQK.values %}
            {% if forloop.counter == 1 %}
                <h3 id="RelationsToOtherQuantityKinds"> Relations to other Quantity Kinds </h3>
            {% endif %}
            {% if values.0 == option.nondimensionalizedByQuantity %} 
                nondimensionalized by Quantity Kind: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizesQuantity %} 
                nondimensionalizes Quantity Kind: {{ values.1 }} <br>
            {% elif values.0 == option.similarToQuantity %} 
                similar to Quantity Kind: {{ values.1 }} <br>
            {% endif %}
        {% endfor %}

        {% for values in values.RelationQKQ.values %}
            {% if forloop.counter == 1 %}
                <h3 id="RelationsToOtherQuantities3"> Relations to Quantities </h3>
            {% endif %}
            {% if values.0 == option.generalizesQuantity %} 
                generalizes Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizedByQuantity %} 
                nondimensionalized by Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.nondimensionalizesQuantity %} 
                nondimensionalizes Quantity: {{ values.1 }} <br>
            {% elif values.0 == option.similarToQuantity %} 
                similar to Quantity: {{ values.1 }} <br>
            {% endif %}
        {% endfor %}
    {% endif %}
{% endfor %}

</body>


