Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMILE test of saveper #48

Open
JamesPHoughton opened this issue Jul 20, 2018 · 5 comments
Open

XMILE test of saveper #48

JamesPHoughton opened this issue Jul 20, 2018 · 5 comments

Comments

@JamesPHoughton
Copy link
Contributor

currently, the xmile version of the test for SAVEPER vs TIME STEP is the version autogenerated by @wasbridge . But, it doesn't actually test the concept that the save time could be different from the integration time.

Is there an XMILE equivalent of saveper? If not, I'll just delete that version of the test.

@alexprey, do you know about this in the XMILE standard?

@wasbridge
Copy link
Contributor

wasbridge commented Jul 20, 2018 via email

@alexprey
Copy link
Collaborator

For now I just copy value from dt, but I look again at specification and found that:
http://docs.oasis-open.org/xmile/xmile/v1.0/os/xmile-v1.0-os.html#_Toc439926042
So, I see that by xmile we can define not only period for export, but also select required variables that should be exported by simulation.
So I think that it should looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xmile version="1.0" xmlns="http://docs.oasis-open.org/xmile/ns/XMILE/v1.0">
    <header>
        <vendor>James Houghton</vendor>
        <name>Teacup</name>
        <options>
            <uses_outputs/>
        </options>
        <product version="1.0">Hand Coded XMILE</product>
    </header>
    <sim_specs>
        <stop>30.0</stop>
        <start>0.0</start>
        <dt>0.125</dt>
    </sim_specs>
    <data>
       <export interval="1">
           <all/>
       </export>
    </data>
    <model>
        <variables>
            <flow name="Heat Loss to Room">
                <doc>Heat Loss to Room</doc>
                <eqn>("Teacup Temperature"-"Room Temperature")/"Characteristic Time"</eqn>
            </flow>
            <aux name="Room Temperature">
                <doc>Ambient Room Temperature</doc>
                <eqn>70</eqn>
            </aux>
            <stock name="Teacup Temperature">
                <doc>The average temperature of the tea and the cup</doc>
                <outflow>"Heat Loss to Room"</outflow>
                <eqn>180</eqn>
            </stock>
            <aux name="Characteristic Time">
                <eqn>10</eqn>
            </aux>
        </variables>
    </model>
</xmile>

See at data section, if interval is 0, that means we should export only final result.

@JamesPHoughton
Copy link
Contributor Author

Thanks @alexprey - I made you a contributor on this repo - I'll let you commit the fix if you're happy to do so?

@alexprey
Copy link
Collaborator

Thank you @JamesPHoughton, I'm look at this later and try to write test for this case

@wasbridge
Copy link
Contributor

wasbridge commented Jul 22, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants