I have attached two implementations of the same equation, y = sin(x).

In the case where the equation is given in a component within the same model as its parent in the encapsulation hierarchy (import_bug-ok.xml) everything works fine and CellML2C gives me the expected code.

If I move the exact same component to a separate model (sin.xml) and import it (import_bug-fail.xml) then CellML2C tells me the model is now overconstrained. But as far as I can tell it is the exact same model.

Can anyone spot an obvious mistake or is this a bug in the CCGS?

Thanks,
David.

--
David Nickerson, PhD
Research Fellow
Division of Bioengineering
Faculty of Engineering
National University of Singapore
Email: [EMAIL PROTECTED]
<?xml version="1.0" encoding="iso-8859-1"?>
<model
    name="sin_approximations_import"
    cmeta:id="sin_approximations_import"
    xmlns="http://www.cellml.org/cellml/1.1#";
    xmlns:cellml="http://www.cellml.org/cellml/1.1#";
    xmlns:cmeta="http://www.cellml.org/metadata/1.0#";
    xmlns:xlink="http://www.w3.org/1999/xlink";>

  <import xlink:href="sin.xml">
    <component name="actual_sin" component_ref="actual_sin"/>
  </import>

  <component name="main" cmeta:id="main">
    <variable cmeta:id="x" name="x" initial_value="0" units="dimensionless" public_interface="out" private_interface="out"/>
    <variable cmeta:id="sin" name="sin1" units="dimensionless" public_interface="out" private_interface="in"/>
  </component>
  
  <group>
    <relationship_ref relationship="encapsulation"/>
    <component_ref component="main">
      <component_ref component="actual_sin"/>
    </component_ref>
  </group>
  
  <connection>
    <map_components component_1="actual_sin" component_2="main"/>
    <map_variables variable_1="sin" variable_2="sin1"/>
    <map_variables variable_1="x" variable_2="x"/>
  </connection>

</model>
<?xml version="1.0" encoding="iso-8859-1"?>
<model
    name="sin_approximations_import"
    cmeta:id="sin_approximations_import"
    xmlns="http://www.cellml.org/cellml/1.1#";
    xmlns:cellml="http://www.cellml.org/cellml/1.1#";
    xmlns:cmeta="http://www.cellml.org/metadata/1.0#";
    xmlns:xlink="http://www.w3.org/1999/xlink";>

  <component name="actual_sin" cmeta:id="actual_sin">
    <variable name="x" units="dimensionless" public_interface="in" private_interface="out"/>
    <variable cmeta:id="actual_sin" name="sin" units="dimensionless" public_interface="out" private_interface="out"/>
    <math xmlns="http://www.w3.org/1998/Math/MathML";>
      <apply id="actual_sin"><eq/>
        <ci>sin</ci>
        <apply><sin/>
          <ci>x</ci>
        </apply>
      </apply>
    </math>
  </component>

  <component name="main" cmeta:id="main">
    <variable cmeta:id="x" name="x" initial_value="0" units="dimensionless" public_interface="out" private_interface="out"/>
    <variable cmeta:id="sin" name="sin1" units="dimensionless" public_interface="out" private_interface="in"/>
  </component>
  
  <group>
    <relationship_ref relationship="encapsulation"/>
    <component_ref component="main">
      <component_ref component="actual_sin"/>
    </component_ref>
  </group>
  
  <connection>
    <map_components component_1="actual_sin" component_2="main"/>
    <map_variables variable_1="sin" variable_2="sin1"/>
    <map_variables variable_1="x" variable_2="x"/>
  </connection>

</model>
<?xml version="1.0" encoding="iso-8859-1"?>
<model
    name="sin"
    cmeta:id="sin"
    xmlns="http://www.cellml.org/cellml/1.1#";
    xmlns:cellml="http://www.cellml.org/cellml/1.1#";
    xmlns:cmeta="http://www.cellml.org/metadata/1.0#";>
  <rdf:RDF
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
      xmlns:cmeta="http://www.cellml.org/metadata/1.0#";
      xmlns:bqs="http://www.cellml.org/bqs/1.0#";
      xmlns:dc="http://purl.org/dc/elements/1.1/";
      xmlns:dcterms="http://purl.org/dc/terms/";
      xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#";
      xmlns:cs="http://www.cellml.org/metadata/simulation/1.0#";
      xmlns:cg="http://www.cellml.org/metadata/graphs/1.0#";>
    <rdf:Description rdf:about="">
      <dc:creator rdf:parseType="Resource">
        <vCard:N rdf:parseType="Resource">
          <vCard:Family>Nickerson</vCard:Family>
          <vCard:Given>David</vCard:Given>
        </vCard:N>
        <vCard:EMAIL rdf:parseType="Resource">
          <rdf:value>[EMAIL PROTECTED]</rdf:value>
          <rdf:type rdf:resource="http://imc.org/vCard/3.0#internet"; />
        </vCard:EMAIL>
        <vCard:ORG rdf:parseType="Resource">
          <vCard:Orgname>National University of Singapore</vCard:Orgname>
          <vCard:Orgunit>Division of Bioengineering</vCard:Orgunit>
        </vCard:ORG>
      </dc:creator>
      <dcterms:created rdf:parseType="Resource">
        <dcterms:W3CDTF>2006-12-21</dcterms:W3CDTF>
      </dcterms:created>
    </rdf:Description>
    <rdf:Description rdf:about="#sin">
      <dc:title>
        Simple sine model..
      </dc:title>
      <cmeta:comment rdf:parseType="Resource">
        <rdf:value>
          A very simple model.
        </rdf:value>
        <dc:creator rdf:parseType="Resource">
          <vCard:FN>David Nickerson</vCard:FN>
        </dc:creator>
      </cmeta:comment>
    </rdf:Description>
  </rdf:RDF>

  <component name="actual_sin" cmeta:id="actual_sin">
    <variable name="x" units="dimensionless" public_interface="in" private_interface="out"/>
    <variable cmeta:id="actual_sin" name="sin" units="dimensionless" public_interface="out" private_interface="out"/>
    <math xmlns="http://www.w3.org/1998/Math/MathML";>
      <apply id="actual_sin"><eq/>
        <ci>sin</ci>
        <apply><sin/>
          <ci>x</ci>
        </apply>
      </apply>
    </math>
  </component>
  
</model>
_______________________________________________
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion

Reply via email to