Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- LICENSES/Biopython.rstAdded+68
- LICENSES/COGNI-CC0-1.0.txtAdded+121
- LICENSES/CoolProp-MIT.txtAdded+21
- LICENSES/KiMoPack-GPL-3.0.txtAdded+674
- LICENSES/OPERA-MIT.txtAdded+21
- LICENSES/XrayDB.txtAdded+18
- LICENSES/chemicals-MIT.txtAdded+21
- LICENSES/openpoly-MIT.txtAdded+21
- LICENSES/srsinst-rga-MIT.txtAdded+21
- LICENSES/teMatDb-MIT.txtAdded+20
- catalog/catalog.csvAdded+199
- catalog/catalog.jsonAdded
- examples/quickstart_fume_hood.pyAdded+48
- outputs/expansion_batch03/t4_measure/antonpaar_litesizerdia/example_setup.pyAdded+14
- outputs/expansion_batch03/t4_measure/antonpaar_litesizerdls/example_setup.pyAdded+19
- outputs/expansion_batch03/t4_measure/antonpaar_poremaster60/example_setup.pyAdded+37
- outputs/expansion_batch03/t4_measure/antonpaar_psa1190/example_setup.pyAdded+26
- outputs/expansion_batch03/t4_measure/biolin_sigma700/example_setup.pyAdded+10
- outputs/expansion_batch03/t4_measure/biolin_thetaflex/example_setup.pyAdded+25
- outputs/expansion_batch03/t4_measure/biorad_miniprotean/migration_chart_digitized.jsonAdded+741
- outputs/expansion_batch04/t1_thermal/ametek_oxtran/independent_permeation_source_validation.jsonAdded+79
- outputs/expansion_batch04/t1_thermal/ametek_oxtran/interface_definition.pyAdded+161
- outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/interface_definition.pyAdded+177
- outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/source_cache/rc1e_curves_digitized.jsonAdded
- outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/template_validation.jsonAdded
- outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/thermal_calibration.jsonAdded+213
- outputs/expansion_batch04/t1_thermal/netzsch_mmc315/interface_definition.pyAdded+92
- outputs/expansion_batch04/t1_thermal/netzsch_mmc315/template_validation.jsonAdded+3201
- outputs/expansion_batch04/t1_thermal/zwick_mflow/interface_definition.pyAdded+142
- outputs/expansion_batch04/t3_analytical/evident_bx53p/source_cache/cvrl_ciexyz31_1.csvAdded+471
- outputs/expansion_batch04/t3_analytical/jeol_jsmit200/optics_fit.jsonAdded+87
- scripts/asset_runtime/ametek_oxtran.pyAdded
- scripts/asset_runtime/lakeshore_8604vsm.pyAdded+518
- scripts/asset_runtime/lakeshore_measurereadym91.pyAdded+495
- scripts/asset_runtime/novocontrol_alphat.pyAdded+431
- scripts/asset_runtime/shimadzu_ags10knxd.pyAdded+494
- scripts/asset_runtime/signatone_quadpro2.pyAdded+543
- scripts/asset_runtime/zwick_hit5p.pyAdded+418
- scripts/asset_runtime/zwick_mflow.pyAdded+1350
- tests/conftest.pyAdded+24
- tests/test_asset_ametek_oxtran.pyAdded+916
- tests/test_asset_antonpaar_hit300.pyAdded+179
- tests/test_asset_antonpaar_mcr503.pyAdded+161
- tests/test_asset_antonpaar_rst300.pyAdded+209
- tests/test_asset_antonpaar_saxspace.pyAdded+1547
- tests/test_asset_antonpaar_trb.pyAdded
- tests/test_asset_bd_facsariaiii.pyAdded
- tests/test_asset_binder_fd056.pyAdded
- tests/test_asset_binder_kbf115.pyAdded
- tests/test_asset_biolin_mediuml.pyAdded
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768Biopython is currently released under the "Biopython License Agreement"(given in full below). Unless stated otherwise in individual file headers,all Biopython's files are under the "Biopython License Agreement".
Some files are explicitly dual licensed under your choice of the"Biopython License Agreement" or the "BSD 3-Clause License" (both givenin full below). This is with the intention of later offering all ofBiopython under this dual licensing approach.
------------------------------------------------------------------------------
Biopython License Agreement---------------------------
Permission to use, copy, modify, and distribute this software and itsdocumentation with or without modifications and for any purpose andwithout fee is hereby granted, provided that any copyright noticesappear in all copies and that both those copyright notices and thispermission notice appear in supporting documentation, and that thenames of the contributors or copyright holders not be used inadvertising or publicity pertaining to distribution of the softwarewithout specific prior permission.
THE CONTRIBUTORS AND COPYRIGHT HOLDERS OF THIS SOFTWARE DISCLAIM ALLWARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THECONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECTOR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSSOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCEOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USEOR PERFORMANCE OF THIS SOFTWARE.
------------------------------------------------------------------------------
BSD 3-Clause License--------------------
Copyright (c) 1999-2024, The Biopython ContributorsAll rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically conferexclusive Copyright and Related Rights (defined below) upon the creatorand subsequent owner(s) (each and all, an "owner") of an original work ofauthorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work forthe purpose of contributing to a commons of creative, cultural andscientific works ("Commons") that the public can reliably and without fearof later claims of infringement build upon, modify, incorporate in otherworks, reuse and redistribute as freely as possible in any form whatsoeverand for any purposes, including without limitation commercial purposes.These owners may contribute to the Commons to promote the ideal of a freeculture and the further production of creative, cultural and scientificworks, or to gain reputation or greater distribution for their Work inpart through the use and efforts of others.
For these and/or other purposes and motivations, and without anyexpectation of additional consideration or compensation, the personassociating CC0 with a Work (the "Affirmer"), to the extent that he or sheis an owner of Copyright and Related Rights in the Work, voluntarilyelects to apply CC0 to the Work and publicly distribute the Work under itsterms, with knowledge of his or her Copyright and Related Rights in theWork and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may beprotected by copyright and related or neighboring rights ("Copyright andRelated Rights"). Copyright and Related Rights include, but are notlimited to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s);iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); andvii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contraventionof, applicable law, Affirmer hereby overtly, fully, permanently,irrevocably and unconditionally waives, abandons, and surrenders all ofAffirmer's Copyright and Related Rights and associated claims and causesof action, whether now known or unknown (including existing as well asfuture claims and causes of action), in the Work (i) in all territoriesworldwide, (ii) for the maximum duration provided by applicable law ortreaty (including future time extensions), (iii) in any current or futuremedium and for any number of copies, and (iv) for any purpose whatsoever,including without limitation commercial, advertising or promotionalpurposes (the "Waiver"). Affirmer makes the Waiver for the benefit of eachmember of the public at large and to the detriment of Affirmer's heirs andsuccessors, fully intending that such Waiver shall not be subject torevocation, rescission, cancellation, termination, or any other legal orequitable action to disrupt the quiet enjoyment of the Work by the publicas contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reasonbe judged legally invalid or ineffective under applicable law, then theWaiver shall be preserved to the maximum extent permitted taking intoaccount Affirmer's express Statement of Purpose. In addition, to theextent the Waiver is so judged Affirmer hereby grants to each affectedperson a royalty-free, non transferable, non sublicensable, non exclusive,irrevocable and unconditional license to exercise Affirmer's Copyright andRelated Rights in the Work (i) in all territories worldwide, (ii) for themaximum duration provided by applicable law or treaty (including futuretime extensions), (iii) in any current or future medium and for any numberof copies, and (iv) for any purpose whatsoever, including withoutlimitation commercial, advertising or promotional purposes (the"License"). The License shall be deemed effective as of the date CC0 wasapplied by Affirmer to the Work. Should any part of the License for anyreason be judged legally invalid or ineffective under applicable law, suchpartial invalidity or ineffectiveness shall not invalidate the remainderof the License, and in such case Affirmer hereby affirms that he or shewill not (i) exercise any of his or her remaining Copyright and RelatedRights in the Work or (ii) assert any associated claims and causes ofaction with respect to the Work, in either case contrary to Affirmer'sexpress Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.123456789101112131415161718192021MIT License
Copyright (c) 2012-2018 Ian H. Bell and other CoolProp developers
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license forsoftware and other kinds of works.
The licenses for most software and other practical works are designedto take away your freedom to share and change the works. By contrast,the GNU General Public License is intended to guarantee your freedom toshare and change all versions of a program--to make sure it remains freesoftware for all its users. We, the Free Software Foundation, use theGNU General Public License for most of our software; it applies also toany other work released this way by its authors. You can apply it toyour programs, too.
When we speak of free software, we are referring to freedom, notprice. Our General Public Licenses are designed to make sure that youhave the freedom to distribute copies of free software (and charge forthem if you wish), that you receive source code or can get it if youwant it, that you can change the software or use pieces of it in newfree programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying youthese rights or asking you to surrender the rights. Therefore, you havecertain responsibilities if you distribute copies of the software, or ifyou modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whethergratis or for a fee, you must pass on to the recipients the samefreedoms that you received. You must make sure that they, too, receiveor can get the source code. And you must show them these terms so theyknow their rights.
Developers that use the GNU GPL protect your rights with two steps:(1) assert copyright on the software, and (2) offer you this Licensegiving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explainsthat there is no warranty for this free software. For both users' andauthors' sake, the GPL requires that modified versions be marked aschanged, so that their problems will not be attributed erroneously toauthors of previous versions.
Some devices are designed to deny users access to install or runmodified versions of the software inside them, although the manufacturercan do so. This is fundamentally incompatible with the aim ofprotecting users' freedom to change the software. The systematicpattern of such abuse occurs in the area of products for individuals touse, which is precisely where it is most unacceptable. Therefore, wehave designed this version of the GPL to prohibit the practice for thoseproducts. If such problems arise substantially in other domains, westand ready to extend this provision to those domains in future versionsof the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.States should not allow patents to restrict development and use ofsoftware on general-purpose computers, but in those that do, we wish toavoid the special danger that patents applied to a free program couldmake it effectively proprietary. To prevent this, the GPL assures thatpatents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution andmodification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds ofworks, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under thisLicense. Each licensee is addressed as "you". "Licensees" and"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the workin a fashion requiring copyright permission, other than the making of anexact copy. The resulting work is called a "modified version" of theearlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work basedon the Program.
To "propagate" a work means to do anything with it that, withoutpermission, would make you directly or secondarily liable forinfringement under applicable copyright law, except executing it on acomputer or modifying a private copy. Propagation includes copying,distribution (with or without modification), making available to thepublic, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables otherparties to make or receive copies. Mere interaction with a user througha computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"to the extent that it includes a convenient and prominently visiblefeature that (1) displays an appropriate copyright notice, and (2)tells the user that there is no warranty for the work (except to theextent that warranties are provided), that licensees may convey thework under this License, and how to view a copy of this License. Ifthe interface presents a list of user commands or options, such as amenu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the workfor making modifications to it. "Object code" means any non-sourceform of a work.
A "Standard Interface" means an interface that either is an officialstandard defined by a recognized standards body, or, in the case ofinterfaces specified for a particular programming language, one thatis widely used among developers working in that language.
The "System Libraries" of an executable work include anything, otherthan the work as a whole, that (a) is included in the normal form ofpackaging a Major Component, but which is not part of that MajorComponent, and (b) serves only to enable use of the work with thatMajor Component, or to implement a Standard Interface for which animplementation is available to the public in source code form. A"Major Component", in this context, means a major essential component(kernel, window system, and so on) of the specific operating system(if any) on which the executable work runs, or a compiler used toproduce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means allthe source code needed to generate, install, and (for an executablework) run the object code and to modify the work, including scripts tocontrol those activities. However, it does not include the work'sSystem Libraries, or general-purpose tools or generally available freeprograms which are used unmodified in performing those activities butwhich are not part of the work. For example, Corresponding Sourceincludes interface definition files associated with source files forthe work, and the source code for shared libraries and dynamicallylinked subprograms that the work is specifically designed to require,such as by intimate data communication or control flow between thosesubprograms and other parts of the work.
The Corresponding Source need not include anything that userscan regenerate automatically from other parts of the CorrespondingSource.
The Corresponding Source for a work in source code form is thatsame work.
2. Basic Permissions.
All rights granted under this License are granted for the term ofcopyright on the Program, and are irrevocable provided the statedconditions are met. This License explicitly affirms your unlimitedpermission to run the unmodified Program. The output from running acovered work is covered by this License only if the output, given itscontent, constitutes a covered work. This License acknowledges yourrights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do notconvey, without conditions so long as your license otherwise remainsin force. You may convey covered works to others for the sole purposeof having them make modifications exclusively for you, or provide youwith facilities for running those works, provided that you comply withthe terms of this License in conveying all material for which you donot control copyright. Those thus making or running the covered worksfor you must do so exclusively on your behalf, under your directionand control, on terms that prohibit them from making any copies ofyour copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely underthe conditions stated below. Sublicensing is not allowed; section 10makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technologicalmeasure under any applicable law fulfilling obligations under article11 of the WIPO copyright treaty adopted on 20 December 1996, orsimilar laws prohibiting or restricting circumvention of suchmeasures.
When you convey a covered work, you waive any legal power to forbidcircumvention of technological measures to the extent such circumventionis effected by exercising rights under this License with respect tothe covered work, and you disclaim any intention to limit operation ormodification of the work as a means of enforcing, against the work'susers, your or third parties' legal rights to forbid circumvention oftechnological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as youreceive it, in any medium, provided that you conspicuously andappropriately publish on each copy an appropriate copyright notice;keep intact all notices stating that this License and anynon-permissive terms added in accord with section 7 apply to the code;keep intact all notices of the absence of any warranty; and give allrecipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications toproduce it from the Program, in the form of source code under theterms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independentworks, which are not by their nature extensions of the covered work,and which are not combined with it such as to form a larger program,in or on a volume of a storage or distribution medium, is called an"aggregate" if the compilation and its resulting copyright are notused to limit the access or legal rights of the compilation's usersbeyond what the individual works permit. Inclusion of a covered workin an aggregate does not cause this License to apply to the otherparts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the termsof sections 4 and 5, provided that you also convey themachine-readable Corresponding Source under the terms of this License,in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excludedfrom the Corresponding Source as a System Library, need not beincluded in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means anytangible personal property which is normally used for personal, family,or household purposes, or (2) anything designed or sold for incorporationinto a dwelling. In determining whether a product is a consumer product,doubtful cases shall be resolved in favor of coverage. For a particularproduct received by a particular user, "normally used" refers to atypical or common use of that class of product, regardless of the statusof the particular user or of the way in which the particular useractually uses, or expects or is expected to use, the product. A productis a consumer product regardless of whether the product has substantialcommercial, industrial or non-consumer uses, unless such uses representthe only significant mode of use of the product.
"Installation Information" for a User Product means any methods,procedures, authorization keys, or other information required to installand execute modified versions of a covered work in that User Product froma modified version of its Corresponding Source. The information mustsuffice to ensure that the continued functioning of the modified objectcode is in no case prevented or interfered with solely becausemodification has been made.
If you convey an object code work under this section in, or with, orspecifically for use in, a User Product, and the conveying occurs aspart of a transaction in which the right of possession and use of theUser Product is transferred to the recipient in perpetuity or for afixed term (regardless of how the transaction is characterized), theCorresponding Source conveyed under this section must be accompaniedby the Installation Information. But this requirement does not applyif neither you nor any third party retains the ability to installmodified object code on the User Product (for example, the work hasbeen installed in ROM).
The requirement to provide Installation Information does not include arequirement to continue to provide support service, warranty, or updatesfor a work that has been modified or installed by the recipient, or forthe User Product in which it has been modified or installed. Access to anetwork may be denied when the modification itself materially andadversely affects the operation of the network or violates the rules andprotocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,in accord with this section must be in a format that is publiclydocumented (and with an implementation available to the public insource code form), and must require no special password or key forunpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of thisLicense by making exceptions from one or more of its conditions.Additional permissions that are applicable to the entire Program shallbe treated as though they were included in this License, to the extentthat they are valid under applicable law. If additional permissionsapply only to part of the Program, that part may be used separatelyunder those permissions, but the entire Program remains governed bythis License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your optionremove any additional permissions from that copy, or from any part ofit. (Additional permissions may be written to require their ownremoval in certain cases when you modify the work.) You may placeadditional permissions on material, added by you to a covered work,for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material youadd to a covered work, you may (if authorized by the copyright holders ofthat material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "furtherrestrictions" within the meaning of section 10. If the Program as youreceived it, or any part of it, contains a notice stating that it isgoverned by this License along with a term that is a furtherrestriction, you may remove that term. If a license document containsa further restriction but permits relicensing or conveying under thisLicense, you may add to a covered work material governed by the termsof that license document, provided that the further restriction doesnot survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, youmust place, in the relevant source files, a statement of theadditional terms that apply to those files, or a notice indicatingwhere to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in theform of a separately written license, or stated as exceptions;the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expresslyprovided under this License. Any attempt otherwise to propagate ormodify it is void, and will automatically terminate your rights underthis License (including any patent licenses granted under the thirdparagraph of section 11).
However, if you cease all violation of this License, then yourlicense from a particular copyright holder is reinstated (a)provisionally, unless and until the copyright holder explicitly andfinally terminates your license, and (b) permanently, if the copyrightholder fails to notify you of the violation by some reasonable meansprior to 60 days after the cessation.
Moreover, your license from a particular copyright holder isreinstated permanently if the copyright holder notifies you of theviolation by some reasonable means, this is the first time you havereceived notice of violation of this License (for any work) from thatcopyright holder, and you cure the violation prior to 30 days afteryour receipt of the notice.
Termination of your rights under this section does not terminate thelicenses of parties who have received copies or rights from you underthis License. If your rights have been terminated and not permanentlyreinstated, you do not qualify to receive new licenses for the samematerial under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive orrun a copy of the Program. Ancillary propagation of a covered workoccurring solely as a consequence of using peer-to-peer transmissionto receive a copy likewise does not require acceptance. However,nothing other than this License grants you permission to propagate ormodify any covered work. These actions infringe copyright if you donot accept this License. Therefore, by modifying or propagating acovered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automaticallyreceives a license from the original licensors, to run, modify andpropagate that work, subject to this License. You are not responsiblefor enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of anorganization, or substantially all assets of one, or subdividing anorganization, or merging organizations. If propagation of a coveredwork results from an entity transaction, each party to thattransaction who receives a copy of the work also receives whateverlicenses to the work the party's predecessor in interest had or couldgive under the previous paragraph, plus a right to possession of theCorresponding Source of the work from the predecessor in interest, ifthe predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of therights granted or affirmed under this License. For example, you maynot impose a license fee, royalty, or other charge for exercise ofrights granted under this License, and you may not initiate litigation(including a cross-claim or counterclaim in a lawsuit) alleging thatany patent claim is infringed by making, using, selling, offering forsale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under thisLicense of the Program or a work on which the Program is based. Thework thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claimsowned or controlled by the contributor, whether already acquired orhereafter acquired, that would be infringed by some manner, permittedby this License, of making, using, or selling its contributor version,but do not include claims that would be infringed only as aconsequence of further modification of the contributor version. Forpurposes of this definition, "control" includes the right to grantpatent sublicenses in a manner consistent with the requirements ofthis License.
Each contributor grants you a non-exclusive, worldwide, royalty-freepatent license under the contributor's essential patent claims, tomake, use, sell, offer for sale, import and otherwise run, modify andpropagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any expressagreement or commitment, however denominated, not to enforce a patent(such as an express permission to practice a patent or covenant not tosue for patent infringement). To "grant" such a patent license to aparty means to make such an agreement or commitment not to enforce apatent against the party.
If you convey a covered work, knowingly relying on a patent license,and the Corresponding Source of the work is not available for anyoneto copy, free of charge and under the terms of this License, through apublicly available network server or other readily accessible means,then you must either (1) cause the Corresponding Source to be soavailable, or (2) arrange to deprive yourself of the benefit of thepatent license for this particular work, or (3) arrange, in a mannerconsistent with the requirements of this License, to extend the patentlicense to downstream recipients. "Knowingly relying" means you haveactual knowledge that, but for the patent license, your conveying thecovered work in a country, or your recipient's use of the covered workin a country, would infringe one or more identifiable patents in thatcountry that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction orarrangement, you convey, or propagate by procuring conveyance of, acovered work, and grant a patent license to some of the partiesreceiving the covered work authorizing them to use, propagate, modifyor convey a specific copy of the covered work, then the patent licenseyou grant is automatically extended to all recipients of the coveredwork and works based on it.
A patent license is "discriminatory" if it does not include withinthe scope of its coverage, prohibits the exercise of, or isconditioned on the non-exercise of one or more of the rights that arespecifically granted under this License. You may not convey a coveredwork if you are a party to an arrangement with a third party that isin the business of distributing software, under which you make paymentto the third party based on the extent of your activity of conveyingthe work, and under which the third party grants, to any of theparties who would receive the covered work from you, a discriminatorypatent license (a) in connection with copies of the covered workconveyed by you (or copies made from those copies), or (b) primarilyfor and in connection with specific products or compilations thatcontain the covered work, unless you entered into that arrangement,or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limitingany implied license or other defenses to infringement that mayotherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement orotherwise) that contradict the conditions of this License, they do notexcuse you from the conditions of this License. If you cannot convey acovered work so as to satisfy simultaneously your obligations under thisLicense and any other pertinent obligations, then as a consequence you maynot convey it at all. For example, if you agree to terms that obligate youto collect a royalty for further conveying from those to whom you conveythe Program, the only way you could satisfy both those terms and thisLicense would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you havepermission to link or combine any covered work with a work licensedunder version 3 of the GNU Affero General Public License into a singlecombined work, and to convey the resulting work. The terms of thisLicense will continue to apply to the part which is the covered work,but the special requirements of the GNU Affero General Public License,section 13, concerning interaction through a network will apply to thecombination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions ofthe GNU General Public License from time to time. Such new versions willbe similar in spirit to the present version, but may differ in detail toaddress new problems or concerns.
Each version is given a distinguishing version number. If theProgram specifies that a certain numbered version of the GNU GeneralPublic License "or any later version" applies to it, you have theoption of following the terms and conditions either of that numberedversion or of any later version published by the Free SoftwareFoundation. If the Program does not specify a version number of theGNU General Public License, you may choose any version ever publishedby the Free Software Foundation.
If the Program specifies that a proxy can decide which futureversions of the GNU General Public License can be used, that proxy'spublic statement of acceptance of a version permanently authorizes youto choose that version for the Program.
Later license versions may give you additional or differentpermissions. However, no additional obligations are imposed on anyauthor or copyright holder as a result of your choosing to follow alater version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BYAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHTHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTYOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAMIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OFALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITINGWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYSTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANYGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THEUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OFDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRDPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OFSUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability providedabove cannot be given local legal effect according to their terms,reviewing courts shall apply local law that most closely approximatesan absolute waiver of all civil liability in connection with theProgram, unless a warranty or assumption of liability accompanies acopy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatestpossible use to the public, the best way to achieve this is to make itfree software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safestto attach them to the start of each source file to most effectivelystate the exclusion of warranty; and each file should have at leastthe "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a shortnotice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriateparts of the General Public License. Of course, your program's commandsmight be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,if any, to sign a "copyright disclaimer" for the program, if necessary.For more information on this, and how to apply and follow the GNU GPL, see<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your programinto proprietary programs. If your program is a subroutine library, youmay consider it more useful to permit linking proprietary applications withthe library. If this is what you want to do, use the GNU Lesser GeneralPublic License instead of this License. But first, please read<https://www.gnu.org/licenses/why-not-lgpl.html>.123456789101112131415161718192021MIT License
Copyright (c) 2016 kmansouri
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718The MIT Licene
Copyright 2025 Matthew Newville, The University of Chicago, newville@cars.uchicago.edu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software andassociated documentation files (the "Software"), to deal in the Software without restriction,including without limitation the rights to use, copy, modify, merge, publish, distribute,sublicense, and/or sell copies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies orsubstantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUTNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUTOF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.123456789101112131415161718192021MIT License
Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2025 WangGroupFDU
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021The MIT License
Copyright (c) 2022, 2023 Stanford Research Systems
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.1234567891011121314151617181920> ⚠️ Note: This repository depends on [`pykeri`](https://github.com/byungkiryu/teMatDb/tree/main/pykeri), which is developed and licensed separately. See the pykeri repository for more details.
MIT License
Copyright (c) 2025 Byungki Ryu
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199id,chem_id,name,maker,model,name_zh,domain_name,path,n_components,n_joints,n_state_slots,n_capabilities,n_readouts,n_interface_points,n_sources,output_templates,size_x_m,size_y_m,size_z_m,glb,urdf,contract
instrument.mt_xpr204e,CHEM-001,Analytical balance,METTLER TOLEDO,XPR204E,CHEM-001 分析天平(METTLER TOLEDO XPR204E目标;PX224E功能族几何),Basic Metrology & Sample Handling,assets/basic40_batch02/t4_measure/mt_xpr204e,25,16,22,9,1,1,14,False,0.209,0.3286,0.309,assets/basic40_batch02/t4_measure/mt_xpr204e/model.glb,assets/basic40_batch02/t4_measure/mt_xpr204e/model.urdf,assets/basic40_batch02/t4_measure/mt_xpr204e/asset.contract.json
instrument.mt_hx204,CHEM-002,Halogen moisture analyzer,METTLER TOLEDO,HX204,METTLER TOLEDO HX204 卤素水分测定仪,Basic Metrology & Sample Handling,assets/expansion_batch04/t4_measure/mt_hx204,56,5,14,8,2,1,6,False,0.2309,0.597,0.1437,assets/expansion_batch04/t4_measure/mt_hx204/model.glb,assets/expansion_batch04/t4_measure/mt_hx204/model.urdf,assets/expansion_batch04/t4_measure/mt_hx204/asset.contract.json
instrument.antonpaar_dma5002,CHEM-003,Oscillating U-tube density meter,Anton Paar,DMA 5002,Anton Paar DMA 5002振动管液体密度计,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/antonpaar_dma5002,39,4,17,9,2,2,5,False,0.3607,0.5298,0.252,assets/expansion_batch03/t4_measure/antonpaar_dma5002/model.glb,assets/expansion_batch03/t4_measure/antonpaar_dma5002/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_dma5002/asset.contract.json
instrument.antonpaar_abbematadvanced,CHEM-004,Digital refractometer,Anton Paar,Abbemat Advanced 5201,Anton Paar Abbemat Advanced 5201数字折射仪,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/antonpaar_abbematadvanced,38,5,19,10,3,1,5,False,0.2261,0.3338,0.1242,assets/expansion_batch03/t4_measure/antonpaar_abbematadvanced/model.glb,assets/expansion_batch03/t4_measure/antonpaar_abbematadvanced/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_abbematadvanced/asset.contract.json
instrument.metrohm_914,CHEM-005,pH / DO / conductivity meter,Metrohm,914 pH/DO/Conductometer,CHEM-005 多参数电化学水质测定仪 — Metrohm 914 pH/DO/Conductometer,Basic Metrology & Sample Handling,assets/basic40_batch02/t4_measure/metrohm_914,11,3,44,11,0,0,7,False,0.2062,0.208,0.0551,assets/basic40_batch02/t4_measure/metrohm_914/model.glb,assets/basic40_batch02/t4_measure/metrohm_914/model.urdf,assets/basic40_batch02/t4_measure/metrohm_914/asset.contract.json
instrument.mt_mp70,CHEM-006,Automatic melting-point system,METTLER TOLEDO,MP70,METTLER TOLEDO MP70自动熔点仪,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/mt_mp70,51,4,26,10,3,4,6,False,0.1806,0.3519,0.19,assets/expansion_batch03/t4_measure/mt_mp70/model.glb,assets/expansion_batch03/t4_measure/mt_mp70/model.urdf,assets/expansion_batch03/t4_measure/mt_mp70/asset.contract.json
instrument.aqualab_4te,CHEM-007,Water-activity meter,AQUALAB,4TE,AQUALAB 4TE水活度仪,Basic Metrology & Sample Handling,assets/expansion_batch04/t4_measure/aqualab_4te,39,10,27,13,2,1,6,False,0.267,0.184,0.129,assets/expansion_batch04/t4_measure/aqualab_4te/model.glb,assets/expansion_batch04/t4_measure/aqualab_4te/model.urdf,assets/expansion_batch04/t4_measure/aqualab_4te/asset.contract.json
instrument.ika_plate_rctdigital,CHEM-008,Magnetic hotplate stirrer,IKA,Plate RCT digital,磁力加热搅拌器IKA Plate (RCT digital)(25004601,附PT1000),Basic Metrology & Sample Handling,assets/expansion_batch05/t4_measure/ika_plate_rctdigital,31,8,33,33,13,7,14,True,0.16,0.27,0.0849,assets/expansion_batch05/t4_measure/ika_plate_rctdigital/model.glb,assets/expansion_batch05/t4_measure/ika_plate_rctdigital/model.urdf,assets/expansion_batch05/t4_measure/ika_plate_rctdigital/asset.contract.json
instrument.ika_ks4000,CHEM-009,Incubated orbital shaker,IKA,KS 4000 i control,IKA KS 4000 i control恒温轨道摇床,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/ika_ks4000,48,14,33,14,3,9,7,False,0.58,0.75,0.52,assets/expansion_batch03/t4_measure/ika_ks4000/model.glb,assets/expansion_batch03/t4_measure/ika_ks4000/model.urdf,assets/expansion_batch03/t4_measure/ika_ks4000/asset.contract.json
instrument.eppendorf_5910ri,CHEM-010,Refrigerated multipurpose centrifuge,Eppendorf,5910 Ri,CHEM-010 冷冻多用途离心机 Eppendorf 5910 Ri,Basic Metrology & Sample Handling,assets/basic40_batch02/t3_analytical/eppendorf_5910ri,16,2,23,13,2,24,11,False,0.72,0.68,0.37,assets/basic40_batch02/t3_analytical/eppendorf_5910ri/model.glb,assets/basic40_batch02/t3_analytical/eppendorf_5910ri/model.urdf,assets/basic40_batch02/t3_analytical/eppendorf_5910ri/asset.contract.json
instrument.binder_fd056,CHEM-011,Forced-convection drying oven,BINDER,FD 56,强制对流干燥箱BINDER FD 56(FD056-230V,标准配置),Basic Metrology & Sample Handling,assets/expansion_batch05/t4_measure/binder_fd056,34,7,25,32,6,8,15,True,0.564,0.6425,0.625,assets/expansion_batch05/t4_measure/binder_fd056/model.glb,assets/expansion_batch05/t4_measure/binder_fd056/model.urdf,assets/expansion_batch05/t4_measure/binder_fd056/asset.contract.json
instrument.binder_vd56,CHEM-012,Vacuum drying oven,BINDER,VD 56,BINDER VD 56 真空干燥箱(标准单铝搁板配置),Basic Metrology & Sample Handling,assets/basic40_batch02/t1_thermal/binder_vd56,24,7,10,6,1,6,14,False,0.638,0.538,0.815,assets/basic40_batch02/t1_thermal/binder_vd56/model.glb,assets/basic40_batch02/t1_thermal/binder_vd56/model.urdf,assets/basic40_batch02/t1_thermal/binder_vd56/asset.contract.json
instrument.elma_elmasonics60h,CHEM-013,Ultrasonic cleaning bath,Elma,Elmasonic S60H,Elma Elmasonic S60H原版超声清洗槽,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/elma_elmasonics60h,38,8,56,15,26,2,5,False,0.365,0.2104,0.2727,assets/expansion_batch03/t4_measure/elma_elmasonics60h/model.glb,assets/expansion_batch03/t4_measure/elma_elmasonics60h/model.urdf,assets/expansion_batch03/t4_measure/elma_elmasonics60h/asset.contract.json
instrument.hach_tl2300epa,CHEM-014,Benchtop turbidimeter,Hach,TL2300 EPA,Hach TL2300 EPA钨灯台式浊度仪,Basic Metrology & Sample Handling,assets/expansion_batch03/t4_measure/hach_tl2300epa,33,2,26,11,3,2,7,False,0.3956,0.309,0.1534,assets/expansion_batch03/t4_measure/hach_tl2300epa/model.glb,assets/expansion_batch03/t4_measure/hach_tl2300epa/model.urdf,assets/expansion_batch03/t4_measure/hach_tl2300epa/asset.contract.json
instrument.antonpaar_monowave400,CHEM-015,Microwave synthesis reactor,Anton Paar,Monowave 400,Anton Paar Monowave 400微波合成反应器,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/antonpaar_monowave400,40,3,32,12,3,2,11,False,0.4204,0.5594,0.3102,assets/expansion_batch03/t5_automation/antonpaar_monowave400/model.glb,assets/expansion_batch03/t5_automation/antonpaar_monowave400/model.urdf,assets/expansion_batch03/t5_automation/antonpaar_monowave400/asset.contract.json
instrument.ika_electrasyn2,CHEM-016,Electro-organic synthesis system,IKA,ElectraSyn 2.0,IKA ElectraSyn 2.0 Package电有机合成仪,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/ika_electrasyn2,36,2,40,12,4,1,10,False,0.13,0.2509,0.15,assets/expansion_batch03/t5_automation/ika_electrasyn2/model.glb,assets/expansion_batch03/t5_automation/ika_electrasyn2/model.urdf,assets/expansion_batch03/t5_automation/ika_electrasyn2/asset.contract.json
instrument.hepatochem_photoredoxbox,CHEM-017,Photochemical reactor,HepatoChem,PhotoRedOx Box UV-Vis,HepatoChem PhotoRedOx Box UV-Vis HCK1022-01-001受控光反应器,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/hepatochem_photoredoxbox,62,3,36,15,3,8,7,False,0.3556,0.3556,0.3048,assets/expansion_batch03/t5_automation/hepatochem_photoredoxbox/model.glb,assets/expansion_batch03/t5_automation/hepatochem_photoredoxbox/model.urdf,assets/expansion_batch03/t5_automation/hepatochem_photoredoxbox/asset.contract.json
instrument.parr_4591,CHEM-018,Micro high-pressure stirred reactor,Parr Instrument,4591,微型高压搅拌反应釜 Parr Instrument 4591(标准FKM密封),Reaction & Molecular Synthesis,assets/basic40_batch02/t1_thermal/parr_4591,30,9,22,10,1,1,10,False,0.3048,0.4572,0.6858,assets/basic40_batch02/t1_thermal/parr_4591/model.glb,assets/basic40_batch02/t1_thermal/parr_4591/model.urdf,assets/basic40_batch02/t1_thermal/parr_4591/asset.contract.json
instrument.syrris_asiadiscovery,CHEM-019,Continuous-flow chemistry system,Syrris,Asia Discovery,Syrris Asia Discovery Regular 连续流化学合成系统,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/syrris_asiadiscovery,66,4,38,13,3,11,16,False,1.23,0.3103,0.48,assets/expansion_batch03/t5_automation/syrris_asiadiscovery/model.glb,assets/expansion_batch03/t5_automation/syrris_asiadiscovery/model.urdf,assets/expansion_batch03/t5_automation/syrris_asiadiscovery/asset.contract.json
instrument.thalesnano_hcube,CHEM-020,Continuous-flow hydrogenation reactor,ThalesNano,H-Cube Pro,ThalesNano H-Cube Pro 连续流催化加氢仪,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/thalesnano_hcube,70,5,41,17,3,6,11,False,0.4962,0.5095,0.2745,assets/expansion_batch03/t5_automation/thalesnano_hcube/model.glb,assets/expansion_batch03/t5_automation/thalesnano_hcube/model.urdf,assets/expansion_batch03/t5_automation/thalesnano_hcube/asset.contract.json
instrument.radleys_mya4,CHEM-021,Parallel reaction station (4 independent zones),Radleys,Mya 4,独立温区并行反应工作站 Radleys Mya 4,Reaction & Molecular Synthesis,assets/basic40_batch02/t1_thermal/radleys_mya4,33,4,92,15,4,4,12,False,0.6,0.611,0.4992,assets/basic40_batch02/t1_thermal/radleys_mya4/model.glb,assets/basic40_batch02/t1_thermal/radleys_mya4/model.urdf,assets/basic40_batch02/t1_thermal/radleys_mya4/asset.contract.json
instrument.cem_libertyblue,CHEM-022,Automated microwave peptide synthesizer,CEM,Liberty Blue 2.0,CEM Liberty Blue 2.0 自动固相多肽合成仪,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/cem_libertyblue,103,2,34,13,3,47,15,False,1.15,0.52,0.78,assets/expansion_batch03/t5_automation/cem_libertyblue/model.glb,assets/expansion_batch03/t5_automation/cem_libertyblue/model.urdf,assets/expansion_batch03/t5_automation/cem_libertyblue/asset.contract.json
instrument.cytiva_ktaoligosynt,CHEM-023,Oligonucleotide synthesizer,Cytiva,ÄKTA oligosynt,Cytiva ÄKTA oligosynt 寡核苷酸合成仪,Reaction & Molecular Synthesis,assets/expansion_batch03/t5_automation/cytiva_ktaoligosynt,116,3,31,12,3,53,15,False,0.7,0.54,0.63,assets/expansion_batch03/t5_automation/cytiva_ktaoligosynt/model.glb,assets/expansion_batch03/t5_automation/cytiva_ktaoligosynt/model.urdf,assets/expansion_batch03/t5_automation/cytiva_ktaoligosynt/asset.contract.json
instrument.ika_rv10_digital_v,CHEM-024,Rotary evaporator,IKA,RV 10 digital V,IKA RV 10 digital V 旋转蒸发仪,"Extraction, Purification & Drying",assets/basic40_batch02/t2_vacuum/ika_rv10,23,5,26,10,2,2,13,False,0.5,0.44,0.6822,assets/basic40_batch02/t2_vacuum/ika_rv10/model.glb,assets/basic40_batch02/t2_vacuum/ika_rv10/model.urdf,assets/basic40_batch02/t2_vacuum/ika_rv10/asset.contract.json
instrument.buchi_lyovapor_l250_pro,CHEM-025,Freeze dryer,BUCHI,Lyovapor L-250 Pro,冷冻干燥机 BUCHI Lyovapor L-250 Pro,"Extraction, Purification & Drying",assets/basic40_batch02/t2_vacuum/buchi_lyovapor_l250,14,3,34,13,3,4,8,False,0.503,0.645,0.9275,assets/basic40_batch02/t2_vacuum/buchi_lyovapor_l250/model.glb,assets/basic40_batch02/t2_vacuum/buchi_lyovapor_l250/model.urdf,assets/basic40_batch02/t2_vacuum/buchi_lyovapor_l250/asset.contract.json
instrument.buchi_minispray,CHEM-026,Lab spray dryer,BUCHI,Mini Spray Dryer S-300,BUCHI Mini Spray Dryer S-300 实验室喷雾干燥机,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/buchi_minispray,62,2,26,16,3,13,11,False,0.62,0.64,1.052,assets/expansion_batch03/t2_vacuum/buchi_minispray/model.glb,assets/expansion_batch03/t2_vacuum/buchi_minispray/model.urdf,assets/expansion_batch03/t2_vacuum/buchi_minispray/asset.contract.json
instrument.tousimis_autosamdri815,CHEM-027,Critical point dryer,Tousimis,Autosamdri-815 Series B,Tousimis Autosamdri-815 Series B 8779C 临界点干燥仪,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/tousimis_autosamdri815,66,2,30,13,3,8,12,False,0.598,0.546,0.32,assets/expansion_batch03/t2_vacuum/tousimis_autosamdri815/model.glb,assets/expansion_batch03/t2_vacuum/tousimis_autosamdri815/model.urdf,assets/expansion_batch03/t2_vacuum/tousimis_autosamdri815/asset.contract.json
instrument.buchi_speedextractore,CHEM-028,Pressurized solvent extractor,BUCHI,SpeedExtractor E-916,BUCHI SpeedExtractor E-916 六位四溶剂加压萃取仪,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/buchi_speedextractore,138,4,33,14,3,24,14,False,0.67,0.5,0.725,assets/expansion_batch03/t2_vacuum/buchi_speedextractore/model.glb,assets/expansion_batch03/t2_vacuum/buchi_speedextractore/model.urdf,assets/expansion_batch03/t2_vacuum/buchi_speedextractore/asset.contract.json
instrument.gilson_cpc250,CHEM-029,Centrifugal partition chromatograph,Gilson,CPC 250,Gilson CPC250与PLC2050液液分配纯化系统,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/gilson_cpc250,256,3,28,10,3,202,11,False,1.39,0.59,0.66,assets/expansion_batch03/t2_vacuum/gilson_cpc250/model.glb,assets/expansion_batch03/t2_vacuum/gilson_cpc250/model.urdf,assets/expansion_batch03/t2_vacuum/gilson_cpc250/asset.contract.json
instrument.sartorius_vivaflow200,CHEM-030,Tangential-flow ultrafiltration module,Sartorius,Vivaflow 200,Sartorius Vivaflow200单盒切向流超滤组件,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/sartorius_vivaflow200,48,1,33,10,0,4,14,False,0.1808,0.038,0.2025,assets/expansion_batch03/t2_vacuum/sartorius_vivaflow200/model.glb,assets/expansion_batch03/t2_vacuum/sartorius_vivaflow200/model.urdf,assets/expansion_batch03/t2_vacuum/sartorius_vivaflow200/asset.contract.json
instrument.biotage_extrahera_classic,CHEM-031,Automated solid-phase extraction workstation,Biotage,Extrahera Classic,Biotage Extrahera Classic 自动固相萃取工作站,"Extraction, Purification & Drying",assets/basic40_batch02/t2_vacuum/biotage_extrahera,24,0,30,10,0,3,14,False,0.86,0.57,0.73,assets/basic40_batch02/t2_vacuum/biotage_extrahera/model.glb,assets/basic40_batch02/t2_vacuum/biotage_extrahera/model.urdf,assets/basic40_batch02/t2_vacuum/biotage_extrahera/asset.contract.json
instrument.sft_sft110,CHEM-032,Supercritical fluid extractor,Supercritical Fluid Technologies,SFT-110,SFT110超临界流体萃取仪100mL配置,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/sft_sft110,64,3,30,13,3,6,11,False,0.29,0.57,0.76,assets/expansion_batch03/t2_vacuum/sft_sft110/model.glb,assets/expansion_batch03/t2_vacuum/sft_sft110/model.urdf,assets/expansion_batch03/t2_vacuum/sft_sft110/asset.contract.json
instrument.syrris_asiafllex,CHEM-033,Flow liquid–liquid extraction module,Syrris,Asia FLLEX,Asia FLLEX连续流液液萃取模块,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/syrris_asiafllex,58,2,42,15,1,6,14,False,0.16,0.3032,0.13,assets/expansion_batch03/t2_vacuum/syrris_asiafllex/model.glb,assets/expansion_batch03/t2_vacuum/syrris_asiafllex/model.urdf,assets/expansion_batch03/t2_vacuum/syrris_asiafllex/asset.contract.json
instrument.biotage_selekt,CHEM-034,Automated flash chromatography system,Biotage,"Selekt (UV, single bed)",Biotage Selekt双通道单床UV快速制备色谱仪,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/biotage_selekt,200,3,55,15,4,151,12,False,0.335,0.393,0.545,assets/expansion_batch03/t2_vacuum/biotage_selekt/model.glb,assets/expansion_batch03/t2_vacuum/biotage_selekt/model.urdf,assets/expansion_batch03/t2_vacuum/biotage_selekt/asset.contract.json
instrument.pccell_ed64002,CHEM-035,Lab electrodialysis stack,PCCell,ED 64002 + BED1-2 Basic,PCCell ED64002 / BED1-2 Basic实验室电渗析组件,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/pccell_ed64002,112,3,28,14,2,10,11,False,0.8,0.36,0.3412,assets/expansion_batch03/t2_vacuum/pccell_ed64002/model.glb,assets/expansion_batch03/t2_vacuum/pccell_ed64002/model.urdf,assets/expansion_batch03/t2_vacuum/pccell_ed64002/asset.contract.json
instrument.genevac_mivac2,CHEM-036,Centrifugal vacuum concentrator,Genevac / SP Industries,miVac 2 Duo,Genevac miVac 2 Duo离心真空浓缩仪 Rev00101/25,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/genevac_mivac2,52,9,22,13,2,8,12,False,0.3605,0.4567,0.3002,assets/expansion_batch03/t2_vacuum/genevac_mivac2/model.glb,assets/expansion_batch03/t2_vacuum/genevac_mivac2/model.urdf,assets/expansion_batch03/t2_vacuum/genevac_mivac2/asset.contract.json
instrument.pilodist_pilodist104,CHEM-037,High-efficiency lab fractional distillation unit,PILODIST,PILODIST 104,PILODIST104高效实验室精馏装置6L90板规格,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/pilodist_pilodist104,95,4,24,15,2,12,14,False,1.6,0.5,2.7,assets/expansion_batch03/t2_vacuum/pilodist_pilodist104/model.glb,assets/expansion_batch03/t2_vacuum/pilodist_pilodist104/model.urdf,assets/expansion_batch03/t2_vacuum/pilodist_pilodist104/asset.contract.json
instrument.uic_kdl1basic,CHEM-038,Short-path wiped-film molecular still,UIC,KDL1 Basic,UIC KDL1 Basic 刮膜短程分子蒸馏装置,"Extraction, Purification & Drying",assets/expansion_batch03/t2_vacuum/uic_kdl1basic,74,5,30,17,1,13,23,False,0.8,0.4,1.2,assets/expansion_batch03/t2_vacuum/uic_kdl1basic/model.glb,assets/expansion_batch03/t2_vacuum/uic_kdl1basic/model.urdf,assets/expansion_batch03/t2_vacuum/uic_kdl1basic/asset.contract.json
instrument.scp_digiprepms,CHEM-039,Graphite block digestion system,SCP SCIENCE,DigiPREP MS,SCP SCIENCE DigiPREP MS 010-500-205 石墨块消解仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/scp_digiprepms,112,2,24,13,0,50,13,False,0.49,0.4006,0.18,assets/expansion_batch03/t1_thermal/scp_digiprepms/model.glb,assets/expansion_batch03/t1_thermal/scp_digiprepms/model.urdf,assets/expansion_batch03/t1_thermal/scp_digiprepms/asset.contract.json
instrument.retsch_pm100,CHEM-040,Planetary ball mill,RETSCH,PM 100,RETSCH PM 100 单工位行星式球磨仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/retsch_pm100,72,8,24,13,1,3,5,False,0.64,0.432,0.48,assets/expansion_batch03/t1_thermal/retsch_pm100/model.glb,assets/expansion_batch03/t1_thermal/retsch_pm100/model.urdf,assets/expansion_batch03/t1_thermal/retsch_pm100/asset.contract.json
instrument.retsch_as200,CHEM-041,Vibratory sieve shaker,RETSCH,AS 200 control,RETSCH AS 200 control 振动筛分仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/retsch_as200,61,16,24,20,3,4,7,False,0.417,0.3895,0.842,assets/expansion_batch03/t1_thermal/retsch_as200/model.glb,assets/expansion_batch03/t1_thermal/retsch_as200/model.urdf,assets/expansion_batch03/t1_thermal/retsch_as200/asset.contract.json
instrument.retsch_pt100,CHEM-042,Rotary sample divider,RETSCH,PT 100,RETSCH PT100旋转缩分仪与DR100,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/retsch_pt100,74,15,25,21,2,5,9,False,0.582,0.42,0.9115,assets/expansion_batch03/t1_thermal/retsch_pt100/model.glb,assets/expansion_batch03/t1_thermal/retsch_pt100/model.urdf,assets/expansion_batch03/t1_thermal/retsch_pt100/asset.contract.json
instrument.ika_t25,CHEM-043,Rotor–stator disperser,IKA,T 25 digital ULTRA-TURRAX,IKA T25digital转子定子分散机,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/ika_t25,34,4,30,16,1,4,8,False,0.32,0.3,0.628,assets/expansion_batch03/t1_thermal/ika_t25/model.glb,assets/expansion_batch03/t1_thermal/ika_t25/model.urdf,assets/expansion_batch03/t1_thermal/ika_t25/asset.contract.json
instrument.sonics_vcx750,CHEM-044,Probe ultrasonic processor,Sonics,VCX 750,Sonics VCX750探头式超声处理器,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/sonics_vcx750,66,25,34,19,4,5,7,False,0.52,0.3679,0.49,assets/expansion_batch03/t1_thermal/sonics_vcx750/model.glb,assets/expansion_batch03/t1_thermal/sonics_vcx750/model.urdf,assets/expansion_batch03/t1_thermal/sonics_vcx750/asset.contract.json
instrument.thinky_are310s,CHEM-045,Planetary centrifugal mixer,THINKY,ARE-310,THINKY ARE-310S-UL行星离心混合脱泡机,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/thinky_are310s,40,10,33,14,2,5,9,False,0.4279,0.336,0.3808,assets/expansion_batch03/t1_thermal/thinky_are310s/model.glb,assets/expansion_batch03/t1_thermal/thinky_are310s/model.urdf,assets/expansion_batch03/t1_thermal/thinky_are310s/asset.contract.json
instrument.metrohm_909uv,CHEM-046,UV digester,Metrohm,909 UV Digester,Metrohm909UV紫外消解仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/metrohm_909uv,72,10,31,17,3,14,6,False,0.33,0.31,0.5,assets/expansion_batch03/t1_thermal/metrohm_909uv/model.glb,assets/expansion_batch03/t1_thermal/metrohm_909uv/model.urdf,assets/expansion_batch03/t1_thermal/metrohm_909uv/asset.contract.json
instrument.multiwave_7101,CHEM-047,Microwave acid digestion system,Anton Paar,Multiwave 7101,微波酸消解仪 Anton Paar Multiwave 7101(24×8 mL架),Digestion & Solid Sample Prep,assets/basic40_batch02/t1_thermal/multiwave_7101,44,1,16,11,1,0,13,False,0.497,0.742,0.47,assets/basic40_batch02/t1_thermal/multiwave_7101/model.glb,assets/basic40_batch02/t1_thermal/multiwave_7101/model.urdf,assets/basic40_batch02/t1_thermal/multiwave_7101/asset.contract.json
instrument.velp_udk159,CHEM-048,Automatic Kjeldahl distillation & titration unit,VELP,UDK 159,VELP UDK159自动蒸汽蒸馏滴定仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/velp_udk159,57,6,34,18,3,9,10,False,0.385,0.416,0.78,assets/expansion_batch03/t1_thermal/velp_udk159/model.glb,assets/expansion_batch03/t1_thermal/velp_udk159/model.urdf,assets/expansion_batch03/t1_thermal/velp_udk159/asset.contract.json
instrument.buchi_hydrolexh,CHEM-049,Acid hydrolysis unit,BUCHI,HydrolEx H-506,BUCHI HydrolEx H-506酸水解前处理仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/buchi_hydrolexh,92,10,25,19,0,16,12,False,0.312,0.614,0.47,assets/expansion_batch03/t1_thermal/buchi_hydrolexh/model.glb,assets/expansion_batch03/t1_thermal/buchi_hydrolexh/model.urdf,assets/expansion_batch03/t1_thermal/buchi_hydrolexh/asset.contract.json
instrument.malvern_leneo,CHEM-050,Automated fusion bead maker,Malvern Panalytical / Claisse,LeNeo,Malvern Panalytical Claisse LeNeo自动熔融制样仪,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/malvern_leneo,70,6,20,15,3,5,6,False,0.5563,0.5737,0.52,assets/expansion_batch03/t1_thermal/malvern_leneo/model.glb,assets/expansion_batch03/t1_thermal/malvern_leneo/model.urdf,assets/expansion_batch03/t1_thermal/malvern_leneo/asset.contract.json
instrument.specac_atlasmanual,CHEM-051,Hydraulic pellet press,Specac,Atlas Manual 15T,Specac Atlas Manual15T液压粉末压片机,Digestion & Solid Sample Prep,assets/expansion_batch03/t1_thermal/specac_atlasmanual,57,9,27,16,0,3,6,False,0.31,0.19,0.61,assets/expansion_batch03/t1_thermal/specac_atlasmanual/model.glb,assets/expansion_batch03/t1_thermal/specac_atlasmanual/model.urdf,assets/expansion_batch03/t1_thermal/specac_atlasmanual/asset.contract.json
instrument.buchi_encapsulatorb,CHEM-052,Vibrating-nozzle encapsulator,BUCHI,Encapsulator B-390,BUCHI Encapsulator B-390振动喷嘴微胶囊制备仪,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/buchi_encapsulatorb,53,8,30,23,4,10,6,False,0.435,0.34,0.29,assets/expansion_batch04/t5_automation/buchi_encapsulatorb/model.glb,assets/expansion_batch04/t5_automation/buchi_encapsulatorb/model.urdf,assets/expansion_batch04/t5_automation/buchi_encapsulatorb/asset.contract.json
instrument.ossila_spincoater,CHEM-053,Spin coater,Ossila,Spin Coater V3,Ossila Spin Coater Standard V3 L2001A3旋涂机,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/ossila_spincoater,45,15,13,12,3,4,7,False,0.171,0.234,0.1399,assets/expansion_batch04/t5_automation/ossila_spincoater/model.glb,assets/expansion_batch04/t5_automation/ossila_spincoater/model.urdf,assets/expansion_batch04/t5_automation/ossila_spincoater/asset.contract.json
instrument.ossila_dipcoater,CHEM-054,Dip coater,Ossila,Dip Coater V2,Ossila Dip Coater V2 L2006A2(手册2.0.A),Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/ossila_dipcoater,45,15,18,17,3,4,7,False,0.2,0.3,0.35,assets/expansion_batch04/t5_automation/ossila_dipcoater/model.glb,assets/expansion_batch04/t5_automation/ossila_dipcoater/model.urdf,assets/expansion_batch04/t5_automation/ossila_dipcoater/asset.contract.json
instrument.ossila_doctorblade,CHEM-055,Automated doctor-blade coater,Ossila,Doctor Blade Coater,Ossila Doctor Blade Coater(100mm数字刮刀+8mm玻璃台),Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/ossila_doctorblade,66,16,21,18,4,4,8,False,0.28,0.36,0.19,assets/expansion_batch04/t5_automation/ossila_doctorblade/model.glb,assets/expansion_batch04/t5_automation/ossila_doctorblade/model.urdf,assets/expansion_batch04/t5_automation/ossila_doctorblade/asset.contract.json
instrument.ossila_slotdie,CHEM-056,Slot-die coater,Ossila,Slot-Die Coater V2,Ossila Slot-Die Coater V2 L2005A2(100mm标准模头/5mL注射器),Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/ossila_slotdie,64,17,29,22,6,5,8,False,0.28,0.36,0.19,assets/expansion_batch04/t5_automation/ossila_slotdie/model.glb,assets/expansion_batch04/t5_automation/ossila_slotdie/model.urdf,assets/expansion_batch04/t5_automation/ossila_slotdie/asset.contract.json
instrument.thermo_process11,CHEM-057,Lab twin-screw extruder,Thermo Fisher Scientific,Process 11,Thermo Scientific Process11(标准350℃双螺杆),Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/thermo_process11,66,5,32,22,10,7,7,False,0.82,0.48,0.41,assets/expansion_batch04/t5_automation/thermo_process11/model.glb,assets/expansion_batch04/t5_automation/thermo_process11/model.urdf,assets/expansion_batch04/t5_automation/thermo_process11/asset.contract.json
instrument.fujifilm_dmp2850,CHEM-058,Materials inkjet printer,FUJIFILM Dimatix,DMP-2850,FUJIFILM Dimatix DMP-2850 S(SAMBA 12喷嘴),Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/fujifilm_dmp2850,60,4,28,21,6,7,9,False,0.673,0.5917,0.419,assets/expansion_batch04/t5_automation/fujifilm_dmp2850/model.glb,assets/expansion_batch04/t5_automation/fujifilm_dmp2850/model.urdf,assets/expansion_batch04/t5_automation/fujifilm_dmp2850/asset.contract.json
instrument.linari_rtadvanced,CHEM-059,Electrospinning system,Linari Nanotech,RT Advanced,Linari Nanotech RT Advanced静电纺丝系统,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/linari_rtadvanced,63,14,33,21,6,15,6,False,1.05,1.0455,2.2,assets/expansion_batch04/t5_automation/linari_rtadvanced/model.glb,assets/expansion_batch04/t5_automation/linari_rtadvanced/model.urdf,assets/expansion_batch04/t5_automation/linari_rtadvanced/asset.contract.json
instrument.cytiva_nanoassemblrignite,CHEM-060,Microfluidic nanoparticle formulation system,Cytiva / Precision NanoSystems,NanoAssemblr Ignite,NanoAssemblr Ignite NIN0001微流控制备仪,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/cytiva_nanoassemblrignite,43,9,35,20,6,12,9,False,0.381,0.3527,0.38,assets/expansion_batch04/t5_automation/cytiva_nanoassemblrignite/model.glb,assets/expansion_batch04/t5_automation/cytiva_nanoassemblrignite/model.urdf,assets/expansion_batch04/t5_automation/cytiva_nanoassemblrignite/asset.contract.json
instrument.glatt_miniglatt,CHEM-061,Fluid-bed granulator / coater,Glatt,Mini-Glatt,Glatt Mini-Glatt2012流化床制粒包衣仪,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/glatt_miniglatt,54,12,33,21,4,12,9,False,0.7057,0.7587,0.84,assets/expansion_batch04/t5_automation/glatt_miniglatt/model.glb,assets/expansion_batch04/t5_automation/glatt_miniglatt/model.urdf,assets/expansion_batch04/t5_automation/glatt_miniglatt/asset.contract.json
instrument.quorum_q150tes,CHEM-062,Sputter & carbon coater,Quorum Technologies,Q150T ES Plus,Quorum Q150T ES Plus显微样品镀膜机,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/quorum_q150tes,52,7,28,18,6,10,10,False,0.585,0.5546,0.41,assets/expansion_batch04/t5_automation/quorum_q150tes/model.glb,assets/expansion_batch04/t5_automation/quorum_q150tes/model.urdf,assets/expansion_batch04/t5_automation/quorum_q150tes/asset.contract.json
instrument.laboao_cvdltf12p50,CHEM-063,Chemical vapour deposition system,LABOAO,CVD-LTF12P50,LABOAO CVD-LTF12P50单温区化学气相沉积系统,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/laboao_cvdltf12p50,110,10,34,16,6,12,10,False,1.9073,0.62,1.378,assets/expansion_batch04/t5_automation/laboao_cvdltf12p50/model.glb,assets/expansion_batch04/t5_automation/laboao_cvdltf12p50/model.urdf,assets/expansion_batch04/t5_automation/laboao_cvdltf12p50/asset.contract.json
instrument.arradiance_gemstarxt,CHEM-064,Atomic layer deposition system,Arradiance,GEMStar XT-SP (PEALD / thermal ALD),Arradiance GEMStar XT-SP单歧管PEALD/热ALD系统,Thin-Film & Functional Materials,assets/expansion_batch04/t5_automation/arradiance_gemstarxt,74,8,31,21,6,20,11,False,1.1576,0.6096,0.635,assets/expansion_batch04/t5_automation/arradiance_gemstarxt/model.glb,assets/expansion_batch04/t5_automation/arradiance_gemstarxt/model.urdf,assets/expansion_batch04/t5_automation/arradiance_gemstarxt/asset.contract.json
instrument.jasco_j1500,CHEM-065,Circular dichroism spectrometer,JASCO,J-1500,JASCO J-1500 150W标准PMT电子圆二色光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/jasco_j1500,60,2,25,18,6,9,11,False,1.055,0.6655,0.39,assets/expansion_batch04/t3_analytical/jasco_j1500/model.glb,assets/expansion_batch04/t3_analytical/jasco_j1500/model.urdf,assets/expansion_batch04/t3_analytical/jasco_j1500/asset.contract.json
instrument.bruker_minispecmq20,CHEM-066,Time-domain NMR relaxometer,Bruker,minispec mq20,Bruker minispec mq20时域核磁弛豫分析仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/bruker_minispecmq20,59,1,21,17,6,8,18,False,0.7492,0.787,0.356,assets/expansion_batch04/t3_analytical/bruker_minispecmq20/model.glb,assets/expansion_batch04/t3_analytical/bruker_minispecmq20/model.urdf,assets/expansion_batch04/t3_analytical/bruker_minispecmq20/asset.contract.json
instrument.jasco_fp8350,CHEM-067,Spectrofluorometer,JASCO,FP-8350,JASCO FP-8350 荧光分光光度计,Molecular Spectroscopy & Structure,assets/expansion_batch03/t3_analytical/jasco_fp8350,61,2,25,19,6,7,8,False,0.84,0.5663,0.27,assets/expansion_batch03/t3_analytical/jasco_fp8350/model.glb,assets/expansion_batch03/t3_analytical/jasco_fp8350/model.urdf,assets/expansion_batch03/t3_analytical/jasco_fp8350/asset.contract.json
instrument.magritek_spinsolve80,CHEM-068,Benchtop NMR spectrometer,Magritek,Spinsolve 80 Carbon,核磁共振结构光谱仪 — Magritek Spinsolve 80 Carbon,Molecular Spectroscopy & Structure,assets/basic40_batch02/t4_measure/magritek_spinsolve80,13,1,24,15,0,1,10,False,0.5814,0.4005,0.675,assets/basic40_batch02/t4_measure/magritek_spinsolve80/model.glb,assets/basic40_batch02/t4_measure/magritek_spinsolve80/model.urdf,assets/basic40_batch02/t4_measure/magritek_spinsolve80/asset.contract.json
instrument.bruker_magnettechesr5000,CHEM-069,Benchtop EPR spectrometer,Bruker,Magnettech ESR5000,Bruker Magnettech ESR5000 电子顺磁共振谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/bruker_magnettechesr5000,57,1,21,19,6,7,12,False,0.397,0.426,0.2032,assets/expansion_batch04/t3_analytical/bruker_magnettechesr5000/model.glb,assets/expansion_batch04/t3_analytical/bruker_magnettechesr5000/model.urdf,assets/expansion_batch04/t3_analytical/bruker_magnettechesr5000/asset.contract.json
instrument.jasco_p4200,CHEM-070,Digital polarimeter,JASCO,P-4200,JASCO P-4200 数字旋光仪,Molecular Spectroscopy & Structure,assets/expansion_batch03/t3_analytical/jasco_p4200,58,2,23,20,6,7,9,False,0.55,0.3582,0.21,assets/expansion_batch03/t3_analytical/jasco_p4200/model.glb,assets/expansion_batch03/t3_analytical/jasco_p4200/model.urdf,assets/expansion_batch03/t3_analytical/jasco_p4200/asset.contract.json
instrument.hach_dr6000,CHEM-071,UV-Vis spectrophotometer,Hach,DR6000,Hach DR6000 紫外可见分光光度计,Molecular Spectroscopy & Structure,assets/basic40_batch02/t3_analytical/hach_dr6000,14,1,14,13,1,1,7,False,0.5,0.46,0.215,assets/basic40_batch02/t3_analytical/hach_dr6000/model.glb,assets/basic40_batch02/t3_analytical/hach_dr6000/model.urdf,assets/basic40_batch02/t3_analytical/hach_dr6000/asset.contract.json
instrument.jasco_ftir4700,CHEM-072,FT-IR spectrometer,JASCO,FT/IR-4700,JASCO FT/IR-4700 傅里叶变换红外光谱仪,Molecular Spectroscopy & Structure,assets/basic40_batch02/t3_analytical/jasco_ftir4700,17,1,18,12,0,1,7,False,0.46,0.645,0.29,assets/basic40_batch02/t3_analytical/jasco_ftir4700/model.glb,assets/basic40_batch02/t3_analytical/jasco_ftir4700/model.urdf,assets/basic40_batch02/t3_analytical/jasco_ftir4700/asset.contract.json
instrument.jasco_nrs5500,CHEM-073,Raman microscope,JASCO,NRS-5500,JASCO NRS-5500 显微拉曼光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/jasco_nrs5500,61,4,26,23,6,7,8,False,1.15,0.89,0.67,assets/expansion_batch04/t3_analytical/jasco_nrs5500/model.glb,assets/expansion_batch04/t3_analytical/jasco_nrs5500/model.urdf,assets/expansion_batch04/t3_analytical/jasco_nrs5500/asset.contract.json
instrument.applied_sx20,CHEM-074,Stopped-flow kinetics spectrometer,Applied Photophysics,SX20,Applied Photophysics SX20 停流反应动力学光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/applied_sx20,63,6,30,19,6,9,9,False,1.2,0.5,0.5775,assets/expansion_batch04/t3_analytical/applied_sx20/model.glb,assets/expansion_batch04/t3_analytical/applied_sx20/model.urdf,assets/expansion_batch04/t3_analytical/applied_sx20/asset.contract.json
instrument.edinburgh_fls1000tcspc,CHEM-075,Time-resolved fluorescence (TCSPC) spectrometer,Edinburgh Instruments,FLS1000,Edinburgh Instruments FLS1000 TCSPC 时间分辨荧光寿命光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/edinburgh_fls1000tcspc,55,4,26,18,6,8,17,False,1.2,0.8,0.63,assets/expansion_batch04/t3_analytical/edinburgh_fls1000tcspc/model.glb,assets/expansion_batch04/t3_analytical/edinburgh_fls1000tcspc/model.urdf,assets/expansion_batch04/t3_analytical/edinburgh_fls1000tcspc/asset.contract.json
instrument.ultrafast_helios,CHEM-076,Femtosecond transient absorption spectrometer,Ultrafast Systems,HELIOS,Ultrafast Systems HELIOS 飞秒瞬态吸收光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/ultrafast_helios,56,4,25,17,6,6,13,False,1.5,0.85,0.66,assets/expansion_batch04/t3_analytical/ultrafast_helios/model.glb,assets/expansion_batch04/t3_analytical/ultrafast_helios/model.urdf,assets/expansion_batch04/t3_analytical/ultrafast_helios/asset.contract.json
instrument.jasco_fvs6000,CHEM-077,Vibrational circular dichroism spectrometer,JASCO,FVS-6000,JASCO FVS-6000 振动圆二色光���仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/jasco_fvs6000,74,4,32,22,6,10,12,False,0.945,0.67,0.425,assets/expansion_batch04/t3_analytical/jasco_fvs6000/model.glb,assets/expansion_batch04/t3_analytical/jasco_fvs6000/model.urdf,assets/expansion_batch04/t3_analytical/jasco_fvs6000/asset.contract.json
instrument.jasco_cpl300,CHEM-078,Circularly polarized luminescence spectrometer,JASCO,CPL-300,JASCO CPL-300 圆偏振发光光谱仪,Molecular Spectroscopy & Structure,assets/expansion_batch04/t3_analytical/jasco_cpl300,107,5,29,22,6,7,13,False,2.4,0.7,1.0,assets/expansion_batch04/t3_analytical/jasco_cpl300/model.glb,assets/expansion_batch04/t3_analytical/jasco_cpl300/model.urdf,assets/expansion_batch04/t3_analytical/jasco_cpl300/asset.contract.json
instrument.elementar_varioel,CHEM-079,Organic elemental (CHNS) analyzer,Elementar,vario EL cube,Elementar vario EL cube 有机元素分析仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/elementar_varioel,81,5,31,23,6,7,11,False,0.815,0.55,0.57,assets/expansion_batch04/t3_analytical/elementar_varioel/model.glb,assets/expansion_batch04/t3_analytical/elementar_varioel/model.urdf,assets/expansion_batch04/t3_analytical/elementar_varioel/asset.contract.json
instrument.shimadzu_tocl,CHEM-080,Total organic carbon analyzer,Shimadzu,TOC-L CSH,Shimadzu TOC-L CSH 总有机碳分析仪,Elemental & Mass Spectrometry,assets/expansion_batch03/t3_analytical/shimadzu_tocl,148,40,32,29,6,9,29,False,0.34,0.66,0.48,assets/expansion_batch03/t3_analytical/shimadzu_tocl/model.glb,assets/expansion_batch03/t3_analytical/shimadzu_tocl/model.urdf,assets/expansion_batch03/t3_analytical/shimadzu_tocl/asset.contract.json
instrument.jena_contraa800,CHEM-081,Atomic absorption spectrometer,Analytik Jena,contrAA 800 D,Analytik Jena contrAA 800 D 原子吸收光谱仪,Elemental & Mass Spectrometry,assets/expansion_batch03/t3_analytical/jena_contraa800,118,10,41,33,6,14,14,False,1.115,0.97,0.625,assets/expansion_batch03/t3_analytical/jena_contraa800/model.glb,assets/expansion_batch03/t3_analytical/jena_contraa800/model.urdf,assets/expansion_batch03/t3_analytical/jena_contraa800/asset.contract.json
instrument.shimadzu_icpe9800,CHEM-082,ICP optical emission spectrometer,Shimadzu,ICPE-9800,Shimadzu ICPE-9820 电感耦合等离子体发射光谱仪(9800系列),Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/shimadzu_icpe9800,97,3,36,33,6,9,83,False,1.3,0.72,0.91,assets/expansion_batch04/t3_analytical/shimadzu_icpe9800/model.glb,assets/expansion_batch04/t3_analytical/shimadzu_icpe9800/model.urdf,assets/expansion_batch04/t3_analytical/shimadzu_icpe9800/asset.contract.json
instrument.shimadzu_icpms2030,CHEM-083,ICP mass spectrometer,Shimadzu,ICPMS-2030,Shimadzu ICPMS-2030 电感耦合等离子体质谱仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/shimadzu_icpms2030,126,5,37,30,6,10,18,False,1.0133,0.645,0.857,assets/expansion_batch04/t3_analytical/shimadzu_icpms2030/model.glb,assets/expansion_batch04/t3_analytical/shimadzu_icpms2030/model.urdf,assets/expansion_batch04/t3_analytical/shimadzu_icpms2030/asset.contract.json
instrument.shimadzu_edx7200,CHEM-084,Energy-dispersive XRF spectrometer,Shimadzu,EDX-7200,Shimadzu EDX-7200 能量色散X射线荧光分析仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/shimadzu_edx7200,71,3,33,29,6,5,22,False,0.46,0.59,0.5775,assets/expansion_batch04/t3_analytical/shimadzu_edx7200/model.glb,assets/expansion_batch04/t3_analytical/shimadzu_edx7200/model.urdf,assets/expansion_batch04/t3_analytical/shimadzu_edx7200/asset.contract.json
instrument.jena_multix,CHEM-085,Total organic halogen (AOX/TOX) analyzer,Analytik Jena,multi X 2500,Analytik Jena multi X 2500 总有机卤素分析仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/jena_multix,132,8,38,37,6,11,84,False,1.4,0.55,0.671,assets/expansion_batch04/t3_analytical/jena_multix/model.glb,assets/expansion_batch04/t3_analytical/jena_multix/model.urdf,assets/expansion_batch04/t3_analytical/jena_multix/asset.contract.json
instrument.milestone_dma80,CHEM-086,Direct mercury analyzer,Milestone,DMA-80 evo,Milestone DMA-80 evo DoubleBeam 直接测汞仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/milestone_dma80,114,5,38,34,6,46,69,False,0.8,0.42,0.3,assets/expansion_batch04/t3_analytical/milestone_dma80/model.glb,assets/expansion_batch04/t3_analytical/milestone_dma80/model.urdf,assets/expansion_batch04/t3_analytical/milestone_dma80/asset.contract.json
instrument.stanford_rga100,CHEM-087,Residual gas analyzer,Stanford Research Systems,RGA100,Stanford Research Systems RGA100 残余气体质谱分析仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/stanford_rga100,99,2,40,34,13,7,327,False,0.215,0.5812,0.264,assets/expansion_batch04/t3_analytical/stanford_rga100/model.glb,assets/expansion_batch04/t3_analytical/stanford_rga100/model.urdf,assets/expansion_batch04/t3_analytical/stanford_rga100/asset.contract.json
instrument.thermo_orbitrapexploris,CHEM-088,High-resolution Orbitrap mass spectrometer,Thermo Fisher Scientific,Orbitrap Exploris 120,Thermo Fisher Scientific Orbitrap Exploris120 高分辨分子质谱仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/thermo_orbitrapexploris,119,4,37,37,9,14,100,False,0.534,0.939,0.703,assets/expansion_batch04/t3_analytical/thermo_orbitrapexploris/model.glb,assets/expansion_batch04/t3_analytical/thermo_orbitrapexploris/model.urdf,assets/expansion_batch04/t3_analytical/thermo_orbitrapexploris/asset.contract.json
instrument.leco_onh836,CHEM-089,Inert-gas fusion O/N/H analyzer,LECO,ONH836,LECO ONH836 惰气熔融氧氮氢分析仪,Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/leco_onh836,140,4,36,35,7,8,31,False,0.71,0.76,0.915,assets/expansion_batch04/t3_analytical/leco_onh836/model.glb,assets/expansion_batch04/t3_analytical/leco_onh836/model.urdf,assets/expansion_batch04/t3_analytical/leco_onh836/asset.contract.json
instrument.elementar_isoprimeprecision,CHEM-090,Stable isotope-ratio mass spectrometer,Elementar,isoprime precisION,稳定同位素比质谱仪Elementar isoprime precisION(标准通用收集器阵列,集成centrION),Elemental & Mass Spectrometry,assets/expansion_batch04/t3_analytical/elementar_isoprimeprecision,36,2,21,30,3,16,15,True,0.595,0.4607,0.65,assets/expansion_batch04/t3_analytical/elementar_isoprimeprecision/model.glb,assets/expansion_batch04/t3_analytical/elementar_isoprimeprecision/model.urdf,assets/expansion_batch04/t3_analytical/elementar_isoprimeprecision/asset.contract.json
instrument.agilent_gc8890b,CHEM-096,Gas chromatograph,Agilent,8890B GC,Agilent 8890B GC 气相色谱仪(单S/SL + FID迁移配置),Chromatography & Electrophoresis,assets/basic40_batch02/t3_analytical/agilent_gc8890b,52,50,22,55,3,1,9,False,0.5803,0.545,0.4905,assets/basic40_batch02/t3_analytical/agilent_gc8890b/model.glb,assets/basic40_batch02/t3_analytical/agilent_gc8890b/model.urdf,assets/basic40_batch02/t3_analytical/agilent_gc8890b/asset.contract.json
instrument.agilent_hplc1260,CHEM-097,HPLC system,Agilent,1260 Infinity III LC,高效液相色谱仪 Agilent | 1260 Infinity III LC,Chromatography & Electrophoresis,assets/basic40_batch02/t3_analytical/agilent_hplc1260,15,1,24,14,0,3,9,False,0.396,0.468,0.66,assets/basic40_batch02/t3_analytical/agilent_hplc1260/model.glb,assets/basic40_batch02/t3_analytical/agilent_hplc1260/model.urdf,assets/basic40_batch02/t3_analytical/agilent_hplc1260/asset.contract.json
instrument.thermo_dionexintegrion,CHEM-098,Ion chromatograph,Thermo Fisher Scientific,Dionex Integrion HPIC,Thermo Scientific Dionex Integrion HPIC 离子色谱仪,Chromatography & Electrophoresis,assets/expansion_batch03/t3_analytical/thermo_dionexintegrion,72,2,21,16,4,6,7,False,0.3,0.577,0.625,assets/expansion_batch03/t3_analytical/thermo_dionexintegrion/model.glb,assets/expansion_batch03/t3_analytical/thermo_dionexintegrion/model.urdf,assets/expansion_batch03/t3_analytical/thermo_dionexintegrion/asset.contract.json
instrument.agilent_1290infinity,CHEM-099,GPC/SEC system,Agilent,1290 Infinity II GPC/SEC,Agilent 1290 Infinity II GPC/SEC 凝胶渗透体积排阻色谱系统,Chromatography & Electrophoresis,assets/expansion_batch04/t3_analytical/agilent_1290infinity,166,3,25,18,4,14,8,False,0.4365,0.481,0.9,assets/expansion_batch04/t3_analytical/agilent_1290infinity/model.glb,assets/expansion_batch04/t3_analytical/agilent_1290infinity/model.urdf,assets/expansion_batch04/t3_analytical/agilent_1290infinity/asset.contract.json
instrument.gas_flavourspec25gc,CHEM-100,GC–ion mobility spectrometer,G.A.S.,FlavourSpec25 GC-IMS,G.A.S. FlavourSpec25 GC-IMS 离子迁移谱正交分离系统,Chromatography & Electrophoresis,assets/expansion_batch04/t3_analytical/gas_flavourspec25gc,200,4,29,20,4,65,5,False,1.01,0.8,0.79,assets/expansion_batch04/t3_analytical/gas_flavourspec25gc/model.glb,assets/expansion_batch04/t3_analytical/gas_flavourspec25gc/model.urdf,assets/expansion_batch04/t3_analytical/gas_flavourspec25gc/asset.contract.json
instrument.metrohm_omnis,CHEM-101,Automatic potentiometric titrator,Metrohm,OMNIS Professional Titrator,Metrohm OMNIS Professional Titrator 2.1001.0320 自动电位滴定仪,Electrochemistry & Titration,assets/basic40_batch02/t4_measure/metrohm_omnis,17,2,34,12,1,1,15,False,0.142,0.3996,0.358,assets/basic40_batch02/t4_measure/metrohm_omnis/model.glb,assets/basic40_batch02/t4_measure/metrohm_omnis/model.urdf,assets/basic40_batch02/t4_measure/metrohm_omnis/asset.contract.json
instrument.metrohm_899,CHEM-102,Karl Fischer coulometer,Metrohm,899 Coulometer,CHEM-102 卡尔费休水分滴定仪 · Metrohm 899 Coulometer,Electrochemistry & Titration,assets/basic40_batch02/t4_measure/metrohm_899,11,11,26,7,0,1,9,False,0.1436,0.2889,0.3373,assets/basic40_batch02/t4_measure/metrohm_899/model.glb,assets/basic40_batch02/t4_measure/metrohm_899/model.urdf,assets/basic40_batch02/t4_measure/metrohm_899/asset.contract.json
instrument.gamry_reference620,CHEM-103,Potentiostat / electrochemical workstation,Gamry,Reference 620,Gamry Reference 620 电化学工作站,Electrochemistry & Titration,assets/basic40_batch02/t4_measure/gamry_ref620,12,0,21,7,0,0,13,False,0.09,0.2744,0.19,assets/basic40_batch02/t4_measure/gamry_ref620/model.glb,assets/basic40_batch02/t4_measure/gamry_ref620/model.urdf,assets/basic40_batch02/t4_measure/gamry_ref620/asset.contract.json
instrument.ch_chi920d,CHEM-104,Scanning electrochemical microscope,CH Instruments,CHI920D,CH Instruments CHI920D 扫描电化学显微镜,Electrochemistry & Titration,assets/expansion_batch04/t4_measure/ch_chi920d,118,3,29,16,2,12,6,False,0.76,0.36,0.45,assets/expansion_batch04/t4_measure/ch_chi920d/model.glb,assets/expansion_batch04/t4_measure/ch_chi920d/model.urdf,assets/expansion_batch04/t4_measure/ch_chi920d/asset.contract.json
instrument.ch_chi440c,CHEM-105,Electrochemical quartz crystal microbalance,CH Instruments,CHI440C,CH Instruments CHI440C 电化学石英晶体微天平,Electrochemistry & Titration,assets/expansion_batch04/t4_measure/ch_chi440c,79,1,19,17,1,10,6,False,0.6,0.31,0.1247,assets/expansion_batch04/t4_measure/ch_chi440c/model.glb,assets/expansion_batch04/t4_measure/ch_chi440c/model.urdf,assets/expansion_batch04/t4_measure/ch_chi440c/asset.contract.json
instrument.knauer_k7400s,CHEM-106,Freezing-point osmometer,KNAUER,K-7400S,KNAUER K-7400S 冰点渗透压仪,Electrochemistry & Titration,assets/expansion_batch04/t4_measure/knauer_k7400s,77,2,24,17,2,6,6,False,0.1606,0.3434,0.228,assets/expansion_batch04/t4_measure/knauer_k7400s/model.glb,assets/expansion_batch04/t4_measure/knauer_k7400s/model.urdf,assets/expansion_batch04/t4_measure/knauer_k7400s/asset.contract.json
instrument.pine_wavevortex10,CHEM-107,Rotating ring-disk electrode rotator,Pine Research,WaveVortex 10,Pine Research WaveVortex 10旋转环盘驱动,Electrochemistry & Titration,assets/expansion_batch04/t4_measure/pine_wavevortex10,113,4,30,22,5,9,5,False,0.38,0.28,0.38,assets/expansion_batch04/t4_measure/pine_wavevortex10/model.glb,assets/expansion_batch04/t4_measure/pine_wavevortex10/model.urdf,assets/expansion_batch04/t4_measure/pine_wavevortex10/asset.contract.json
instrument.agilent_hs8697,CHEM-108,Headspace autosampler (48-vial tray),Agilent,8697,CHEM-108 Agilent 8697 顶空自动进样器(48 位托盘),Analytical Sampling & Interfaces,assets/basic40_batch02/t3_analytical/agilent_hs8697,141,1,24,13,1,60,7,False,0.599,0.73,0.8,assets/basic40_batch02/t3_analytical/agilent_hs8697/model.glb,assets/basic40_batch02/t3_analytical/agilent_hs8697/model.urdf,assets/basic40_batch02/t3_analytical/agilent_hs8697/asset.contract.json
instrument.teledyne_atomxxyz,CHEM-109,Purge-and-trap autosampler,Teledyne Tekmar,Atomx XYZ,Teledyne Tekmar Atomx XYZ 吹扫捕集自动进样系统,Analytical Sampling & Interfaces,assets/expansion_batch03/t3_analytical/teledyne_atomxxyz,443,7,25,20,2,97,7,False,0.701,0.5842,0.495,assets/expansion_batch03/t3_analytical/teledyne_atomxxyz/model.glb,assets/expansion_batch03/t3_analytical/teledyne_atomxxyz/model.urdf,assets/expansion_batch03/t3_analytical/teledyne_atomxxyz/asset.contract.json
instrument.teledyne_analyteexcite,CHEM-110,Laser ablation sampling system,Teledyne CETAC,Analyte Excite+,Teledyne CETAC Analyte Excite+ 激光剥蚀系统,Analytical Sampling & Interfaces,assets/expansion_batch03/t3_analytical/teledyne_analyteexcite,135,6,22,23,2,25,7,False,0.76,0.87,1.5,assets/expansion_batch03/t3_analytical/teledyne_analyteexcite/model.glb,assets/expansion_batch03/t3_analytical/teledyne_analyteexcite/model.urdf,assets/expansion_batch03/t3_analytical/teledyne_analyteexcite/asset.contract.json
instrument.frontier_egapy,CHEM-111,Multi-shot pyrolyzer (GC inlet),Frontier Laboratories,EGA/PY-3030D,Frontier EGA/PY-3030D 热裂解进样器,Analytical Sampling & Interfaces,assets/expansion_batch03/t3_analytical/frontier_egapy,101,4,22,22,0,21,9,False,0.3355,0.346,0.3935,assets/expansion_batch03/t3_analytical/frontier_egapy/model.glb,assets/expansion_batch03/t3_analytical/frontier_egapy/model.urdf,assets/expansion_batch03/t3_analytical/frontier_egapy/asset.contract.json
instrument.markes_unityxr,CHEM-112,Thermal desorber,Markes International,UNITY-xr,Markes UNITY-xr 热脱附进样器,Analytical Sampling & Interfaces,assets/expansion_batch03/t3_analytical/markes_unityxr,104,6,27,26,0,11,9,False,0.16,0.54,0.46,assets/expansion_batch03/t3_analytical/markes_unityxr/model.glb,assets/expansion_batch03/t3_analytical/markes_unityxr/model.urdf,assets/expansion_batch03/t3_analytical/markes_unityxr/asset.contract.json
instrument.antonpaar_surpass3,CHEM-113,Solid-surface streaming-potential analyzer,Anton Paar,SurPASS 3,Anton Paar SurPASS 3 固体表面流动电位分析仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_surpass3,137,7,29,25,1,15,7,False,0.5365,0.605,0.3508,assets/expansion_batch03/t4_measure/antonpaar_surpass3/model.glb,assets/expansion_batch03/t4_measure/antonpaar_surpass3/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_surpass3/asset.contract.json
instrument.antonpaar_ultrapyc5000,CHEM-114,Gas pycnometer (true density),Anton Paar,Ultrapyc 5000,Anton Paar Ultrapyc 5000 气体置换真密度仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_ultrapyc5000,122,6,33,25,4,9,9,False,0.3988,0.4895,0.25,assets/expansion_batch03/t4_measure/antonpaar_ultrapyc5000/model.glb,assets/expansion_batch03/t4_measure/antonpaar_ultrapyc5000/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_ultrapyc5000/asset.contract.json
instrument.antonpaar_autosorb6100,CHEM-115,Gas physisorption surface-area & pore analyzer,Anton Paar,Autosorb 6100,Anton Paar Autosorb 6100 气体物理吸附比表面积与孔径分析仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_autosorb6100,178,8,49,33,1,23,7,False,0.8056,0.712,1.079,assets/expansion_batch03/t4_measure/antonpaar_autosorb6100/model.glb,assets/expansion_batch03/t4_measure/antonpaar_autosorb6100/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_autosorb6100/asset.contract.json
instrument.antonpaar_poremaster60,CHEM-116,Mercury intrusion porosimeter,Anton Paar,PoreMaster 60,Anton Paar PoreMaster 60 标准型压汞孔隙率分析仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_poremaster60,121,7,27,28,1,12,10,False,0.5272,0.6665,0.7865,assets/expansion_batch03/t4_measure/antonpaar_poremaster60/model.glb,assets/expansion_batch03/t4_measure/antonpaar_poremaster60/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_poremaster60/asset.contract.json
instrument.antonpaar_litesizerdls,CHEM-117,DLS & zeta-potential analyzer,Anton Paar,Litesizer DLS 701,Anton Paar Litesizer DLS 701 动态光散射与胶体电位仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_litesizerdls,103,6,31,29,4,10,12,False,0.452,0.5115,0.135,assets/expansion_batch03/t4_measure/antonpaar_litesizerdls/model.glb,assets/expansion_batch03/t4_measure/antonpaar_litesizerdls/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_litesizerdls/asset.contract.json
instrument.antonpaar_psa1190,CHEM-118,Laser-diffraction particle sizer,Anton Paar,PSA 1190,Anton Paar PSA1190 L/D 激光衍射粒度仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_psa1190,248,9,31,28,1,16,15,False,0.895,0.547,0.4304,assets/expansion_batch03/t4_measure/antonpaar_psa1190/model.glb,assets/expansion_batch03/t4_measure/antonpaar_psa1190/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_psa1190/asset.contract.json
instrument.antonpaar_litesizerdia,CHEM-119,Dynamic image analyzer (particle shape),Anton Paar,Litesizer DIA 700,Anton Paar Litesizer DIA700 Liquid Flow 动态颗粒图像分析仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/antonpaar_litesizerdia,95,7,31,29,1,12,12,False,0.79,0.311,0.4,assets/expansion_batch03/t4_measure/antonpaar_litesizerdia/model.glb,assets/expansion_batch03/t4_measure/antonpaar_litesizerdia/model.urdf,assets/expansion_batch03/t4_measure/antonpaar_litesizerdia/asset.contract.json
instrument.biolin_sigma700,CHEM-120,Force tensiometer,Biolin Scientific,Sigma 700,Biolin Scientific Sigma700 力学式表面张力仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/biolin_sigma700,82,7,30,32,1,11,15,False,0.244,0.333,0.62,assets/expansion_batch03/t4_measure/biolin_sigma700/model.glb,assets/expansion_batch03/t4_measure/biolin_sigma700/model.urdf,assets/expansion_batch03/t4_measure/biolin_sigma700/asset.contract.json
instrument.biolin_thetaflex,CHEM-121,Optical contact-angle meter,Biolin Scientific,Theta Flex,Biolin Scientific Theta Flex 光学接触角测量仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/biolin_thetaflex,111,8,33,35,1,10,15,False,0.7665,0.2515,0.559,assets/expansion_batch03/t4_measure/biolin_thetaflex/model.glb,assets/expansion_batch03/t4_measure/biolin_thetaflex/model.urdf,assets/expansion_batch03/t4_measure/biolin_thetaflex/asset.contract.json
instrument.micromeritics_autochemiii,CHEM-122,Temperature-programmed chemisorption analyzer,Micromeritics,AutoChem III,Micromeritics AutoChem III 程序升温化学吸附仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/micromeritics_autochemiii,199,6,36,35,1,29,14,False,0.61,0.64,0.64,assets/expansion_batch03/t4_measure/micromeritics_autochemiii/model.glb,assets/expansion_batch03/t4_measure/micromeritics_autochemiii/model.urdf,assets/expansion_batch03/t4_measure/micromeritics_autochemiii/asset.contract.json
instrument.surface_dvsresolution,CHEM-123,Dynamic vapour sorption analyzer,Surface Measurement Systems,DVS Resolution,Surface Measurement Systems DVS Resolution 动态蒸气吸附仪(低质量天平),"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/surface_dvsresolution,211,6,40,37,4,11,12,False,0.52,0.61,0.98,assets/expansion_batch03/t4_measure/surface_dvsresolution/model.glb,assets/expansion_batch03/t4_measure/surface_dvsresolution/model.urdf,assets/expansion_batch03/t4_measure/surface_dvsresolution/asset.contract.json
instrument.freeman_ft4powder,CHEM-124,Powder rheometer,Freeman Technology / Micromeritics,FT4 Powder Rheometer,Freeman Technology / Micromeritics FT4 Powder Rheometer 粉体流动性流变仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/freeman_ft4powder,143,6,39,33,1,8,12,False,0.48,0.306,0.76,assets/expansion_batch03/t4_measure/freeman_ft4powder/model.glb,assets/expansion_batch03/t4_measure/freeman_ft4powder/model.urdf,assets/expansion_batch03/t4_measure/freeman_ft4powder/asset.contract.json
instrument.porometer_poroluxrevo,CHEM-125,Capillary flow porometer,POROMETER,POROLUX Revo,POROMETER POROLUX Revo 毛细流动孔径仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/porometer_poroluxrevo,129,3,28,33,1,8,13,False,0.53,0.53,0.755,assets/expansion_batch03/t4_measure/porometer_poroluxrevo/model.glb,assets/expansion_batch03/t4_measure/porometer_poroluxrevo/model.urdf,assets/expansion_batch03/t4_measure/porometer_poroluxrevo/asset.contract.json
instrument.microtrac_turbiscanlab,CHEM-126,Dispersion stability analyzer,Microtrac,TURBISCAN LAB,Microtrac TURBISCAN LAB 分散体系稳定性分析仪,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/microtrac_turbiscanlab,118,5,28,27,3,6,19,False,0.26,0.28,0.25,assets/expansion_batch03/t4_measure/microtrac_turbiscanlab/model.glb,assets/expansion_batch03/t4_measure/microtrac_turbiscanlab/model.urdf,assets/expansion_batch03/t4_measure/microtrac_turbiscanlab/asset.contract.json
instrument.biolin_mediuml,CHEM-127,Langmuir / Langmuir–Blodgett trough,Biolin Scientific KSV NIMA,Medium L&LB Trough,KSV NIMA Medium L&LB Langmuir 单分子膜槽,"Particles, Pores & Interfaces",assets/expansion_batch03/t4_measure/biolin_mediuml,124,7,36,34,2,8,15,False,0.662,0.308,0.455,assets/expansion_batch03/t4_measure/biolin_mediuml/model.glb,assets/expansion_batch03/t4_measure/biolin_mediuml/model.urdf,assets/expansion_batch03/t4_measure/biolin_mediuml/asset.contract.json
instrument.antonpaar_trb,CHEM-128,Pin-on-disk tribometer,Anton Paar,TRB³,Anton Paar TRB³ 销盘摩擦磨损试验机,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/antonpaar_trb,155,6,42,39,0,7,13,False,0.532,0.443,0.501,assets/expansion_batch04/t1_thermal/antonpaar_trb/model.glb,assets/expansion_batch04/t1_thermal/antonpaar_trb/model.urdf,assets/expansion_batch04/t1_thermal/antonpaar_trb/asset.contract.json
instrument.antonpaar_rst300,CHEM-129,Coating scratch tester,Anton Paar,RST 300,Anton Paar RST 300 涂层划痕附着力试验机,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/antonpaar_rst300,168,6,42,38,0,6,13,False,0.364,0.369,0.5425,assets/expansion_batch04/t1_thermal/antonpaar_rst300/model.glb,assets/expansion_batch04/t1_thermal/antonpaar_rst300/model.urdf,assets/expansion_batch04/t1_thermal/antonpaar_rst300/asset.contract.json
instrument.antonpaar_hit300,CHEM-130,Nanoindentation tester,Anton Paar,HIT 300,Anton Paar HIT 300 纳米压痕仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/antonpaar_hit300,156,6,38,33,2,7,17,False,0.269,0.259,0.42,assets/expansion_batch04/t1_thermal/antonpaar_hit300/model.glb,assets/expansion_batch04/t1_thermal/antonpaar_hit300/model.urdf,assets/expansion_batch04/t1_thermal/antonpaar_hit300/asset.contract.json
instrument.ta_dsc2500,CHEM-131,Differential scanning calorimeter,TA Instruments,DSC 2500,TA Instruments DSC 2500 差示扫描量热仪,"Thermal, Mechanical & Transport",assets/expansion_batch03/t1_thermal/ta_dsc2500,307,5,43,36,1,13,89,False,0.53,0.51,0.61,assets/expansion_batch03/t1_thermal/ta_dsc2500/model.glb,assets/expansion_batch03/t1_thermal/ta_dsc2500/model.urdf,assets/expansion_batch03/t1_thermal/ta_dsc2500/asset.contract.json
instrument.ta_tga5500,CHEM-132,Thermogravimetric analyzer,TA Instruments,TGA 5500,TA Instruments TGA 5500 热重分析仪,"Thermal, Mechanical & Transport",assets/expansion_batch03/t1_thermal/ta_tga5500,186,4,48,40,2,13,10,False,0.56,0.56,0.61,assets/expansion_batch03/t1_thermal/ta_tga5500/model.glb,assets/expansion_batch03/t1_thermal/ta_tga5500/model.urdf,assets/expansion_batch03/t1_thermal/ta_tga5500/asset.contract.json
instrument.ta_dma850,CHEM-133,Dynamic mechanical analyzer,TA Instruments,DMA 850,TA Instruments DMA 850 动态机械分析仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/ta_dma850,121,5,43,41,2,10,22,False,0.64,0.47,0.535,assets/expansion_batch04/t1_thermal/ta_dma850/model.glb,assets/expansion_batch04/t1_thermal/ta_dma850/model.urdf,assets/expansion_batch04/t1_thermal/ta_dma850/asset.contract.json
instrument.ta_tma450,CHEM-134,Thermomechanical analyzer,TA Instruments,TMA 450,TA Instruments TMA 450 热机械分析仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/ta_tma450,107,3,50,47,2,10,13,False,0.56,0.56,0.63,assets/expansion_batch04/t1_thermal/ta_tma450/model.glb,assets/expansion_batch04/t1_thermal/ta_tma450/model.urdf,assets/expansion_batch04/t1_thermal/ta_tma450/asset.contract.json
instrument.netzsch_lfa467,CHEM-135,Laser/light flash thermal diffusivity analyzer,NETZSCH,LFA 467 HyperFlash,NETZSCH LFA467 HyperFlash 闪光法热扩��仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/netzsch_lfa467,133,4,54,47,6,14,20,False,0.54,0.52,0.61,assets/expansion_batch04/t1_thermal/netzsch_lfa467/model.glb,assets/expansion_batch04/t1_thermal/netzsch_lfa467/model.urdf,assets/expansion_batch04/t1_thermal/netzsch_lfa467/asset.contract.json
instrument.hot_tps2500,CHEM-136,Transient plane source thermal-conductivity analyzer,Hot Disk,TPS 2500 S,Hot Disk TPS 2500 S 瞬态平面热源导热仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/hot_tps2500,47,4,25,25,1,6,13,False,0.6975,0.5663,0.325,assets/expansion_batch04/t1_thermal/hot_tps2500/model.glb,assets/expansion_batch04/t1_thermal/hot_tps2500/model.urdf,assets/expansion_batch04/t1_thermal/hot_tps2500/asset.contract.json
instrument.antonpaar_mcr503,CHEM-137,Rotational & oscillatory rheometer,Anton Paar,MCR 503,Anton Paar MCR 503 旋转与振荡流变仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/antonpaar_mcr503,51,3,26,28,1,8,8,False,0.453,0.673,0.775,assets/expansion_batch04/t1_thermal/antonpaar_mcr503/model.glb,assets/expansion_batch04/t1_thermal/antonpaar_mcr503/model.urdf,assets/expansion_batch04/t1_thermal/antonpaar_mcr503/asset.contract.json
instrument.ta_tamiv,CHEM-138,Isothermal microcalorimeter,TA Instruments,TAM IV,TA Instruments TAM IV 20 mL 等温微量热仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/ta_tamiv,52,2,25,31,0,8,10,False,0.58,0.76,1.0,assets/expansion_batch04/t1_thermal/ta_tamiv/model.glb,assets/expansion_batch04/t1_thermal/ta_tamiv/model.urdf,assets/expansion_batch04/t1_thermal/ta_tamiv/asset.contract.json
instrument.linseis_lsr3,CHEM-139,Thermoelectric (Seebeck) tester,Linseis,LSR-3,Linseis LSR-3 红外炉800°C热电性能测试仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/linseis_lsr3,57,5,32,31,2,12,11,False,0.7204,0.4278,0.53,assets/expansion_batch04/t1_thermal/linseis_lsr3/model.glb,assets/expansion_batch04/t1_thermal/linseis_lsr3/model.urdf,assets/expansion_batch04/t1_thermal/linseis_lsr3/asset.contract.json
instrument.novocontrol_alphat,CHEM-140,Broadband dielectric spectrometer,Novocontrol Technologies,Alpha-T,Novocontrol Alpha-T Rev C 宽频介电谱仪(含电流转换接口),"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/novocontrol_alphat,48,3,27,30,0,12,13,False,0.6815,0.364,0.205,assets/expansion_batch04/t1_thermal/novocontrol_alphat/model.glb,assets/expansion_batch04/t1_thermal/novocontrol_alphat/model.urdf,assets/expansion_batch04/t1_thermal/novocontrol_alphat/asset.contract.json
instrument.lakeshore_measurereadym91,CHEM-141,Hall-effect measurement system,Lake Shore Cryotronics,MeasureReady M91 FastHall,Lake Shore MeasureReady M91 FastHall 霍尔测量控制器,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/lakeshore_measurereadym91,64,4,36,31,1,17,11,False,0.343,0.369,0.087,assets/expansion_batch04/t1_thermal/lakeshore_measurereadym91/model.glb,assets/expansion_batch04/t1_thermal/lakeshore_measurereadym91/model.urdf,assets/expansion_batch04/t1_thermal/lakeshore_measurereadym91/asset.contract.json
instrument.signatone_quadpro2,CHEM-142,Automated four-point-probe sheet-resistance mapper,Signatone,QuadPro2,Signatone QuadPro2-DAC0 自动四探针面电阻测绘系统,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/signatone_quadpro2,99,5,34,29,2,16,13,False,0.572,0.978,1.676,assets/expansion_batch04/t1_thermal/signatone_quadpro2/model.glb,assets/expansion_batch04/t1_thermal/signatone_quadpro2/model.urdf,assets/expansion_batch04/t1_thermal/signatone_quadpro2/asset.contract.json
instrument.lakeshore_8604vsm,CHEM-143,Vibrating sample magnetometer,Lake Shore Cryotronics,8604 VSM,Lake Shore 8604 振动样品磁强计,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/lakeshore_8604vsm,106,5,34,32,2,14,14,False,2.175,1.04,1.6,assets/expansion_batch04/t1_thermal/lakeshore_8604vsm/model.glb,assets/expansion_batch04/t1_thermal/lakeshore_8604vsm/model.urdf,assets/expansion_batch04/t1_thermal/lakeshore_8604vsm/asset.contract.json
instrument.shimadzu_ags10knxd,CHEM-144,Universal testing machine,Shimadzu,AGS-10kNXD,Shimadzu AGS-10kNXD 万能材料试验机,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/shimadzu_ags10knxd,85,6,35,28,2,14,12,False,0.653,0.52,1.603,assets/expansion_batch04/t1_thermal/shimadzu_ags10knxd/model.glb,assets/expansion_batch04/t1_thermal/shimadzu_ags10knxd/model.urdf,assets/expansion_batch04/t1_thermal/shimadzu_ags10knxd/asset.contract.json
instrument.zwick_hit5p,CHEM-145,Pendulum impact tester,ZwickRoell,HIT5P,ZwickRoell HIT5P 摆锤冲击试验机,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/zwick_hit5p,73,4,31,27,2,13,12,False,0.68,0.429,0.684,assets/expansion_batch04/t1_thermal/zwick_hit5p/model.glb,assets/expansion_batch04/t1_thermal/zwick_hit5p/model.urdf,assets/expansion_batch04/t1_thermal/zwick_hit5p/asset.contract.json
instrument.zwick_mflow,CHEM-146,Melt flow indexer,ZwickRoell,Mflow,ZwickRoell Mflow 熔体流动速率仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/zwick_mflow,63,9,43,36,3,14,12,False,0.479,0.524,0.548,assets/expansion_batch04/t1_thermal/zwick_mflow/model.glb,assets/expansion_batch04/t1_thermal/zwick_mflow/model.urdf,assets/expansion_batch04/t1_thermal/zwick_mflow/asset.contract.json
instrument.ametek_oxtran,CHEM-147,Oxygen transmission-rate analyzer,AMETEK MOCON,OX-TRAN 2/22 L,AMETEK MOCON OX-TRAN 2/22 L 氧气透过率分析仪,"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/ametek_oxtran,75,8,55,31,5,14,13,False,0.3046,0.6149,0.5008,assets/expansion_batch04/t1_thermal/ametek_oxtran/model.glb,assets/expansion_batch04/t1_thermal/ametek_oxtran/model.urdf,assets/expansion_batch04/t1_thermal/ametek_oxtran/asset.contract.json
instrument.netzsch_mmc315,CHEM-148,Adiabatic (ARC) reaction calorimeter,NETZSCH,MMC 315 Nexus,NETZSCH MMC 315 Nexus 多模块量热仪(ARC模块),"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/netzsch_mmc315,40,3,30,24,4,10,15,False,0.62,0.594,0.55,assets/expansion_batch04/t1_thermal/netzsch_mmc315/model.glb,assets/expansion_batch04/t1_thermal/netzsch_mmc315/model.urdf,assets/expansion_batch04/t1_thermal/netzsch_mmc315/asset.contract.json
instrument.mt_rc1mxhfcal,CHEM-149,Heat-flow reaction calorimeter,METTLER TOLEDO,RC1mx + HFCal,METTLER TOLEDO RC1mx + HFCal 热流式反应量热系统(标准转矩搅拌器),"Thermal, Mechanical & Transport",assets/expansion_batch04/t1_thermal/mt_rc1mxhfcal,92,5,57,37,5,12,17,False,0.951,0.705,1.1805,assets/expansion_batch04/t1_thermal/mt_rc1mxhfcal/model.glb,assets/expansion_batch04/t1_thermal/mt_rc1mxhfcal/model.urdf,assets/expansion_batch04/t1_thermal/mt_rc1mxhfcal/asset.contract.json
instrument.ika_c6000,CHEM-150,Oxygen bomb calorimeter,IKA,C 6000 isoperibol,IKA C 6000 isoperibol 氧弹量热仪(Package 2/12:C 6000主机+C 6012耐卤素氧弹),"Thermal, Mechanical & Transport",assets/expansion_batch03/t1_thermal/ika_c6000,60,3,43,44,3,16,18,False,0.5053,0.4768,0.4253,assets/expansion_batch03/t1_thermal/ika_c6000/model.glb,assets/expansion_batch03/t1_thermal/ika_c6000/model.urdf,assets/expansion_batch03/t1_thermal/ika_c6000/asset.contract.json
instrument.jeol_jsmit200,CHEM-151,Scanning electron microscope,JEOL,JSM-IT200 LA,JEOL JSM-IT200 LA 扫描电子显微镜(InTouchScope,集成JED-2300 EDS,含机械泵与选配操作台),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/jeol_jsmit200,102,12,64,48,7,13,22,False,1.537,1.1635,1.48,assets/expansion_batch04/t3_analytical/jeol_jsmit200/model.glb,assets/expansion_batch04/t3_analytical/jeol_jsmit200/model.urdf,assets/expansion_batch04/t3_analytical/jeol_jsmit200/asset.contract.json
instrument.jeol_jem1400flash,CHEM-152,Transmission electron microscope,JEOL,JEM-1400Flash,JEOL JEM-1400Flash HR 透射电子显微镜(120kV钨灯丝、HR极靴、Matataki Flash sCMOS相机,含电源柜、后控制台与机械泵),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/jeol_jem1400flash,82,21,77,59,7,9,28,False,2.625,2.2643,2.4921,assets/expansion_batch04/t3_analytical/jeol_jem1400flash/model.glb,assets/expansion_batch04/t3_analytical/jeol_jem1400flash/model.urdf,assets/expansion_batch04/t3_analytical/jeol_jem1400flash/asset.contract.json
instrument.antonpaar_saxspace,CHEM-153,Small-angle X-ray scattering system,Anton Paar,SAXSpace,Anton Paar SAXSpace 小角/广角X射线散射仪(Cu密封管、Kratky块线/点准直、TCStage、MYTHEN2 R 1K探测器2θ臂、ASX自动进样器,含实验桌与柜体),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/antonpaar_saxspace,72,13,76,54,11,13,25,False,1.8,0.922,1.685,assets/expansion_batch04/t3_analytical/antonpaar_saxspace/model.glb,assets/expansion_batch04/t3_analytical/antonpaar_saxspace/model.urdf,assets/expansion_batch04/t3_analytical/antonpaar_saxspace/asset.contract.json
instrument.kratos_axissupra,CHEM-154,X-ray photoelectron spectrometer,Kratos / Shimadzu,AXIS Supra+,Kratos / Shimadzu AXIS Supra+ 成像X射线光电子能谱仪(单色Al Kα、半球+球面镜分析器、DLD、电子中和器、Minibeam 4离子枪、Flexi-lock 3架仓、五轴样品台,含冷水机与ESCApe工作站),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/kratos_axissupra,66,10,67,49,8,10,22,False,2.77,2.064,1.97,assets/expansion_batch04/t3_analytical/kratos_axissupra/model.glb,assets/expansion_batch04/t3_analytical/kratos_axissupra/model.urdf,assets/expansion_batch04/t3_analytical/kratos_axissupra/asset.contract.json
instrument.keyence_vkx3000,CHEM-155,3D laser-scanning profilometer microscope,KEYENCE,VK-X3000 / VK-X3100,KEYENCE VK-X3000三维光学表面轮廓显微镜(VK-X3000控制器、VK-X3100测量头、VK-D3电动底座,含显示器与电脑工作站),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/keyence_vkx3000,62,7,51,38,9,9,21,False,1.386,0.5385,0.471,assets/expansion_batch04/t3_analytical/keyence_vkx3000/model.glb,assets/expansion_batch04/t3_analytical/keyence_vkx3000/model.urdf,assets/expansion_batch04/t3_analytical/keyence_vkx3000/asset.contract.json
instrument.bruker_x4poseidon,CHEM-156,Micro X-ray computed tomography,Bruker,X4 POSEIDON,Bruker X4 POSEIDON台式三维X射线显微镜/微米CT(反射源基本配置:反射式X射线源、7 MP平板探测器、标准旋转台、固定扫描几何、7位滤片转换器,含工作站),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/bruker_x4poseidon,51,7,60,46,7,7,16,False,1.8855,0.622,0.722,assets/expansion_batch04/t3_analytical/bruker_x4poseidon/model.glb,assets/expansion_batch04/t3_analytical/bruker_x4poseidon/model.urdf,assets/expansion_batch04/t3_analytical/bruker_x4poseidon/asset.contract.json
instrument.ja_alphase,CHEM-157,Spectroscopic ellipsometer,J.A. Woollam,alpha-SE,J.A. Woollam alpha-SE光谱椭偏仪(2015规格:旋转补偿器+CCD,380–900 nm 180个波长,入射角65/70/75°与90°直通,手动换角,电动Z对准,真空吸盘,选配液池;含操作电脑),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/ja_alphase,49,5,39,37,5,7,16,False,1.23,0.485,0.434,assets/expansion_batch04/t3_analytical/ja_alphase/model.glb,assets/expansion_batch04/t3_analytical/ja_alphase/model.urdf,assets/expansion_batch04/t3_analytical/ja_alphase/asset.contract.json
instrument.park_nx10,CHEM-158,Atomic force microscope,Park Systems,NX10,Park Systems NX10原子力显微镜(2024宣传册配置:50×50 µm闭环XY扫描器、15 µm Z扫描器、20×20 mm XY台、25 mm Z台、15 mm聚焦台、10×同轴光学、SLD光束检测;接触/True Non-Contact/轻敲、相位成像、力-距离谱、热调谐;含控制电子单元),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/park_nx10,51,12,54,56,2,7,12,False,0.776,0.5107,0.443,assets/expansion_batch04/t3_analytical/park_nx10/model.glb,assets/expansion_batch04/t3_analytical/park_nx10/model.urdf,assets/expansion_batch04/t3_analytical/park_nx10/asset.contract.json
instrument.nanosurf_naiostm,CHEM-159,Scanning tunneling microscope,Nanosurf,NaioSTM,Nanosurf NaioSTM扫描隧道显微镜(花岗岩隔振台上的扫描头、500×500×200 nm扫描器、stick-slip自动进针、0.1–100 nA电流放大器、±10 V针尖电压、恒流/恒高成像、I-V与I-z谱、10×放大罩;含台下控制器),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/nanosurf_naiostm,28,3,36,52,1,7,11,False,0.204,0.204,0.104,assets/expansion_batch04/t3_analytical/nanosurf_naiostm/model.glb,assets/expansion_batch04/t3_analytical/nanosurf_naiostm/model.urdf,assets/expansion_batch04/t3_analytical/nanosurf_naiostm/asset.contract.json
instrument.rigaku_miniflex600_external_cooling,CHEM-160,Powder X-ray diffractometer,Rigaku,MiniFlex600,Rigaku MiniFlex600 粉末X射线衍射仪(外置循环水),"Microscopy, Imaging & Diffraction",assets/basic40_batch02/t4_measure/rigaku_miniflex600,13,3,25,12,0,1,12,False,0.6205,0.456,0.722,assets/basic40_batch02/t4_measure/rigaku_miniflex600/model.glb,assets/basic40_batch02/t4_measure/rigaku_miniflex600/model.urdf,assets/basic40_batch02/t4_measure/rigaku_miniflex600/asset.contract.json
instrument.rigaku_xtalabsynergy,CHEM-161,Single-crystal X-ray diffractometer,Rigaku Oxford Diffraction,XtaLAB Synergy-R,Rigaku XtaLAB Synergy-R单晶X射线衍射仪(HyPix-6000HE配置:PhotonJet-R转靶光源、1–10 mrad电动狭缝、κ测角仪与伸缩2θ臂、HyPix-6000HE混合光子计数探测器、两扇铰链前门与电气安全回路、Oxford Cryostream 1000),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/rigaku_xtalabsynergy,77,11,44,55,8,8,16,False,1.3012,0.914,1.875,assets/expansion_batch04/t3_analytical/rigaku_xtalabsynergy/model.glb,assets/expansion_batch04/t3_analytical/rigaku_xtalabsynergy/model.urdf,assets/expansion_batch04/t3_analytical/rigaku_xtalabsynergy/asset.contract.json
instrument.evident_bx53p,CHEM-162,Polarizing microscope,Evident / Olympus,BX53-P,Evident / Olympus BX53-P偏光显微镜(锥光/正交配置:U-CPA勃氏镜、U-AN360P检偏镜、U-POC-2偏光聚光镜、U-SRP旋转台、四孔物镜转盘、倾斜三目筒),"Microscopy, Imaging & Diffraction",assets/expansion_batch04/t3_analytical/evident_bx53p,50,14,47,34,1,7,13,False,0.282,0.5124,0.534,assets/expansion_batch04/t3_analytical/evident_bx53p/model.glb,assets/expansion_batch04/t3_analytical/evident_bx53p/model.urdf,assets/expansion_batch04/t3_analytical/evident_bx53p/asset.contract.json
instrument.biotek_405ts,CHEM-163,Microplate washer,Agilent BioTek,405 TS (96-tube manifold),Agilent BioTek 405 TS微孔板洗板机(单96管洗头,内置四路缓冲切换A–D,标准SBS载板),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/biotek_405ts,25,3,36,26,2,12,17,False,0.3556,0.4318,0.254,assets/expansion_batch04/t4_measure/biotek_405ts/model.glb,assets/expansion_batch04/t4_measure/biotek_405ts/model.urdf,assets/expansion_batch04/t4_measure/biotek_405ts/asset.contract.json
instrument.biorad_miniprotean,CHEM-164,Gel electrophoresis system,Bio-Rad,Mini-PROTEAN Tetra + power supply,Bio-Rad Mini-PROTEAN Tetra垂直电泳槽(电极模块,可加陪伴模块运行1–4块胶)+ PowerPac Basic电源,Biochemical & Wet-Chemistry Assays,assets/expansion_batch03/t4_measure/biorad_miniprotean,40,8,36,37,1,11,17,False,0.41,0.289,0.1993,assets/expansion_batch03/t4_measure/biorad_miniprotean/model.glb,assets/expansion_batch03/t4_measure/biorad_miniprotean/model.urdf,assets/expansion_batch03/t4_measure/biorad_miniprotean/asset.contract.json
instrument.thermo_ibrightfl1500,CHEM-165,Gel & blot imager,Thermo Fisher Scientific,iBright FL1500,Thermo Fisher Invitrogen iBright FL1500凝胶与印迹成像系统(产品册配置),Biochemical & Wet-Chemistry Assays,assets/expansion_batch03/t4_measure/thermo_ibrightfl1500,19,3,24,32,2,5,10,False,0.38,0.68,0.6,assets/expansion_batch03/t4_measure/thermo_ibrightfl1500/model.glb,assets/expansion_batch03/t4_measure/thermo_ibrightfl1500/model.urdf,assets/expansion_batch03/t4_measure/thermo_ibrightfl1500/asset.contract.json
instrument.eppendorf_cellxpertc170i,CHEM-166,CO₂ cell-culture incubator,Eppendorf,CellXpert C170i,Eppendorf CellXpert C170i CO2细胞培养箱(O2 1–20 %、湿度与水位选件),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/eppendorf_cellxpertc170i,39,5,57,46,2,14,18,True,0.72,0.7153,0.9,assets/expansion_batch04/t4_measure/eppendorf_cellxpertc170i/model.glb,assets/expansion_batch04/t4_measure/eppendorf_cellxpertc170i/model.urdf,assets/expansion_batch04/t4_measure/eppendorf_cellxpertc170i/asset.contract.json
instrument.biorad_cfxopus,CHEM-167,Real-time qPCR system,Bio-Rad,CFX Opus 96,Bio-Rad CFX Opus 96实时荧光定量PCR仪(12011319),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/biorad_cfxopus,28,3,40,35,5,7,14,True,0.33,0.5608,0.36,assets/expansion_batch04/t4_measure/biorad_cfxopus/model.glb,assets/expansion_batch04/t4_measure/biorad_cfxopus/model.urdf,assets/expansion_batch04/t4_measure/biorad_cfxopus/asset.contract.json
instrument.bd_facsariaiii,CHEM-168,Flow cytometer & cell sorter,BD Biosciences,FACSAria III,BD FACSAria III流式细胞分选仪(2018规格,四激光),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/bd_facsariaiii,46,10,105,69,3,17,18,True,2.135,0.7286,0.71,assets/expansion_batch04/t4_measure/bd_facsariaiii/model.glb,assets/expansion_batch04/t4_measure/bd_facsariaiii/model.urdf,assets/expansion_batch04/t4_measure/bd_facsariaiii/asset.contract.json
instrument.malvern_microcalpeaq,CHEM-169,Isothermal titration calorimeter,Malvern Panalytical,MicroCal PEAQ-ITC,MicroCal PEAQ-ITC等温滴定量热仪(标准型,含洗涤模块),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/malvern_microcalpeaq,55,5,58,45,2,17,17,True,0.43,0.377,0.3688,assets/expansion_batch04/t4_measure/malvern_microcalpeaq/model.glb,assets/expansion_batch04/t4_measure/malvern_microcalpeaq/model.urdf,assets/expansion_batch04/t4_measure/malvern_microcalpeaq/asset.contract.json
instrument.cytiva_biacoret200,CHEM-170,Surface plasmon resonance system,Cytiva,Biacore T200,Biacore T200表面等离子共振生物传感器(处理单元),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/cytiva_biacoret200,56,7,66,64,5,11,20,True,0.6,0.615,0.69,assets/expansion_batch04/t4_measure/cytiva_biacoret200/model.glb,assets/expansion_batch04/t4_measure/cytiva_biacoret200/model.urdf,assets/expansion_batch04/t4_measure/cytiva_biacoret200/asset.contract.json
instrument.wtw_oxitopi,CHEM-171,Respirometric BOD system,WTW (Xylem),OxiTop-i,生化需氧量呼吸测定系统WTW OxiTop-i IS 6(6测头、PF 600瓶、IS 6感应搅拌台),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/wtw_oxitopi,96,30,45,33,24,13,19,True,0.265,0.1966,0.2556,assets/expansion_batch04/t4_measure/wtw_oxitopi/model.glb,assets/expansion_batch04/t4_measure/wtw_oxitopi/model.urdf,assets/expansion_batch04/t4_measure/wtw_oxitopi/asset.contract.json
instrument.seal_aa500,CHEM-172,Segmented continuous-flow analyzer,SEAL Analytical,AA500,分段连续流动分析仪SEAL AA500(4通道营养盐:NOx、氨、磷酸盐、硅酸盐;带AS2 XY进样器),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/seal_aa500,66,11,29,40,1,20,17,True,1.405,0.479,0.409,assets/expansion_batch04/t4_measure/seal_aa500/model.glb,assets/expansion_batch04/t4_measure/seal_aa500/model.urdf,assets/expansion_batch04/t4_measure/seal_aa500/asset.contract.json
instrument.bmg_clariostarplus,CHEM-173,Multi-mode microplate reader,BMG LABTECH,CLARIOstar Plus,多模式微孔板读板仪BMG LABTECH CLARIOstar Plus(光谱仪吸光、LVF单色器荧光、偏振、发光,两个注射泵),Biochemical & Wet-Chemistry Assays,assets/expansion_batch04/t4_measure/bmg_clariostarplus,28,5,22,37,2,7,11,True,0.4512,0.5168,0.401,assets/expansion_batch04/t4_measure/bmg_clariostarplus/model.glb,assets/expansion_batch04/t4_measure/bmg_clariostarplus/model.urdf,assets/expansion_batch04/t4_measure/bmg_clariostarplus/asset.contract.json
instrument.mt_quantos_q2_xpe206dr,CHEM-174,Automated powder dosing system,METTLER TOLEDO,Quantos Q2 + XPE206DR,自动粉末定量分配仪 — METTLER TOLEDO Quantos Q2 + XPE206DR,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/mt_quantos_q2,18,3,20,12,0,1,12,False,0.263,0.542,0.495,assets/basic40_batch02/t5_automation/mt_quantos_q2/model.glb,assets/basic40_batch02/t5_automation/mt_quantos_q2/model.urdf,assets/basic40_batch02/t5_automation/mt_quantos_q2/asset.contract.json
instrument.opentrons_flex_single_5_1000ul,CHEM-175,Automated liquid-handling robot,Opentrons,Flex (1-channel 5–1000 µL),自动移液工作站 — Opentrons Flex 单通道5–1000 µL,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/opentrons_flex,28,4,15,10,0,16,8,False,0.87,0.6907,0.84,assets/basic40_batch02/t5_automation/opentrons_flex/model.glb,assets/basic40_batch02/t5_automation/opentrons_flex/model.urdf,assets/basic40_batch02/t5_automation/opentrons_flex/asset.contract.json
instrument.azenta_automated_roll_heat_sealer_a4s,CHEM-176,Automated microplate heat sealer,Azenta Life Sciences,Automated Roll Heat Sealer (a4S),自动微孔板热封膜机,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/azenta_heat_sealer,17,1,22,9,1,1,5,False,0.2312,0.5075,0.403,assets/basic40_batch02/t5_automation/azenta_heat_sealer/model.glb,assets/basic40_batch02/t5_automation/azenta_heat_sealer/model.urdf,assets/basic40_batch02/t5_automation/azenta_heat_sealer/asset.contract.json
instrument.azenta_intellixcap_s1_46_0001,CHEM-177,Automated tube decapper/recapper,Azenta Life Sciences,IntelliXcap S1 46-0001,自动开盖封盖机,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/azenta_intellixcap_s1,10,8,13,6,0,1,11,False,0.17,0.24,0.3,assets/basic40_batch02/t5_automation/azenta_intellixcap_s1/model.glb,assets/basic40_batch02/t5_automation/azenta_intellixcap_s1/model.urdf,assets/basic40_batch02/t5_automation/azenta_intellixcap_s1/asset.contract.json
instrument.brooks_preciseflex_400,CHEM-178,Lab sample-transfer robot arm,Brooks Automation,PreciseFlex 400,实验室样品转运机械臂 — Brooks Automation PreciseFlex 400 标准臂400 mm行程,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/preciseflex_400,12,4,15,9,0,1,6,False,0.715,0.2111,0.682,assets/basic40_batch02/t5_automation/preciseflex_400/model.glb,assets/basic40_batch02/t5_automation/preciseflex_400/model.urdf,assets/basic40_batch02/t5_automation/preciseflex_400/asset.contract.json
instrument.ziath_dp5_mirage_2023,CHEM-179,2D-barcode rack reader,Azenta Ziath,DP5 Mirage,样品管二维条码读架仪,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/ziath_dp5,16,1,16,7,0,1,7,False,0.208,0.135,0.1214,assets/basic40_batch02/t5_automation/ziath_dp5/model.glb,assets/basic40_batch02/t5_automation/ziath_dp5/model.urdf,assets/basic40_batch02/t5_automation/ziath_dp5/asset.contract.json
instrument.alicat_mc_1slpm_rev6,CHEM-180,Gas mass-flow controller,Alicat Scientific,"MC, 1 SLPM full scale, Rev6",气体质量流量控制器(Alicat MC,1 SLPM,标准精度,Rev6),Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/alicat_mc,11,7,25,8,1,0,7,False,0.0911,0.0267,0.1033,assets/basic40_batch02/t5_automation/alicat_mc/model.glb,assets/basic40_batch02/t5_automation/alicat_mc/model.urdf,assets/basic40_batch02/t5_automation/alicat_mc/asset.contract.json
instrument.bronkhorst_p702cv_5bar_gauge_n2,CHEM-181,Electronic back-pressure controller,Bronkhorst,EL-PRESS P-702CV,电子背压控制器,Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/bronkhorst_p702cv,11,1,18,9,0,0,9,False,0.127,0.025,0.123,assets/basic40_batch02/t5_automation/bronkhorst_p702cv/model.glb,assets/basic40_batch02/t5_automation/bronkhorst_p702cv/model.urdf,assets/basic40_batch02/t5_automation/bronkhorst_p702cv/asset.contract.json
instrument.vici_euta_2sd6mwe,CHEM-182,Multi-position gas stream-selection valve,VICI Valco,EUTA-2SD6MWE,多路气体自动切换阀 — VICI Valco EUTA-2SD6MWE(6位,2 inch隔热杆),Automation & Gas/Liquid Supply,assets/basic40_batch02/t5_automation/vici_euta,15,1,8,3,0,7,10,False,0.2338,0.086,0.105,assets/basic40_batch02/t5_automation/vici_euta/model.glb,assets/basic40_batch02/t5_automation/vici_euta/model.urdf,assets/basic40_batch02/t5_automation/vici_euta/asset.contract.json
instrument.bronkhorst_cemw,CHEM-183,Controlled evaporator & mixer,Bronkhorst,CEM W-202A,受控蒸发与混气进料器Bronkhorst CEM W-202A-NN0-K(三通混合阀+100 W换热器),Automation & Gas/Liquid Supply,assets/expansion_batch03/t5_automation/bronkhorst_cemw,16,1,20,21,0,6,12,True,0.12,0.11,0.3819,assets/expansion_batch03/t5_automation/bronkhorst_cemw/model.glb,assets/expansion_batch03/t5_automation/bronkhorst_cemw/model.urdf,assets/expansion_batch03/t5_automation/bronkhorst_cemw/asset.contract.json
instrument.newera_ne1000,CHEM-184,Programmable syringe pump,New Era Pump Systems,NE-1000 Multi-Phaser,可编程注射泵New Era NE-1000 Multi-Phaser(单通道,12 V DC),Automation & Gas/Liquid Supply,assets/expansion_batch05/t5_automation/newera_ne1000,47,12,31,35,10,9,15,True,0.2965,0.1527,0.1151,assets/expansion_batch05/t5_automation/newera_ne1000/model.glb,assets/expansion_batch05/t5_automation/newera_ne1000/model.urdf,assets/expansion_batch05/t5_automation/newera_ne1000/asset.contract.json
instrument.nabertherm_l9,CHEM-185,Muffle furnace,Nabertherm,L 9/11/SKM,Nabertherm L 9/11/SKM 马弗炉(目录版 3.4 kW),Lab Environment & Utilities,assets/basic40_batch02/t1_thermal/nabertherm_l9,10,7,12,10,1,4,8,False,0.49,0.505,0.58,assets/basic40_batch02/t1_thermal/nabertherm_l9/model.glb,assets/basic40_batch02/t1_thermal/nabertherm_l9/model.urdf,assets/basic40_batch02/t1_thermal/nabertherm_l9/asset.contract.json
instrument.carbolite_tf1_12_60_300,CHEM-186,Tube furnace (controlled atmosphere),Carbolite Gero,TF1 12/60/300,管式气氛炉 Carbolite Gero TF1 12/60/300,Lab Environment & Utilities,assets/basic40_batch02/t1_thermal/carbolite_tf1,19,6,14,5,1,1,13,False,0.876,0.48,0.575,assets/basic40_batch02/t1_thermal/carbolite_tf1/model.glb,assets/basic40_batch02/t1_thermal/carbolite_tf1/model.urdf,assets/basic40_batch02/t1_thermal/carbolite_tf1/asset.contract.json
instrument.julabo_corio_cd200f,CHEM-187,Heating/refrigerated circulator,JULABO,CORIO CD-200F,JULABO CORIO CD-200F 9012701.N1.03 加热制冷循环浴,Lab Environment & Utilities,assets/basic40_batch02/t1_thermal/julabo_corio_cd200f,20,6,15,4,1,1,13,False,0.23,0.3898,0.65,assets/basic40_batch02/t1_thermal/julabo_corio_cd200f/model.glb,assets/basic40_batch02/t1_thermal/julabo_corio_cd200f/model.urdf,assets/basic40_batch02/t1_thermal/julabo_corio_cd200f/asset.contract.json
instrument.vacuubrand_pc3001_vario_select,CHEM-188,Chemistry vacuum pumping unit,VACUUBRAND,PC 3001 VARIO select,化学耐腐蚀真空工作站,Lab Environment & Utilities,assets/basic40_batch02/t2_vacuum/vacuubrand_pc3001,15,3,12,7,1,0,11,False,0.306,0.303,0.4,assets/basic40_batch02/t2_vacuum/vacuubrand_pc3001/model.glb,assets/basic40_batch02/t2_vacuum/vacuubrand_pc3001/model.urdf,assets/basic40_batch02/t2_vacuum/vacuubrand_pc3001/asset.contract.json
instrument.inert_purelab_he_2gb,CHEM-189,Inert-atmosphere glovebox,Inert,PureLab HE 2GB,Inert PureLab HE 2GB 惰性气氛手套箱,Lab Environment & Utilities,assets/basic40_batch02/t2_vacuum/inert_purelab_he,15,2,27,10,1,9,7,False,2.0,1.067,1.921,assets/basic40_batch02/t2_vacuum/inert_purelab_he/model.glb,assets/basic40_batch02/t2_vacuum/inert_purelab_he/model.urdf,assets/basic40_batch02/t2_vacuum/inert_purelab_he/asset.contract.json
instrument.elga_purelab_flex3,CHEM-190,Lab ultrapure water system,ELGA LabWater,PURELAB flex 3,实验室超纯水系统,Lab Environment & Utilities,assets/basic40_batch02/t2_vacuum/elga_purelab_flex3,17,6,26,8,0,1,7,False,0.236,0.47,0.9,assets/basic40_batch02/t2_vacuum/elga_purelab_flex3/model.glb,assets/basic40_batch02/t2_vacuum/elga_purelab_flex3/model.urdf,assets/basic40_batch02/t2_vacuum/elga_purelab_flex3/asset.contract.json
instrument.miele_plw6111,CHEM-191,Laboratory glassware washer,Miele,PLW 6111,Miele PLW 6111 DP SC CL H14 10958380 实验室玻璃器皿清洗机,Lab Environment & Utilities,assets/basic40_batch02/t1_thermal/miele_plw6111,29,7,20,8,0,27,9,False,0.65,0.744,1.87,assets/basic40_batch02/t1_thermal/miele_plw6111/model.glb,assets/basic40_batch02/t1_thermal/miele_plw6111/model.urdf,assets/basic40_batch02/t1_thermal/miele_plw6111/asset.contract.json
instrument.tuttnauer_3870elvd,CHEM-192,Steam autoclave,Tuttnauer,3870ELV-D,立式高压蒸汽灭菌器Tuttnauer 3870ELV-D(85 L,冷却选件),Lab Environment & Utilities,assets/expansion_batch03/t2_vacuum/tuttnauer_3870elvd,21,5,19,24,1,9,16,True,0.731,0.555,1.0,assets/expansion_batch03/t2_vacuum/tuttnauer_3870elvd/model.glb,assets/expansion_batch03/t2_vacuum/tuttnauer_3870elvd/model.urdf,assets/expansion_batch03/t2_vacuum/tuttnauer_3870elvd/asset.contract.json
instrument.esco_ac24s8,CHEM-193,Biological safety cabinet,Esco Lifesciences,AC2-4S8-TU,生物安全柜Esco Airstream Plus AC2-4S8-TU(II级A2型,4 ft,不锈钢侧壁,UV-30A),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/esco_ac24s8,40,9,30,24,7,7,12,True,1.34,0.823,1.4,assets/expansion_batch04/t2_vacuum/esco_ac24s8/model.glb,assets/expansion_batch04/t2_vacuum/esco_ac24s8/model.urdf,assets/expansion_batch04/t2_vacuum/esco_ac24s8/asset.contract.json
instrument.inficon_ul1000fab,CHEM-194,Helium leak detector,INFICON,UL1000 Fab,氦质谱检漏仪INFICON UL1000 Fab(移动式,干式涡旋泵,230 V 50 Hz),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/inficon_ul1000fab,27,6,28,26,4,6,15,True,1.068,0.525,0.85,assets/expansion_batch04/t2_vacuum/inficon_ul1000fab/model.glb,assets/expansion_batch04/t2_vacuum/inficon_ul1000fab/model.urdf,assets/expansion_batch04/t2_vacuum/inficon_ul1000fab/asset.contract.json
instrument.vaisala_dmt152,CHEM-195,Trace-moisture dew-point transmitter,Vaisala,DMT152,"微量水露点变送器Vaisala DRYCAP DMT152(ISO G1/2"")",Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/vaisala_dmt152,11,1,25,21,0,2,16,True,0.1275,0.033,0.03,assets/expansion_batch04/t2_vacuum/vaisala_dmt152/model.glb,assets/expansion_batch04/t2_vacuum/vaisala_dmt152/model.urdf,assets/expansion_batch04/t2_vacuum/vaisala_dmt152/asset.contract.json
instrument.peak_precisionhydrogen,CHEM-196,Laboratory hydrogen generator,PEAK Scientific,Precision Hydrogen Trace 500,实验室氢气发生器PEAK Precision Hydrogen Trace 500(存档型号),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/peak_precisionhydrogen,22,2,23,21,7,5,13,True,0.3814,0.5656,0.4067,assets/expansion_batch04/t2_vacuum/peak_precisionhydrogen/model.glb,assets/expansion_batch04/t2_vacuum/peak_precisionhydrogen/model.urdf,assets/expansion_batch04/t2_vacuum/peak_precisionhydrogen/asset.contract.json
instrument.eppendorf_cryocubef570n,CHEM-197,Ultra-low temperature freezer,Eppendorf,CryoCube F570n,超低温冰箱Eppendorf CryoCube F570n(570 L,230 V,F571300031),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/eppendorf_cryocubef570n,41,12,35,34,8,11,12,True,1.1415,1.009,1.95,assets/expansion_batch04/t2_vacuum/eppendorf_cryocubef570n/model.glb,assets/expansion_batch04/t2_vacuum/eppendorf_cryocubef570n/model.urdf,assets/expansion_batch04/t2_vacuum/eppendorf_cryocubef570n/asset.contract.json
instrument.binder_kbf115,CHEM-198,Constant climate (T/RH) chamber,BINDER,KBF 115,恒温恒湿试验箱BINDER KBF 115(102 L,KBF115-230V,9020-0320),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/binder_kbf115,31,3,33,33,6,7,16,True,0.9055,0.7971,1.05,assets/expansion_batch04/t2_vacuum/binder_kbf115/model.glb,assets/expansion_batch04/t2_vacuum/binder_kbf115/model.urdf,assets/expansion_batch04/t2_vacuum/binder_kbf115/asset.contract.json
instrument.esco_efa5uduvw,CHEM-199,Chemical fume hood,Esco Lifesciences,Frontier Acela EFA-5UDUVW-9,台式化学通风柜Esco Frontier Acela EFA-5UDUVW-9(1.5 m美国版,选配Sentinel XL风速监视器),Lab Environment & Utilities,assets/expansion_batch05/t2_vacuum/esco_efa5uduvw,39,11,32,32,6,10,14,True,1.602,0.9097,1.521,assets/expansion_batch05/t2_vacuum/esco_efa5uduvw/model.glb,assets/expansion_batch05/t2_vacuum/esco_efa5uduvw/model.urdf,assets/expansion_batch05/t2_vacuum/esco_efa5uduvw/asset.contract.json
instrument.inert_puresolvmd,CHEM-200,Solvent purification system,Inert,PureSolv MD 7,溶剂纯化系统Inert PureSolv MD 7(7路溶剂,双柱,17 L储罐),Lab Environment & Utilities,assets/expansion_batch04/t2_vacuum/inert_puresolvmd,84,27,67,23,0,18,14,True,1.6104,0.8356,1.9459,assets/expansion_batch04/t2_vacuum/inert_puresolvmd/model.glb,assets/expansion_batch04/t2_vacuum/inert_puresolvmd/model.urdf,assets/expansion_batch04/t2_vacuum/inert_puresolvmd/asset.contract.json
instrument.agilent_7890b_ssl_fid,,Gas chromatograph (S/SL inlet + FID),Agilent,7890B,Agilent 7890B 气相色谱仪(单 S/SL 进样口 + FID),Chromatography & Electrophoresis,assets/GC7890B,52,50,0,16,3,1,0,False,0.5803,0.545,0.4905,assets/GC7890B/GC7890B.glb,assets/GC7890B/GC7890B.urdf,
instrument.ohaus_px224e,,Analytical balance,OHAUS,Pioneer PX224/E,OHAUS Pioneer PX224/E 分析天平,Basic Metrology & Sample Handling,assets/PX224E,25,16,0,7,1,1,0,False,0.209,0.3285,0.309,assets/PX224E/PX224E.glb,assets/PX224E/PX224E.urdf,
instrument.ohaus_spx2201,,Portable precision balance,OHAUS,Scout SPX2201,OHAUS Scout SPX2201 电子天平,Basic Metrology & Sample Handling,assets/SPX2201,23,15,0,7,1,1,0,False,0.202,0.2255,0.054,assets/SPX2201/SPX2201.glb,assets/SPX2201/SPX2201.urdf,123456789101112131415161718192021222324252627282930313233343536373839404142434445464748"""Drive the Esco fume hood (CHEM-199) through its contract API.
The agent raises the sash, notices that the uncalibrated airflow monitor reads low,measures the face velocity with a handheld anemometer and calibrates the monitor.
Run from the repository root: python examples/quickstart_fume_hood.py"""import sysfrom pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))from asset_runtime import esco_efa5uduvw as rt # noqa: E402
hood = rt.EscoEfa5uduvwRuntime("hood_01")hood.register_principal("lab", "evaluator") # sets up the world and can see hidden truthhood.register_principal("robot", "agent") # sees only what a policy may seelab, robot = hood.session("lab"), hood.session("robot")_n = 0
def call(session, capability, **arguments): global _n _n += 1 r = session.invoke(instance_id="hood_01", capability_id=capability, arguments=arguments, request_id=f"r{_n}") if r["status"] != "succeeded": raise RuntimeError(f"{capability}: {r['error']}") return r["result"]
def show(label): obs = robot.read(instance_id="hood_01", state_ids=["monitor.reading_m_s", "monitor.alarm"])["observations"] print(f"{label:20s} reading {obs['monitor.reading_m_s']['value']:.2f} m/s alarm {obs['monitor.alarm']['value'] or 'none'}")
call(lab, "plant.configure", **rt.PLANT_EXAMPLE) # ambient 295.15 K, 101.325 kPacall(lab, "exhaust.configure", **rt.EXHAUST_EXAMPLE) # building exhaust, damper half opencall(robot, "light.set", on=True)call(robot, "sash.set", height_m=0.457) # raise the sash to the 18-inch stopcall(lab, "sim.step", dt_s=30.0) # let the airflow settleshow("before calibration")
v = call(robot, "anemometer.measure")["face_velocity_m_s"] # 18-point traverse of the sash openingprint(f"{'anemometer':20s} {v:.3f} m/s")call(robot, "monitor.calibrate", reference_m_s=round(v, 3))call(lab, "sim.step", dt_s=10.0)show("after calibration")
print("agent-visible capabilities:", len(robot.describe(instance_id="hood_01")["capabilities"]))1234567891011121314from pathlib import Pathimport sysR=Path(__file__).resolve().parents[4];sys.path.insert(0,str(R));from scripts.asset_runtime.antonpaar_litesizerdia import *OBSERVED=[]def call(h,k,**a): out=h.invoke(k,**a);OBSERVED.append(dict(capability_id=k,arguments=copy.deepcopy(a),result=copy.deepcopy(out)));return outdef build(mode='liquid',sid='grain_capecod',method=None,plant=None,count=128): h=AntonpaarLitesizerdiaRuntime();call(h,'plant.configure',**dict(PLANT_EXAMPLE,**(plant or {}))) if mode!='liquid': call(h,'latch.set',angle_rad=.65);call(h,'module.withdraw',distance_m=.32);call(h,'module.select',mode=mode);call(h,'module.withdraw',distance_m=0.);call(h,'latch.set',angle_rad=0.) call(h,'method.configure',**dict(METHOD_EXAMPLE,**dict({'mode':mode},**(method or {}))));call(h,'lid.set',angle_rad=1.55) if mode=='liquid':call(h,'liquid.fill',volume_m3=.0003) if mode=='dry':call(h,'air.add',amount_mol=1.);call(h,'vacuum.set',enabled=True) call(h,'lid.set',angle_rad=0.);call(h,'power.set',enabled=True);call(h,'background.capture');call(h,'lid.set',angle_rad=1.55);call(h,'sample.load',**dict(SAMPLE_EXAMPLE,substance_id=sid,particle_count=count));call(h,'lid.set',angle_rad=0.);return h12345678910111213141516171819from pathlib import Pathimport sys,copyR=Path(__file__).resolve().parents[4];sys.path.insert(0,str(R/'scripts'));from asset_runtime import antonpaar_litesizerdls as rtOBSERVED=[]def call(h,k,**a): r=h.invoke(k,**a);OBSERVED.append(dict(capability_id=k,arguments=copy.deepcopy(a),result=copy.deepcopy(r)));return rdef configure(h,kind='omega',reference=rt.SID,mode='dls'): call(h,'plant.configure',**rt.PLANT_EXAMPLE);call(h,'power.set',enabled=True);call(h,'lid.release');call(h,'lid.set',angle_rad=1.7);call(h,'cuvette.set',lift_m=.12);call(h,'cell.configure',kind=kind);call(h,'cell_cap.set',lift_m=.022) sample=dict(rt.SAMPLE_EXAMPLE,reference_id=reference,volume_m3=.7e-6 if kind=='omega' else 1e-6);call(h,'sample.load',**sample);call(h,'cell_cap.set',lift_m=0.);call(h,'cuvette.set',lift_m=0.);call(h,'lid.set',angle_rad=0.) call(h,'temperature.calibrate',reference_k=[293.15,313.15],measured_k=[293.15,313.15]);call(h,'dls.calibrate',reference_m=100e-9,measured_m=100e-9);call(h,'mobility.calibrate',reference_m2_v_s=[-1e-8,1e-8],measured_m2_v_s=[-1e-8,1e-8]);call(h,'method.configure',**dict(rt.METHOD_EXAMPLE,mode=mode,angle_deg=15 if mode=='zeta' else 90));h.step(360.) return hdef run(h): call(h,'acquisition.start') while h.phase=='running':h.step(.1) return call(h,'process.measure')def unload(h): call(h,'lid.release');call(h,'lid.set',angle_rad=1.7);call(h,'cuvette.set',lift_m=.12);call(h,'cell_cap.set',lift_m=.022);return call(h,'sample.unload')if __name__=='__main__': h=configure(rt.AntonpaarLitesizerdlsRuntime());r=run(h);print(r['phase'],r['dls']['z_average_m'],r['dls']['pdi']);call(h,'method.configure',**dict(rt.METHOD_EXAMPLE,mode='zeta',angle_deg=15));r=run(h);print(r['phase'],r['els']['zeta_v']);unload(h);print(call(h,'ledger.read'))12345678910111213141516171819202122232425262728293031323334353637from pathlib import Pathimport sys,copy,mathR=Path(__file__).resolve().parents[4];sys.path.insert(0,str(R/'scripts'));from asset_runtime import antonpaar_poremaster60 as rtOBSERVED={}def call(r,k,**a): out=r.invoke(k,**a);OBSERVED.setdefault(k,[]).append((copy.deepcopy(a),copy.deepcopy(out)));return outdef setup(name='micp_demo',plant=None,ref='hemp_shiv',mass=None,entered_mass=None,low1=False): r=rt.AntonpaarPoremaster60Runtime(name);p=copy.deepcopy(rt.PLANT_EXAMPLE) if plant:p.update(plant) call(r,'plant.configure',**p);call(r,'cell.configure',bulb_volume_m3=3.2e-6,stem_capacity_m3=.5e-6);call(r,'power.set',enabled=True) for i in range(3): xmax=[50*rt.PSI,1500*rt.PSI,rt.P_MAX][i];xs=[0.,xmax];call(r,'pressure.calibrate',range_index=i,reference_pa=xs,measured_pa=[p['pressure_gain'][i]*x+p['pressure_offset_pa'][i] for x in xs]) xs=[0.,.2e-6];call(r,'volume.calibrate',reference_volume_m3=xs,measured_capacitance_f=[x/p['capacitance_volume_factor_m3_f']+p['capacitance_offset_f'] for x in xs]);call(r,'mercury.fill',mass_kg=.1) c=rt.LIB['substances'][ref]['conditions'];m=mass or c['source_sample_mass_kg'] or .0001;bulk=(c['source_bulk_volume_m3']/c['source_sample_mass_kg']*m) if c['source_bulk_volume_m3'] and c['source_sample_mass_kg'] else max(rt.CURVES[(ref,'intrusion')][1])*m*1.2 call(r,'guard0.set',angle_rad=1.4);call(r,'sample.load',sample_id=name+'_sample',reference_id=ref,true_dry_mass_kg=m,true_bulk_volume_m3=bulk,dry=True,accept_cross_instrument_transfer=True) if low1:call(r,'guard1.set',angle_rad=1.4);call(r,'cell.transfer',destination='low1') call(r,'guard0.set',angle_rad=0.);call(r,'guard1.set',angle_rad=0.) # Host-provided engineering blank at the independently specified fill volume. Not measured OEM calibration. fill_volume=r.bulb-bulk+r.capacity;grid=[0.]+[rt.P_MAX*i/1000 for i in range(1,1001)];blank=[fill_volume*(-math.expm1(-v/p['hg_bulk_modulus_pa']))+p['glass_compliance_m3_pa']*v for v in grid];call(r,'blank.calibrate',pressures_pa=grid,volumes_m3=blank) meth=copy.deepcopy(rt.METHOD_EXAMPLE);meth['entered_mass_kg']=entered_mass or m if ref!='hemp_shiv': minimum=rt.CURVES[(ref,'intrusion')][0][0];meth['pressures_pa']=[max(minimum,3*rt.PSI),10*rt.PSI,30*rt.PSI,50*rt.PSI] call(r,'method.configure',**meth);return r
def run(r,max_s=3600): call(r,'acquisition.start') for _ in range(int(max_s/rt.DT)): r.step(rt.DT) if r.phase!='running':break if r.phase!='succeeded':raise RuntimeError((r.phase,r.failure,r.stage,r.p,r.index,r.v)) return call(r,'process.measure')def high(r,cycle=True): call(r,'guard'+r.position[-1]+'.set',angle_rad=1.4);call(r,'cap.set',lift_m=.19);call(r,'cell.transfer',destination='high');call(r,'guard0.set',angle_rad=0.);call(r,'guard1.set',angle_rad=0.);call(r,'cap.set',lift_m=0.) meth=copy.deepcopy(rt.METHOD_EXAMPLE);meth.update(stage='high',entered_mass_kg=r.sample['true_dry_mass_kg'],pressure_rate_pa_s=2e7,pressure_tolerance_pa=7000.,max_volume_drift_m3_s=1e-12);peak=rt.CURVES[(r.sample['reference_id'],'intrusion')][0][-1];meth['pressures_pa']=[50*rt.PSI,1e6,1e7,1e8,peak]+([1e8,1e7,1e6,rt.CURVES[(r.sample['reference_id'],'extrusion')][0][0]] if cycle else []);call(r,'method.configure',**meth);return rif __name__=='__main__': import json r=setup();run(r);high(r);out=run(r);print(r.phase,len(out['points']),r.elapsed,out['max_pore_volume_m3_kg']);print(json.dumps(r._ledger(),indent=2));Path(__file__).with_name('example_porosimetry.json').write_text(json.dumps({'result':out,'ledger':r._ledger(),'scope':'engineering blank calibration; independent measured hemp fullcycle transfer'},indent=2)+'\n')1234567891011121314151617181920212223242526from pathlib import Pathimport sys,copyR=Path(__file__).resolve().parents[4];sys.path.insert(0,str(R));from scripts.asset_runtime.antonpaar_psa1190 import *OBSERVED=[]def call(h,k,**a): r=h.invoke(k,**a);OBSERVED.append(dict(capability_id=k,arguments=copy.deepcopy(a),result=copy.deepcopy(r)));return rdef build(mode='wet',sid=SID): h=AntonpaarPsa1190Runtime();p=dict(PLANT_EXAMPLE) if sid.startswith('soil_'):p.update(n635=1.543,k635=.01,n830=1.543,k830=.01) if mode=='dry':p['medium_n']=1. call(h,'plant.configure',**p);call(h,'cover.set',angle_rad=1.2);call(h,'ultrasound.select',power_w=50.);call(h,'cover.set',angle_rad=0.);m=dict(METHOD_EXAMPLE,mode=mode,medium_n=p['medium_n'],n635=p['n635'],k635=p['k635'],n830=p['n830'],k830=p['k830']);call(h,'method.configure',**m) if mode=='wet':call(h,'tank_lid.set',slide_m=.17);call(h,'liquid.fill',volume_m3=.00045);call(h,'tank_lid.set',slide_m=0.) else:call(h,'air.add',amount_mol=2.) call(h,'power.set',enabled=True);call(h,'sim.step',dt_s=60.);call(h,'background.start');call(h,'sim.step',dt_s=60.) s=dict(SAMPLE_EXAMPLE,substance_id=sid,accept_range_truncation=True) if sid.startswith('soil_'):s.update(mass_kg=.00045,true_density_kg_m3=2650.) if mode=='wet':call(h,'tank_lid.set',slide_m=.17) else:call(h,'dry_hood.set',lift_m=.20);call(h,'distributor.set',angle_rad=.6);s['mass_kg']=.030 call(h,'sample.load',**s) if mode=='wet':call(h,'tank_lid.set',slide_m=0.) else:call(h,'dry_hood.set',lift_m=0.) return hif __name__=='__main__': for mode,sid in [('wet',SID),('wet','soil_2014_111'),('dry',SID)]: h=build(mode,sid);call(h,'acquisition.start');call(h,'sim.step',dt_s=15.1);r=call(h,'acquisition.result');print(mode,sid,h.phase,h.error,h.obsc,None if h.psd is None else {k:v for k,v in h.psd.items() if k in ['d10_m','d50_m','d90_m','relative_fit_residual']});print(h._ledger()) print('caps',len(CAPS),'slots',len(SLOTS))12345678910from pathlib import Pathimport sys,copyROOT=Path(__file__).resolve().parents[4];sys.path.insert(0,str(ROOT/'scripts'));from asset_runtime import biolin_sigma700 as rtOBSERVED=[]def call(h,k,**a): r=h.invoke(k,**a);OBSERVED.append((k,copy.deepcopy(a),copy.deepcopy(r)));return rdef build(probe='plate',sid='cas_67_56_1',method=None,plant=None,c=0.,temp=293.15): p=dict(rt.PLANT_EXAMPLE) if sid.startswith(('apg_','sds_')):p.update(liquid_density_kg_m3=998.20715,liquid_cp_j_kg_k=4184.0509) p.update(plant or {});h=rt.BiolinSigma700Runtime();call(h,'plant.configure',**p);call(h,'door.set',angle_rad=2.35);call(h,'probe.select',probe=probe);call(h,'sample.load',**dict(rt.SAMPLE_EXAMPLE,substance_id=sid,concentration_kg_m3=c,temperature_k=temp));call(h,'door.set',angle_rad=0.);call(h,'method.configure',**dict(rt.METHOD_EXAMPLE,**dict({'accept_ring_proxy':probe=='ring','analysis_density_difference_kg_m3':p['liquid_density_kg_m3']-p['upper_density_kg_m3']},**(method or {}))));call(h,'power.set',enabled=True);h.step(2.);call(h,'balance.tare');return h12345678910111213141516171819202122232425from pathlib import Pathimport sys,copy,mathROOT=Path(__file__).resolve().parents[4];sys.path.insert(0,str(ROOT/'scripts'));from asset_runtime import biolin_thetaflex as rtOBSERVED=[]def call(h,k,**a): r=h.invoke(k,**a);OBSERVED.append((k,copy.deepcopy(a),copy.deepcopy(r)));return r
def finish(h,max_s=60): start=h.time_s while h.phase=='running' and h.time_s-start<max_s:call(h,'sim.step',dt_s=.1) assert h.phase=='succeeded',(h.phase,h.error,h.stage) return call(h,'acquisition.result')def setup(instance_id='thetaflex_01',reference_id=rt.SAMPLE_EXAMPLE['reference_id'],plant=None): h=rt.BiolinThetaFlexRuntime(instance_id);call(h,'plant.configure',**(plant or rt.PLANT_EXAMPLE));call(h,'sample.load',reference_id=reference_id,accept_unknown_conditions=True);call(h,'stock.load',reference_id=reference_id,volume_m3=2e-7);call(h,'power.set',enabled=True);call(h,'illumination.set',fraction=.8);call(h,'focus.set',position_m=.006);call(h,'camera.calibrate',known_length_m=.001,observed_pixels=.001/(h.method['field_width_m']/rt.W));call(h,'stage.move',x_m=.04,y_m=.02,z_m=.025);finish(h);return h
def put_drop(h,volume=2e-10): call(h,'dispenser.move',position_m=.020);finish(h);call(h,'liquid.transfer',volume_m3=volume);finish(h);call(h,'dispenser.move',position_m=.0);finish(h)
def static_example(): h=setup();put_drop(h);call(h,'acquisition.start');result=finish(h);return h,result
def dynamic_example(): h=setup('theta_dynamic');put_drop(h,4e-11);m=copy.deepcopy(rt.METHOD_EXAMPLE);m.update(mode='dynamic',frame_rate_hz=5.,flow_m3_s=3e-11);call(h,'method.configure',**m);call(h,'dispenser.move',position_m=.0240);finish(h);call(h,'liquid.transfer',volume_m3=1.4e-10);advance=finish(h);call(h,'liquid.transfer',volume_m3=-1.7e-10);recede=finish(h);angles=call(h,'analysis.hysteresis',advancing_rad=[x['mean_rad'] for x in advance['rows']],receding_rad=[x['mean_rad'] for x in recede['rows']]);return h,advance,recede,anglesif __name__=='__main__': h,r=static_example();print('static angle deg',math.degrees(r['rows'][-1]['mean_rad']),'imagechars',len(r['image_png_base64']));h,a,b,c=dynamic_example();print('dynamic',len(a['rows']),len(b['rows']),c,'ledger',call(h,'ledger.read'))123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741{ "source": "Bio-Rad bulletin 1658100 (Mini-PROTEAN Precast Gels Instruction Manual and Application Guide), p.9 migration charts", "pdf_sha256": "4790097f20a2e733c6e5e07b29603e2751c629b78f2e9b9f783d16c58ef24cba", "page": 15, "method_zh": "从PDF矢量图读取泳道外框与条带标记线的精确坐标(0.1 pt),按文字包围盒配对kD标签;泳道外框=整块7.2 cm胶,底边=参考线/染料前沿,分离胶顶在底边以上6.2 cm。", "evidence": "digitized_manufacturer_chart", "gel_height_cm": 7.2, "resolving_height_cm": 6.2, "sets": { "precision_plus_unstained": [ { "gel": "7.5%", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 499.6, "distance_from_resolving_top_cm": 1.114, "rf": 0.1797 }, { "mw_kda": 150.0, "y_pt": 513.82, "distance_from_resolving_top_cm": 1.5791, "rf": 0.2547 }, { "mw_kda": 100.0, "y_pt": 538.55, "distance_from_resolving_top_cm": 2.3881, "rf": 0.3852 }, { "mw_kda": 75.0, "y_pt": 576.96, "distance_from_resolving_top_cm": 3.6449, "rf": 0.5879 }, { "mw_kda": 50.0, "y_pt": 610.85, "distance_from_resolving_top_cm": 4.7535, "rf": 0.7667 }, { "mw_kda": 37.0, "y_pt": 633.98, "distance_from_resolving_top_cm": 5.51, "rf": 0.8887 } ] }, { "gel": "10%", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 498.5, "distance_from_resolving_top_cm": 1.0779, "rf": 0.1739 }, { "mw_kda": 150.0, "y_pt": 508.05, "distance_from_resolving_top_cm": 1.3905, "rf": 0.2243 }, { "mw_kda": 100.0, "y_pt": 526.55, "distance_from_resolving_top_cm": 1.9957, "rf": 0.3219 }, { "mw_kda": 75.0, "y_pt": 547.27, "distance_from_resolving_top_cm": 2.6735, "rf": 0.4312 }, { "mw_kda": 50.0, "y_pt": 576.24, "distance_from_resolving_top_cm": 3.6211, "rf": 0.5841 }, { "mw_kda": 37.0, "y_pt": 603.07, "distance_from_resolving_top_cm": 4.4989, "rf": 0.7256 }, { "mw_kda": 25.0, "y_pt": 629.79, "distance_from_resolving_top_cm": 5.3731, "rf": 0.8666 }, { "mw_kda": 20.0, "y_pt": 639.05, "distance_from_resolving_top_cm": 5.6759, "rf": 0.9155 } ] }, { "gel": "12%", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 497.41, "distance_from_resolving_top_cm": 1.0425, "rf": 0.1682 }, { "mw_kda": 150.0, "y_pt": 505.2, "distance_from_resolving_top_cm": 1.2972, "rf": 0.2092 }, { "mw_kda": 100.0, "y_pt": 519.36, "distance_from_resolving_top_cm": 1.7606, "rf": 0.284 }, { "mw_kda": 75.0, "y_pt": 538.33, "distance_from_resolving_top_cm": 2.3811, "rf": 0.384 }, { "mw_kda": 50.0, "y_pt": 558.43, "distance_from_resolving_top_cm": 3.0387, "rf": 0.4901 }, { "mw_kda": 37.0, "y_pt": 573.72, "distance_from_resolving_top_cm": 3.5387, "rf": 0.5708 }, { "mw_kda": 25.0, "y_pt": 600.25, "distance_from_resolving_top_cm": 4.4065, "rf": 0.7107 }, { "mw_kda": 20.0, "y_pt": 609.43, "distance_from_resolving_top_cm": 4.7068, "rf": 0.7592 }, { "mw_kda": 15.0, "y_pt": 639.07, "distance_from_resolving_top_cm": 5.6766, "rf": 0.9156 } ] }, { "gel": "4–15%", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 500.88, "distance_from_resolving_top_cm": 1.156, "rf": 0.1865 }, { "mw_kda": 150.0, "y_pt": 521.25, "distance_from_resolving_top_cm": 1.8222, "rf": 0.2939 }, { "mw_kda": 100.0, "y_pt": 538.58, "distance_from_resolving_top_cm": 2.3893, "rf": 0.3854 }, { "mw_kda": 75.0, "y_pt": 551.71, "distance_from_resolving_top_cm": 2.8186, "rf": 0.4546 }, { "mw_kda": 50.0, "y_pt": 573.04, "distance_from_resolving_top_cm": 3.5164, "rf": 0.5672 }, { "mw_kda": 37.0, "y_pt": 591.16, "distance_from_resolving_top_cm": 4.1094, "rf": 0.6628 }, { "mw_kda": 25.0, "y_pt": 614.62, "distance_from_resolving_top_cm": 4.8766, "rf": 0.7866 }, { "mw_kda": 20.0, "y_pt": 624.5, "distance_from_resolving_top_cm": 5.1998, "rf": 0.8387 }, { "mw_kda": 15.0, "y_pt": 641.37, "distance_from_resolving_top_cm": 5.7517, "rf": 0.9277 }, { "mw_kda": 10.0, "y_pt": 651.23, "distance_from_resolving_top_cm": 6.0745, "rf": 0.9798 } ] }, { "gel": "4–20%", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 493.34, "distance_from_resolving_top_cm": 0.9093, "rf": 0.1467 }, { "mw_kda": 150.0, "y_pt": 513.31, "distance_from_resolving_top_cm": 1.5625, "rf": 0.252 }, { "mw_kda": 100.0, "y_pt": 530.65, "distance_from_resolving_top_cm": 2.1297, "rf": 0.3435 }, { "mw_kda": 75.0, "y_pt": 545.27, "distance_from_resolving_top_cm": 2.6082, "rf": 0.4207 }, { "mw_kda": 50.0, "y_pt": 564.88, "distance_from_resolving_top_cm": 3.2497, "rf": 0.5241 }, { "mw_kda": 37.0, "y_pt": 579.59, "distance_from_resolving_top_cm": 3.7309, "rf": 0.6018 }, { "mw_kda": 25.0, "y_pt": 602.61, "distance_from_resolving_top_cm": 4.4837, "rf": 0.7232 }, { "mw_kda": 20.0, "y_pt": 609.29, "distance_from_resolving_top_cm": 4.7023, "rf": 0.7584 }, { "mw_kda": 15.0, "y_pt": 627.82, "distance_from_resolving_top_cm": 5.3086, "rf": 0.8562 }, { "mw_kda": 10.0, "y_pt": 640.61, "distance_from_resolving_top_cm": 5.7269, "rf": 0.9237 } ] }, { "gel": "Any kD", "lane_top_pt": 434.97656200000006, "lane_bottom_pt": 655.0703120000001, "well_bottom_pt": 452.19140600000003, "resolving_top_pt": 465.55, "pt_per_cm": 30.569, "bands": [ { "mw_kda": 250.0, "y_pt": 495.11, "distance_from_resolving_top_cm": 0.967, "rf": 0.156 }, { "mw_kda": 150.0, "y_pt": 501.17, "distance_from_resolving_top_cm": 1.1655, "rf": 0.188 }, { "mw_kda": 100.0, "y_pt": 511.64, "distance_from_resolving_top_cm": 1.5079, "rf": 0.2432 }, { "mw_kda": 75.0, "y_pt": 523.62, "distance_from_resolving_top_cm": 1.8997, "rf": 0.3064 }, { "mw_kda": 50.0, "y_pt": 542.64, "distance_from_resolving_top_cm": 2.5221, "rf": 0.4068 }, { "mw_kda": 37.0, "y_pt": 558.18, "distance_from_resolving_top_cm": 3.0304, "rf": 0.4888 }, { "mw_kda": 25.0, "y_pt": 584.51, "distance_from_resolving_top_cm": 3.8917, "rf": 0.6277 }, { "mw_kda": 20.0, "y_pt": 597.35, "distance_from_resolving_top_cm": 4.3118, "rf": 0.6955 }, { "mw_kda": 15.0, "y_pt": 618.43, "distance_from_resolving_top_cm": 5.0015, "rf": 0.8067 }, { "mw_kda": 10.0, "y_pt": 639.43, "distance_from_resolving_top_cm": 5.6885, "rf": 0.9175 } ] } ], "broad_range_unstained": [ { "gel": "7.5%", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 502.22, "distance_from_resolving_top_cm": 1.2254, "rf": 0.1976 }, { "mw_kda": 116.0, "y_pt": 535.77, "distance_from_resolving_top_cm": 2.3228, "rf": 0.3746 }, { "mw_kda": 97.4, "y_pt": 548.24, "distance_from_resolving_top_cm": 2.7309, "rf": 0.4405 }, { "mw_kda": 66.0, "y_pt": 586.02, "distance_from_resolving_top_cm": 3.9667, "rf": 0.6398 }, { "mw_kda": 45.0, "y_pt": 625.71, "distance_from_resolving_top_cm": 5.2652, "rf": 0.8492 }, { "mw_kda": 31.0, "y_pt": 649.91, "distance_from_resolving_top_cm": 6.0569, "rf": 0.9769 } ] }, { "gel": "10%", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 499.74, "distance_from_resolving_top_cm": 1.1443, "rf": 0.1846 }, { "mw_kda": 116.0, "y_pt": 522.32, "distance_from_resolving_top_cm": 1.8831, "rf": 0.3037 }, { "mw_kda": 97.4, "y_pt": 532.07, "distance_from_resolving_top_cm": 2.2018, "rf": 0.3551 }, { "mw_kda": 66.0, "y_pt": 560.91, "distance_from_resolving_top_cm": 3.1453, "rf": 0.5073 }, { "mw_kda": 45.0, "y_pt": 593.62, "distance_from_resolving_top_cm": 4.2154, "rf": 0.6799 }, { "mw_kda": 31.0, "y_pt": 626.59, "distance_from_resolving_top_cm": 5.2941, "rf": 0.8539 }, { "mw_kda": 21.5, "y_pt": 645.17, "distance_from_resolving_top_cm": 5.9019, "rf": 0.9519 } ] }, { "gel": "12%", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 496.87, "distance_from_resolving_top_cm": 1.0504, "rf": 0.1694 }, { "mw_kda": 116.0, "y_pt": 519.43, "distance_from_resolving_top_cm": 1.7883, "rf": 0.2884 }, { "mw_kda": 97.4, "y_pt": 525.27, "distance_from_resolving_top_cm": 1.9793, "rf": 0.3192 }, { "mw_kda": 66.0, "y_pt": 545.64, "distance_from_resolving_top_cm": 2.646, "rf": 0.4268 }, { "mw_kda": 45.0, "y_pt": 570.21, "distance_from_resolving_top_cm": 3.4497, "rf": 0.5564 }, { "mw_kda": 31.0, "y_pt": 593.17, "distance_from_resolving_top_cm": 4.2007, "rf": 0.6775 }, { "mw_kda": 21.5, "y_pt": 631.76, "distance_from_resolving_top_cm": 5.4633, "rf": 0.8812 }, { "mw_kda": 14.4, "y_pt": 646.82, "distance_from_resolving_top_cm": 5.956, "rf": 0.9607 } ] }, { "gel": "4–15%", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 498.73, "distance_from_resolving_top_cm": 1.1114, "rf": 0.1793 }, { "mw_kda": 116.0, "y_pt": 536.54, "distance_from_resolving_top_cm": 2.348, "rf": 0.3787 }, { "mw_kda": 97.4, "y_pt": 548.78, "distance_from_resolving_top_cm": 2.7486, "rf": 0.4433 }, { "mw_kda": 66.0, "y_pt": 568.4, "distance_from_resolving_top_cm": 3.3905, "rf": 0.5469 }, { "mw_kda": 45.0, "y_pt": 585.53, "distance_from_resolving_top_cm": 3.9508, "rf": 0.6372 }, { "mw_kda": 31.0, "y_pt": 608.76, "distance_from_resolving_top_cm": 4.7109, "rf": 0.7598 }, { "mw_kda": 21.5, "y_pt": 631.56, "distance_from_resolving_top_cm": 5.4568, "rf": 0.8801 }, { "mw_kda": 14.4, "y_pt": 643.41, "distance_from_resolving_top_cm": 5.8445, "rf": 0.9427 }, { "mw_kda": 6.5, "y_pt": 650.79, "distance_from_resolving_top_cm": 6.0856, "rf": 0.9816 } ] }, { "gel": "4–20%", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 496.78, "distance_from_resolving_top_cm": 1.0475, "rf": 0.1689 }, { "mw_kda": 116.0, "y_pt": 526.03, "distance_from_resolving_top_cm": 2.0044, "rf": 0.3233 }, { "mw_kda": 97.4, "y_pt": 534.27, "distance_from_resolving_top_cm": 2.2737, "rf": 0.3667 }, { "mw_kda": 66.0, "y_pt": 553.84, "distance_from_resolving_top_cm": 2.9142, "rf": 0.47 }, { "mw_kda": 45.0, "y_pt": 572.41, "distance_from_resolving_top_cm": 3.5215, "rf": 0.568 }, { "mw_kda": 31.0, "y_pt": 595.93, "distance_from_resolving_top_cm": 4.2911, "rf": 0.6921 }, { "mw_kda": 21.5, "y_pt": 617.02, "distance_from_resolving_top_cm": 4.981, "rf": 0.8034 }, { "mw_kda": 14.4, "y_pt": 630.32, "distance_from_resolving_top_cm": 5.416, "rf": 0.8735 }, { "mw_kda": 6.5, "y_pt": 639.55, "distance_from_resolving_top_cm": 5.7182, "rf": 0.9223 } ] }, { "gel": "Any kD", "lane_top_pt": 434.195312, "lane_bottom_pt": 654.28125, "well_bottom_pt": 451.41015600000003, "resolving_top_pt": 464.76, "pt_per_cm": 30.567, "bands": [ { "mw_kda": 200.0, "y_pt": 492.0, "distance_from_resolving_top_cm": 0.8911, "rf": 0.1437 }, { "mw_kda": 116.0, "y_pt": 505.11, "distance_from_resolving_top_cm": 1.32, "rf": 0.2129 }, { "mw_kda": 97.4, "y_pt": 509.86, "distance_from_resolving_top_cm": 1.4752, "rf": 0.2379 }, { "mw_kda": 66.0, "y_pt": 525.87, "distance_from_resolving_top_cm": 1.9991, "rf": 0.3224 }, { "mw_kda": 45.0, "y_pt": 548.08, "distance_from_resolving_top_cm": 2.7257, "rf": 0.4396 }, { "mw_kda": 31.0, "y_pt": 576.32, "distance_from_resolving_top_cm": 3.6495, "rf": 0.5886 }, { "mw_kda": 21.5, "y_pt": 606.21, "distance_from_resolving_top_cm": 4.6275, "rf": 0.7464 }, { "mw_kda": 14.4, "y_pt": 625.15, "distance_from_resolving_top_cm": 5.2469, "rf": 0.8463 }, { "mw_kda": 6.5, "y_pt": 639.88, "distance_from_resolving_top_cm": 5.729, "rf": 0.924 } ] } ] }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879{ "catalog_id": "CHEM-147", "checked_at": "2026-09-24T12:39:42.801221+00:00", "status": "passed", "method": "independent re-read of the cached polyVERSE CSV by line number; unit conversions recomputed with independent constants; RDKit SMILES parse; license/hashes", "library": "assets/expansion_batch04/t1_thermal/ametek_oxtran/oxygen_permeation_library.json", "library_sha256": "4efb2f2c4fb60cd637b6f1e37327c324a70a511199f015331bcd3565af8beb72", "csv_sha256": "546c6120713c737a1b0b93a7558ef2e745fb0a44ca5498473532b7077955e7f3", "templates": 128, "with_diffusivity": 92, "passed_count": 11, "checks": [ { "id": "csv_header", "status": "passed", "detail": [ "property", "smiles_string", "p_csmiles", "value", "unscaled_value", "Activity", "Temp", "Solvent_SMILES", "source" ] }, { "id": "at_least_50_templates", "status": "passed", "detail": 128 }, { "id": "at_least_50_with_measured_diffusivity", "status": "passed", "detail": 92 }, { "id": "unique_ids", "status": "passed", "detail": null }, { "id": "unique_repeat_units", "status": "passed", "detail": null }, { "id": "license_copy_identical", "status": "passed", "detail": null }, { "id": "no_synthetic_records", "status": "passed", "detail": null }, { "id": "barrer_constant", "status": "passed", "detail": 3.3463981560817787e-16 }, { "id": "every_template_matches_source_row_and_conversion", "status": "passed", "detail": [] }, { "id": "csv_sha_recorded", "status": "passed", "detail": "546c6120713c737a1b0b93a7558ef2e745fb0a44ca5498473532b7077955e7f3" }, { "id": "rdkit_available_for_smiles_parse", "status": "passed", "detail": null } ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161"""CHEM-147 AMETEK MOCON OX-TRAN 2/22 L shared interface geometry (SI, +Z up, +Y rear, origin = bench footprint centre).
Single source for build_geometry.py, build_blender.py, verify_geometry.py and the Matterix scripts. The runtime(scripts/asset_runtime/ametek_oxtran.py) keeps its own copies of the physical constants; the tests compare them.
Manufacturer facts: body 12 in W x 23 in D x 15.5 in H (30.4 x 58.0 x 39.4 cm), 95 lb (43.1 kg) (2020 brochure p4 under an"Interior Dimensions and Volume" heading; the current product page and the same-chassis OX-TRAN 2/28 manual list the samenumbers as the uncrated physical specification). Front/rear layouts follow the OX-TRAN 2/28 operator's manual line drawings(Fig. 2-1 front, 2-2 behind the cover, 2-3 back panel; same chassis and 43.1 kg) and the 2/22 product photographs. Thedrawings put 394 mm at the top of the side shoulders; the colour touchscreen stands above the body (photo/drawing estimate).Every local number below is a drawing / photo estimate or an engineering assumption (see geometry_manifest evidence)."""import math
# ---------------------------------------------------------------- body (manufacturer envelope, touchscreen excluded)BODY_M = (0.304, 0.580, 0.394) # W x D x H (manufacturer uncrated physical specification)FRONT_Y = -BODY_M[1] / 2 # -0.290 front faceREAR_Y = BODY_M[1] / 2 # +0.290 rear faceFOOT_H = 0.025 # block feet (front and rear drawings)SHOULDER_X = 0.130 # |x| of the inner edge of the raised side shoulders beside the displayRECESS_Z = 0.360 # top of the display recess between the shoulders (front part)RECESS_BACK_Y = -0.175 # rear end of the display recess# front vertical bands (front drawing): left control column | centre drawer column | right columnLEFT_COLUMN_X = (-0.152, -0.085)CENTER_COLUMN_X = (-0.085, 0.084)BAND_B_Z = (FOOT_H, 0.130) # cell B module bandBAND_A_Z = (0.130, 0.226) # cell A module bandCOVER_Z = (0.226, 0.334) # hinged upper front cover (OX-TRAN label)COVER_X = (-0.082, 0.082)COVER_THICKNESS = 0.004COVER_HINGE = (0.0, FRONT_Y - 0.0065, COVER_Z[1]) # cover plate 4.5-8.5 mm in front of the face (clears the vent stubs)COVER_OPEN_RAD = 1.40
# ---------------------------------------------------------------- cells, drawers, cartridgesDRAWER_FRONT_Z = {'a': (0.170, 0.219), 'b': (0.078, 0.127)}DRAWER_CENTER_Z = {k: (v[0] + v[1]) / 2 for k, v in DRAWER_FRONT_Z.items()}DRAWER_FRONT_X = (-0.084, 0.084)DRAWER_PROUD = 0.010 # handle stands 10 mm in front of the face when closedDRAWER_TRAVEL_M = 0.190 # fully open: the cartridge clears the front face for liftingBAY_X = (-0.080, 0.080)BAY_DEPTH = 0.245 # bay from the front face into the bodyBAY_H = 0.046CARTRIDGE_SIZE = (0.140, 0.150, 0.022) # removable horizontal test cartridge (photo / drawing estimate)CARTRIDGE_Y_LOCAL = 0.098 # centre of the cartridge behind the drawer front (drawer-local +Y)TRAY_LENGTH = 0.230 # tray stays engaged in the bay at full travelTRAY_TOP_LOCAL = -0.0215 # tray top surface relative to the drawer front centre (bay floor -0.0225)CARTRIDGE_Z_LOCAL = TRAY_TOP_LOCAL + CARTRIDGE_SIZE[2] / 2 # -0.0105: cartridge rests on the tray, top at +0.0005PLATEN_REST_BOTTOM_LOCAL = CARTRIDGE_Z_LOCAL + CARTRIDGE_SIZE[2] / 2 + 0.003 # clamp platen 3 mm above the cartridge when releasedPLATEN_T = 0.004BAY_HALF_H = 0.0225TEST_AREA_M2 = 50e-4 # documented standard test area 50 cm^2TEST_WINDOW_D = 2 * math.sqrt(TEST_AREA_M2 / math.pi) # 79.8 mm circleFILM_ACROSS_FLATS = 0.1016 # 4 in x 4 in film (product page "Film Size 4 x 4 in std."), cut octagonalCLAMP_TRAVEL_M = 0.003 # pneumatic clamp platen stroke (engineering assumption)CELLS = ('a', 'b')
# ---------------------------------------------------------------- left column: load/unload buttons, status lamps, labelsBUTTON_X = -0.114BUTTON_Z = {'a': 0.191, 'b': 0.098}LAMP_Z = {'a': 0.205, 'b': 0.113}BUTTON_R = 0.0080BEZEL_R = 0.0105
# ---------------------------------------------------------------- touchscreen (tilted tablet above the body)DISPLAY_TILT_RAD = math.radians(16.0) # face tilted back from vertical (photo estimate)DISPLAY_W, DISPLAY_H, DISPLAY_T = 0.252, 0.145, 0.016DISPLAY_HINGE = (0.0, -0.208, 0.357) # centre of the lower back edge lineU = [1.0, 0.0, 0.0]V = [0.0, math.sin(DISPLAY_TILT_RAD), math.cos(DISPLAY_TILT_RAD)]N = [0.0, -math.cos(DISPLAY_TILT_RAD), math.sin(DISPLAY_TILT_RAD)]DISPLAY_CENTER = [DISPLAY_HINGE[0] + V[0] * DISPLAY_H / 2 + N[0] * DISPLAY_T, DISPLAY_HINGE[1] + V[1] * DISPLAY_H / 2 + N[1] * DISPLAY_T, DISPLAY_HINGE[2] + V[2] * DISPLAY_H / 2 + N[2] * DISPLAY_T] # front face centre of the tablet
def panel_point(u, v, n=0.0): """Display-face local (u right, v up the face, n outward) -> asset frame.""" return [DISPLAY_CENTER[i] + u * U[i] + v * V[i] + n * N[i] for i in range(3)]
SCREEN_SIZE = (0.222, 0.125) # active area (10.1 in class, drawing estimate)SCREEN_CENTER_UV = (0.0, 0.002)READOUT_FIELD_U = (0.050, 0.104) # right-hand status column of the engineering UI where the digits sitREADOUT_LINES_V = {'otr_a_digits': 0.030, 'otr_b_digits': 0.000, 'temperature_digits': -0.030}READOUT_DIGIT_H = 0.0105LED_BG = (0.012, 0.020, 0.030)OTR_DISPLAY_SCALE = 22414.0 * 86400.0 # mol/(m2 s) -> cc(STP)/(m2 day)READOUTS = [dict(name='otr_cell_a_sim', part='otr_a_digits', face='N', digits=6, decimals=3, unit='cc/(m2 day)', on=(0.40, 0.86, 0.98), off=LED_BG, blank_channel=None, source={'bridge': ['cell_a.last_otr_mol_m2_s'], 'scale': OTR_DISPLAY_SCALE}), dict(name='otr_cell_b_sim', part='otr_b_digits', face='N', digits=6, decimals=3, unit='cc/(m2 day)', on=(0.98, 0.78, 0.30), off=LED_BG, blank_channel=None, source={'bridge': ['cell_b.last_otr_mol_m2_s'], 'scale': OTR_DISPLAY_SCALE}), dict(name='cell_temperature_sim', part='temperature_digits', face='N', digits=4, decimals=1, unit='C', on=(0.92, 0.94, 0.95), off=LED_BG, blank_channel=None, source={'bridge': ['thermal.indicated_k'], 'offset': -273.15})]LAMPS = [dict(name='cell_a_status', part='lamp_cell_a', face='-Y', digits=0, decimals=0, unit='1', on=(0.20, 0.95, 0.25), off=(0.02, 0.05, 0.03), source={'lamp': {'bridge': 'cell_a.indicator_on'}}), dict(name='cell_b_status', part='lamp_cell_b', face='-Y', digits=0, decimals=0, unit='1', on=(0.20, 0.95, 0.25), off=(0.02, 0.05, 0.03), source={'lamp': {'bridge': 'cell_b.indicator_on'}})]READOUT_NOTE_ZH = ('厂家为彩色触摸屏(WinPerm 2 界面,照片可见OTR曲线、A/B/Z池状态与右侧菜单);本资产在屏幕右侧状态栏叠加三行工程七段读数:A池与B池最近一次报告的OTR' '(cc/(m²·day),由运行层SI值×22414×86400换算)和池温°C,均来自公开传感/报告状态,不是原厂界面、字体或驱动;A-/B-上方的状态灯亮=该池已夹紧' '(灯语为工程映射,厂家未公开)。')
# ---------------------------------------------------------------- behind the cover (2/28 Fig. 2-2 layout)RECESS_PANEL_Y = FRONT_Y - 0.0004 # dark service panel just proud of the face, hidden by the closed coverRECESS_X = (-0.080, 0.080)THERMOMETER_WELL = (0.0, 0.2356) # (x, z) centre, "Temp" well visible through the cover notch (Fig. 2-2 item 12)VENTS = {'vent_zero': (0.071, 0.2751), 'vent_cell_a': (0.071, 0.2510), 'vent_cell_b': (0.071, 0.2276)} # Fig. 2-2 items 9-11 (Z/A/B)TEST_GAS_PORT = (0.0004, 0.2755) # centre fitting behind the cover (manual: cover gives access to the test gas port)AUX_PORT = (0.0573, 0.2309) # small unlabelled fitting next to the B vent (purpose not documented)COVER_SCREWS = [(-0.0398, 0.3139), (0.0399, 0.3139)]COVER_NOTCH = dict(x=(-0.021, 0.021), z=(COVER_Z[0], 0.251))
# ---------------------------------------------------------------- rear panel (2/28 Fig. 2-3 layout)REAR_PANEL_X = (-0.107, 0.107)REAR_PANEL_Z = (0.030, 0.325)GAS_INLETS = {'carrier_gas_inlet': (-0.076, 0.263), 'test_gas_inlet': (-0.057, 0.263)}COOLING_FAN = dict(center=(0.028, 0.220), radius=0.075)ENCLOSURE_FANS = {'enclosure_fan_left': (-0.016, 0.075), 'enclosure_fan_right': (0.066, 0.075)}ENCLOSURE_FAN_R = 0.038POWER_ENTRY = dict(center=(-0.080, 0.060), size=(0.031, 0.049))POWER_SWITCH = dict(center=(-0.080, 0.075), size=(0.018, 0.012))POWER_SWITCH_ON_RAD = 0.30ETHERNET = (0.127, 0.124)USB = {'usb_1': (0.120, 0.076), 'usb_2': (0.134, 0.076)}
# ---------------------------------------------------------------- ports, joints, process mirrorsPORTS = [('carrier_gas_inlet', 'carrier_gas_inlet', 'gas', 'in'), ('test_gas_inlet', 'test_gas_inlet', 'gas', 'in'), ('vent_zero', 'vent_zero', 'gas', 'out'), ('vent_cell_a', 'vent_cell_a', 'gas', 'out'), ('vent_cell_b', 'vent_cell_b', 'gas', 'out'), ('test_gas_outlet', 'test_gas_port', 'gas', 'out'), ('cell_a_film', 'cartridge_a', 'mechanical', 'bidirectional'), ('cell_b_film', 'cartridge_b', 'mechanical', 'bidirectional'), ('thermometer_well', 'thermometer_well', 'thermal', 'in'), ('line_power', 'power_entry', 'electrical', 'in'), ('ethernet', 'ethernet_port', 'data', 'bidirectional'), ('usb_1', 'usb_1', 'data', 'bidirectional'), ('usb_2', 'usb_2', 'data', 'bidirectional'), ('cooling_air', 'cooling_fan', 'thermal', 'out')]# (part, state_id, capability, blender attribute, unit, upper) ; process-authoritative mirrorsMOTION = [('drawer_a', 'drawer_a.position_m', 'drawer.move', 'location[1]', 'm', DRAWER_TRAVEL_M), ('drawer_b', 'drawer_b.position_m', 'drawer.move', 'location[1]', 'm', DRAWER_TRAVEL_M), ('clamp_a', 'clamp_a.position_m', 'cell.load_unload', 'location[2]', 'm', CLAMP_TRAVEL_M), ('clamp_b', 'clamp_b.position_m', 'cell.load_unload', 'location[2]', 'm', CLAMP_TRAVEL_M), ('power_switch', 'power.angle_rad', 'power.set', 'rotation_euler[0]', 'rad', POWER_SWITCH_ON_RAD)]PASSIVE_JOINTS = [('cover', 'cover.angle_rad', COVER_OPEN_RAD)]KEYS = [('button_load_a', 'a'), ('button_load_b', 'b')]KEY_COMMANDS = {'button_load_a': ('cell.load_unload', {'cell': 'A'}), 'button_load_b': ('cell.load_unload', {'cell': 'B'})}
PORT_GEOMETRY = { 'carrier_gas_inlet': dict(pos=[GAS_INLETS['carrier_gas_inlet'][0], REAR_Y + 0.020, GAS_INLETS['carrier_gas_inlet'][1]], insert_axis=[0, -1, 0], radius=0.0016, capture=0.003), 'test_gas_inlet': dict(pos=[GAS_INLETS['test_gas_inlet'][0], REAR_Y + 0.020, GAS_INLETS['test_gas_inlet'][1]], insert_axis=[0, -1, 0], radius=0.0016, capture=0.003), 'vent_zero': dict(pos=[VENTS['vent_zero'][0], RECESS_PANEL_Y - 0.004, VENTS['vent_zero'][1]], insert_axis=[0, 1, 0], radius=0.004, capture=0.003), 'vent_cell_a': dict(pos=[VENTS['vent_cell_a'][0], RECESS_PANEL_Y - 0.004, VENTS['vent_cell_a'][1]], insert_axis=[0, 1, 0], radius=0.004, capture=0.003), 'vent_cell_b': dict(pos=[VENTS['vent_cell_b'][0], RECESS_PANEL_Y - 0.004, VENTS['vent_cell_b'][1]], insert_axis=[0, 1, 0], radius=0.004, capture=0.003), 'test_gas_outlet': dict(pos=[TEST_GAS_PORT[0], RECESS_PANEL_Y - 0.004, TEST_GAS_PORT[1]], insert_axis=[0, 1, 0], radius=0.003, capture=0.003), 'thermometer_well': dict(pos=[THERMOMETER_WELL[0], RECESS_PANEL_Y - 0.002, THERMOMETER_WELL[1]], insert_axis=[0, 1, 0], radius=0.0035, capture=0.003), 'line_power': dict(pos=[POWER_ENTRY['center'][0], REAR_Y + 0.004, POWER_ENTRY['center'][1] - 0.010], insert_axis=[0, -1, 0], radius=0.010, capture=0.004), 'ethernet': dict(pos=[ETHERNET[0], REAR_Y + 0.003, ETHERNET[1]], insert_axis=[0, -1, 0], radius=0.006, capture=0.003), 'usb_1': dict(pos=[USB['usb_1'][0], REAR_Y + 0.003, USB['usb_1'][1]], insert_axis=[0, -1, 0], radius=0.004, capture=0.003), 'usb_2': dict(pos=[USB['usb_2'][0], REAR_Y + 0.003, USB['usb_2'][1]], insert_axis=[0, -1, 0], radius=0.004, capture=0.003), 'cooling_air': dict(pos=[COOLING_FAN['center'][0], REAR_Y + 0.010, COOLING_FAN['center'][1]], insert_axis=[0, 1, 0], radius=COOLING_FAN['radius'], capture=0.01),}for _cell in CELLS: PORT_GEOMETRY[f'cell_{_cell}_film'] = dict(pos=[0.0, FRONT_Y + CARTRIDGE_Y_LOCAL, DRAWER_CENTER_Z[_cell] + CARTRIDGE_Z_LOCAL + CARTRIDGE_SIZE[2] / 2], insert_axis=[0, 0, 1], radius=TEST_WINDOW_D / 2, capture=0.01, access=[f'drawer_{_cell}_joint']) # q=0 pose; rides the drawer linkfor _row in PORT_GEOMETRY.values(): _row.update(position_evidence='geometry_derived_simulation_assumption', capture_evidence='simulation_assumption', note='接口位置取自2/28同机身线图与2/22照片的比例估计;捕获半径为工程几何,真实管径/pinout/机器人接触未验证。')123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177"""CHEM-149 METTLER TOLEDO RC1mx + HFCal (standard torque stirrer, MidTemp oil, AP01-2 glass reactor): single source of theinterface numbers shared by geometry, runtime tests, Matterix metadata and the scene (SI, +Z up, +Y back, origin at the centreof the documented RC1mx footprint, floor Z=0).
Documented (RC1mx User Manual 30357680B, 7.1): the RC1mx with the standard stirrer motor is 669 mm wide, 670 mm deep and1180.5 mm high and weighs 170 kg -- without reactor and touchscreen terminal. Component positions inside that envelope areread from the dimension drawing (manual p.27, rendered at 300 dpi and calibrated on the 669 / 670 / 1180.5 mm dimension lines;the front view is scaled 0.905 mm/px horizontally and 0.956 mm/px vertically, the side view 1.017 / 1.022 mm/px) togetherwith the labelled overview drawings (p.9 front side, p.10 left side, p.11 electronics cabinet bottom); they are drawingestimates with about +-5 mm reading error. The AP01-2 reactor data (2.5 L nominal, 0.5-2 L operating volume, cover ports,anchor stirrer, split-flange oil connections, reactor support in rod clamps and double clamps 120 mm apart) come from the RC1eHigh Performance Thermostat operating instructions (predecessor thermostat, same reactor family); the reactor diameters andwall thicknesses are engineering values. The touchscreen and the emergency button are separate units of the scope ofdelivery; their bench positions are assumptions."""import math
SLUG = 'mt_rc1mxhfcal'# ---- documented envelope of the RC1mx thermostat with the standard stirrer motor (no reactor, no terminal)ENVELOPE_M = (0.669, 0.670, 1.1805)X_LEFT, X_RIGHT = -0.3345, 0.3345 # cabinet left face .. right rod-clamp blocksY_FRONT, Y_BACK = -0.335, 0.335 # stirrer-motor holder arm .. cabinet backTOP_Z = 1.1805 # top of the standard stirrer motor# ---- thermostat: base, rear body (column core), front module, top band, electronics cabinetBASE_Z = 0.031BASE_Y = (-0.115, 0.332)COL_X = (-0.0913, 0.310)COL_Y = (0.030, 0.331) # rear body; its front face is recessed behind the front moduleFRONT_X = (-0.0095, 0.227) # front module between the frame rods (oil connections, rotameter)FRONT_Y = (-0.062, COL_Y[0])COL_TOP_Z = 1.033TOPBAND_Z = (1.002, COL_TOP_Z)CAB_X = (X_LEFT, COL_X[0])CAB_Y = (0.0855, 0.331)CAB_Z = (0.432, 1.031)# ---- accessory frame: two vertical rods in front of the column, two U-bars held by clamp blocks on the corner railsROD_X = (-0.022, 0.238)ROD_Y = -0.103ROD_R = 0.007ROD_TOP_Z = 0.942BAR_Z = (0.500, 0.906) # cross-member heights of the lower and upper U-barBAR_Y = -0.135 # cross members run along X in front of the rodsBAR_X = (-0.058, 0.289) # risers into the clamp blocksBAR_R = 0.006CLAMP_BLOCK_Z = ((0.429, 0.471), (0.835, 0.876))CLAMP_BLOCK_Y = (-0.044, COL_Y[0])CLAMP_BLOCK_X = ((COL_X[0], -0.038), (0.254, X_RIGHT))# ---- stirrer motor on the holder (support clamp on the upper U-bar, horizontal arm, mounting plate)AXIS_X, AXIS_Y = 0.1275, -0.262 # stirrer / reactor axis (front view 0.1274 m, side view -0.262 m)MOTOR_XY = (0.077, 0.075) # motor body width (X) and depth (Y)MOTOR_Z = (0.995, TOP_Z)MOTOR_BAND_Z = (0.985, 0.995)PLATE_X = (0.0615, 0.1928)PLATE_Y = (-0.302, -0.222)PLATE_Z = (0.959, MOTOR_BAND_Z[0])ARM_Z = 0.9735ARM_Y = (-0.151, Y_FRONT + 0.001)CHUCK_Z = (0.935, PLATE_Z[0])# ---- AP01-2 double-wall glass reactor (engineering dimensions; nominal 2.5 L, operating 0.5-2 L documented for the RC1e)REACTOR_INNER_R = 0.060REACTOR_WALL = 0.004JACKET_OUTER_R = 0.080REACTOR_FLANGE_Z = 0.500 # top of the glass flange / cover seatREACTOR_BOTTOM_Z = 0.262 # inner bottomJACKET_Z = (0.214, 0.470)COVER_H = 0.030SUPPORT_RING_Z = (0.476, 0.486) # reactor support (steel ring under the glass flange)SUPPORT_CLAMP_Z = (0.481, 0.361) # rod clamp and double clamp on each frame rod, 120 mm apart (documented distance)NOMINAL_VOLUME_M3 = 2.5e-3OPERATING_VOLUME_M3 = (0.5e-3, 2.0e-3)DRAIN_Z = 0.160 # bottom drain valve body centreOUTLET_Z = 0.100 # BS 29 ball-joint outletIMPELLER_Z = REACTOR_BOTTOM_Z + 0.010 # "position the stirrer about 1 cm above the bottom of the reactor"IMPELLER_D = 0.100 # anchor stirrer diameter (engineering)IMPELLER_H = 0.094PROBE_RING_R = 0.034 # Tr sensor, calibration heater and dip tube stay inside the anchor sweep# cover ports (documented configuration: ST 29/32 centre, ST 45/40, 2 x ST 19/26, 2 x ST 29/32): name -> (dx, dy, neck radius, neck height, joint)COVER_PORTS = { 'central': (0.0, 0.0, 0.016, 0.045, 'ST 29/32'), 'large': (0.0, -0.052, 0.026, 0.036, 'ST 45/40'), 'tr': (-PROBE_RING_R * math.cos(math.radians(30)), PROBE_RING_R * 0.5, 0.012, 0.030, 'ST 19/26'), 'ph': (PROBE_RING_R * math.cos(math.radians(30)), PROBE_RING_R * 0.5, 0.012, 0.030, 'ST 19/26'), 'cal': (-PROBE_RING_R * math.cos(math.radians(30)), -PROBE_RING_R * 0.5, 0.0165, 0.032, 'ST 29/32'), 'dip': (PROBE_RING_R * math.cos(math.radians(30)), -PROBE_RING_R * 0.5, 0.0165, 0.032, 'ST 29/32'),}PROBE_TOP_Z = {'tr': 0.600, 'cal': 0.598, 'dip': 0.585}PROBE_TIP_Z = REACTOR_BOTTOM_Z + 0.045 # immersed at the 0.5 L minimum operating volume (liquid height 44 mm)
def port_top_z(name): return REACTOR_FLANGE_Z + COVER_H + COVER_PORTS[name][3] - 0.004
# ---- oil connections to the reactor on the front module (outlet upper, inlet lower): RC1 nozzle, blue split flange, glass flangeOIL_UPPER = (0.0721, 0.389) # (x, z)OIL_LOWER = (0.1815, 0.2284)OIL_NOZZLE_Y = (FRONT_Y[0], -0.100)OIL_FLANGE_Y = -0.113 # reactor-side glass flange face# ---- front module detailsROTAMETER = dict(x=(0.038, 0.059), z=(0.756, 0.833), panel_x=(0.010, 0.085), panel_z=(0.705, 0.882), knob=(0.0473, 0.731))SOCKET_BOX = dict(x=(COL_X[0], -0.0383), y=(-0.044, COL_Y[0]), z=(0.619, 0.720))TR_SOCKET_XY = (-0.0865, -0.026)CAL_SOCKET_XY = (-0.0743, -0.039)STIRRER_BUTTON_XZ = (-0.081, 0.639)OIL_WINDOW = dict(x=-0.0150, y=(-0.058, -0.046), z=(0.451, 0.615))# ---- left side of the column (below the cabinet): control valve cover, coolant plate, oil drain stopcockVALVE_COVER = dict(y=0.1364, z=0.2690, r=0.057, flange_r=0.098, x0=-0.2266)COOLANT_PLATE = dict(y=(0.042, 0.222), z=(0.044, 0.119))COOLANT_IN_Y, COOLANT_OUT_Y, COOLANT_Z = 0.180, 0.084, 0.082FITTING_X0 = -0.141 # hose-end of the coolant fittingsSTOPCOCK = dict(y=0.132, z=0.083, valve_x=(-0.217, -0.157), end_x=-0.239, handle_top=0.121)INTERFACE_STRIP = dict(y=(0.045, 0.075), z=(0.745, 0.985))# ---- operator units on the bench (assumed placement; separate units in the scope of delivery)TERMINAL_CENTER = (0.470, -0.180) # touchscreen stand (x, y)EMERGENCY_CENTER = (-0.300, -0.285) # emergency (safeguard) button box (x, y)# ---- motion (process-authoritative mirrors) and keysSTIRRER_JOINT_MAX_RAD = 2 * math.pi # the shaft angle is mirrored modulo one turnDRAIN_OPEN_RAD = math.pi / 2MOTION = [('stirrer_shaft', 'stirrer.angle_rad', 'stirrer.set', 'rotation', 'rad', STIRRER_JOINT_MAX_RAD), ('drain_valve_handle', 'drain.angle_rad', 'reactor.discharge', 'rotation', 'rad', DRAIN_OPEN_RAD)]PASSIVE_JOINTS = []KEYS = ['button_power', 'button_stirrer', 'button_emergency']# explicit URDF spring-key joints: press direction into the housing (the Matterix panel pass signs whole-link keys towards the# asset centroid, which inverts the switch under the cabinet and the mushroom on top of the floor box); 1.5 mm travelKEY_AXES = {'button_power': [0.0, 0.0, 1.0], 'button_stirrer': [0.0, 1.0, 0.0], 'button_emergency': [0.0, 0.0, -1.0]}KEY_TRAVEL_M = 0.0015KEY_JOINTS = {k: k + '_joint' for k in KEYS}KEY_COMMANDS = {'button_power': ('power.toggle', {}), 'button_stirrer': ('stirrer.toggle', {}), 'button_emergency': ('emergency.trigger', {})}# ---- simulated overlay readouts on the touchscreen and the status light (not the original iControl GUI)TOUCH = dict(center=(TERMINAL_CENTER[0], TERMINAL_CENTER[1] - 0.0205, 0.300), width=0.250, height=0.160)LED_BG = (0.02, 0.03, 0.04)READOUT_NOTE_ZH = ('RC1mx触摸屏为iControl图形界面;本资产在触摸屏上叠加三行仿真七段读数(Tr °C、Tj °C、转速rpm),不是原厂界面;' '电控柜正面左上角状态灯(厂家:通电后变绿)用绿段表示通电且无急停程序,旁边的红段表示急停程序激活(红色语义为工程约定)。')READOUTS = [dict(name='tr_sim', part='tr_digits', face='-Y', digits=5, decimals=1, unit='C', on=(0.98, 0.55, 0.12), off=LED_BG, blank_channel=None, source={'bridge': ['reactor.indicated_k'], 'offset': -273.15}), dict(name='tj_sim', part='tj_digits', face='-Y', digits=5, decimals=1, unit='C', on=(0.98, 0.55, 0.12), off=LED_BG, blank_channel=None, source={'bridge': ['jacket.indicated_k'], 'offset': -273.15}), dict(name='speed_sim', part='speed_digits', face='-Y', digits=4, decimals=0, unit='rpm', on=(0.98, 0.55, 0.12), off=LED_BG, blank_channel=None, source={'bridge': ['stirrer.indicated_rpm']})]LAMPS = [dict(name='status_ok', part='lamp_status_ok', face='-Y', digits=0, decimals=0, unit='1', on=(0.20, 0.95, 0.25), off=(0.02, 0.05, 0.03), source={'lamp': {'bridge': 'status.ok'}}), dict(name='status_alarm', part='lamp_status_alarm', face='-Y', digits=0, decimals=0, unit='1', on=(1.00, 0.18, 0.12), off=(0.06, 0.02, 0.02), source={'lamp': {'bridge': 'emergency.active'}})]# ---- ports: (name, component, medium, direction)PORTS = [('reactor_port_large', 'reactor_cover', 'liquid', 'in'), ('dosing_dip_tube', 'dip_tube', 'liquid', 'in'), ('drain_outlet', 'drain_valve_body', 'liquid', 'out'), ('tr_sensor_socket', 'front_socket_box', 'electrical', 'bidirectional'), ('calibration_heater_socket', 'front_socket_box', 'electrical', 'in'), ('coolant_in', 'coolant_in_fitting', 'liquid', 'in'), ('coolant_out', 'coolant_out_fitting', 'liquid', 'out'), ('purge_gas_inlet', 'purge_inlet', 'gas', 'in'), ('power_inlet', 'electronics_cabinet', 'electrical', 'in'), ('data_sockets', 'interface_strip', 'data', 'bidirectional'), ('oil_drain', 'oil_drain_stopcock', 'liquid', 'out'), ('probe_port_st19', 'reactor_cover', 'mechanical', 'in')]PORT_MEANING = { 'reactor_port_large': '反应器盖ST 45/40大口(厂家:free, big probes):装料漏斗或大探头(宿主装料代理;本资产只模拟液相物料)', 'dosing_dip_tube': '加料浸管(装在ST 29/32口):外部加料泵/天平送入的加料物流在液面下进入', 'drain_outlet': '反应器底阀出口(BS 29球磨口):放料', 'tr_sensor_socket': '正面插座盒顶部Tr传感器插座(Tr/Trs双Pt100)', 'calibration_heater_socket': '正面插座盒顶部校准加热器插座(HFCal标定热功率)', 'coolant_in': '左侧冷却水进口(≥10 L/min)', 'coolant_out': '左侧冷却水出口', 'purge_gas_inlet': '电控柜底部惰性吹扫气接口(Purge-1油箱/Purge-2电控柜;最高0.5 bar,≥80 mL/min)', 'power_inlet': '电控柜底部电源线接口(Type L 200–240 V 3~ / Type H 350–415 V 3N~,最大4800 W)', 'data_sockets': '立柱左侧接口条:CAN-1 Out、USB×4、以太网、触摸屏(Control unit)、RS-232×2', 'oil_drain': '放油旋塞(仅室温下操作)', 'probe_port_st19': '反应器盖ST 19/26空口(厂家:free, pH electrodes),参考姿态用玻璃塞封住'}_R_TOP = REACTOR_FLANGE_Z + COVER_HPORT_GEOMETRY = { # insert_axis = outward normal of the interface (slot local +Z) 'reactor_port_large': dict(pos=[AXIS_X + COVER_PORTS['large'][0], AXIS_Y + COVER_PORTS['large'][1], port_top_z('large')], insert_axis=[0, 0, 1], radius=0.0225, capture=0.03, access=[]), 'dosing_dip_tube': dict(pos=[AXIS_X + COVER_PORTS['dip'][0], AXIS_Y + COVER_PORTS['dip'][1], PROBE_TOP_Z['dip'] + 0.020], insert_axis=[0, 0, 1], radius=0.003, capture=0.02, access=[]), 'drain_outlet': dict(pos=[AXIS_X, AXIS_Y, OUTLET_Z], insert_axis=[0, 0, -1], radius=0.0145, capture=0.03, access=[]), 'tr_sensor_socket': dict(pos=[TR_SOCKET_XY[0], TR_SOCKET_XY[1], SOCKET_BOX['z'][1] + 0.010], insert_axis=[0, 0, 1], radius=0.005, capture=0.01, access=[]), 'calibration_heater_socket': dict(pos=[CAL_SOCKET_XY[0], CAL_SOCKET_XY[1], SOCKET_BOX['z'][1] + 0.010], insert_axis=[0, 0, 1], radius=0.005, capture=0.01, access=[]), 'coolant_in': dict(pos=[FITTING_X0, COOLANT_IN_Y, COOLANT_Z], insert_axis=[-1, 0, 0], radius=0.009, capture=0.02, access=[]), 'coolant_out': dict(pos=[FITTING_X0, COOLANT_OUT_Y, COOLANT_Z], insert_axis=[-1, 0, 0], radius=0.009, capture=0.02, access=[]), 'purge_gas_inlet': dict(pos=[-0.253, 0.245, CAB_Z[0] - 0.014], insert_axis=[0, 0, -1], radius=0.004, capture=0.01, access=[]), 'power_inlet': dict(pos=[-0.300, 0.297, CAB_Z[0] - 0.030], insert_axis=[0, 0, -1], radius=0.008, capture=0.02, access=[]), 'data_sockets': dict(pos=[COL_X[0] - 0.009, sum(INTERFACE_STRIP['y']) / 2, 0.865], insert_axis=[-1, 0, 0], radius=0.006, capture=0.02, access=[]), 'oil_drain': dict(pos=[STOPCOCK['end_x'], STOPCOCK['y'], STOPCOCK['z']], insert_axis=[-1, 0, 0], radius=0.004, capture=0.02, access=[]), 'probe_port_st19': dict(pos=[AXIS_X + COVER_PORTS['ph'][0], AXIS_Y + COVER_PORTS['ph'][1], port_top_z('ph')], insert_axis=[0, 0, 1], radius=0.0094, capture=0.01, access=[]),}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213{ "catalog_id": "CHEM-149", "asset_type_id": "instrument.mt_rc1mxhfcal", "fitted_at": "2026-09-25T14:06:15.065137+00:00", "source": { "digitised": "outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/source_cache/rc1e_curves_digitized.json", "digitised_sha256": "a304be87363253febbb6ab66f9555e95fd46053115a98886ccfc9e3a745677cd", "document": "RC1e High Performance Thermostat operating instructions 9.6 (curves 1-4)" }, "documented_inputs": { "heater_w": 2000.0, "stationary_cooling_w": 100.0, "coolant": "water approx. 16 C, approx. 10 L/min", "stirrer": "glass anchor, 200 rpm", "tr_controller": "P 9, P-only (RC1e software presets the reset time to 999999 s)", "tdiff_max_k": 50.0 }, "fixed_engineering": { "ambient_k": 295.15, "coolant_k": 289.15, "coolant_flow_m3_s": 0.00016666666666666666, "phi_wall_w_m2k": 239.4957983193277, "kp_tj_w_k": 1000.0, "ti_tj_s": 60.0, "l_cold_w_k": 3.0, "ua_empty_w_k": 1.0, "glycerol_viscosity_pa_s_for_stirrer_power": 1.4, "c_ins_j_k": 150.0, "trouton_j_mol_k": 88.0 }, "switch_times_s": { "curve1_empty_Tj_mode": { "setpoint_up": 247.34104929811565, "setpoint_down_or_emergency": 1803.763799892292 }, "curve2_1L_water_Tr_mode": { "setpoint_up": 303.9352502954275, "setpoint_down_or_emergency": 1679.600074502595 }, "curve3_2L_water_Tr_mode": { "setpoint_up": 303.92054350056833, "setpoint_down_or_emergency": 1770.9332896409342 }, "curve4_1L_glycerol_Tr_mode_emergency_A": { "setpoint_up": 228.36096039368067, "setpoint_down_or_emergency": 3122.5245783126466 } }, "fitted": { "C_J": 9041.874300591024, "L_J": 6.7099936470968515, "G_VALVE": 57.1017655334523, "G_SAFETY": 55.897521747119924, "C_C": 31966.789471394164, "UA_COIL": 289.93684619975585, "P_COLD": 494.44818543289637, "L_R": 0.005165576774617651, "K_EV": 6.787810436983388e-06, "U_W200": 181.31071468466538, "U_GLY": 166.91544060181752 }, "derived": { "h_ref_water_200rpm_w_m2k": 746.2935798099212, "ua_1l_water_w_k": 7.644651508488009, "ua_2l_water_w_k": 13.688341997976853, "ua_1l_glycerol_w_k": 7.037699768631188, "wetted_area_1l_m2": 0.04216326388533378, "wetted_area_2l_m2": 0.0754965972186671, "coolant_conductance_w_k": 237.17088334134425 }, "optimizer": { "method": "scipy.optimize.least_squares (trf, log-parameters)", "status": 3, "nfev": 17, "cost": 21.279577517951356 }, "residuals": { "curve1_empty_Tj_mode": { "Tj": { "rmse_k": 1.3685188670811057, "max_abs_k": 9.034401696985583, "samples": 236 }, "Tc": { "rmse_k": 1.315883339302206, "max_abs_k": 5.394606689113402, "samples": 240 } }, "curve2_1L_water_Tr_mode": { "Tj": { "rmse_k": 2.343716793338593, "max_abs_k": 16.442772339834505, "samples": 297 }, "Tr": { "rmse_k": 1.525721450893809, "max_abs_k": 4.375378325358099, "samples": 293 }, "Tc": { "rmse_k": 1.7309738168401383, "max_abs_k": 3.9576460621627234, "samples": 279 } }, "curve3_2L_water_Tr_mode": { "Tj": { "rmse_k": 4.202860151557892, "max_abs_k": 25.254772971253885, "samples": 389 }, "Tr": { "rmse_k": 2.4323095647355304, "max_abs_k": 4.029789042212428, "samples": 392 }, "Tc": { "rmse_k": 1.37081467259648, "max_abs_k": 4.399073530940598, "samples": 415 } }, "curve4_1L_glycerol_Tr_mode_emergency_A": { "Tj": { "rmse_k": 2.0647076842739014, "max_abs_k": 11.314607273654246, "samples": 425 }, "Tr": { "rmse_k": 1.6655092865916512, "max_abs_k": 4.382584347553177, "samples": 396 }, "Tc": { "rmse_k": 1.5448449369561523, "max_abs_k": 7.53264744696628, "samples": 427 } } }, "rate_check": { "curve1_empty_Tj_mode_heating": { "trace": "Tj", "from_c": 60.0, "to_c": 180.0, "manufacturer_s": 948.0368792588029, "model_s": 924.0, "model_over_manufacturer": 0.9746456284721798 }, "curve1_empty_Tj_mode_cooling": { "trace": "Tj", "from_c": 180.0, "to_c": 60.0, "manufacturer_s": 216.4808621929551, "model_s": 234.0, "model_over_manufacturer": 1.0809269587601218 }, "curve2_1L_water_Tr_mode_heating": { "trace": "Tr", "from_c": 40.0, "to_c": 90.0, "manufacturer_s": 559.1747968911573, "model_s": 604.0, "model_over_manufacturer": 1.0801631320976148 }, "curve2_1L_water_Tr_mode_cooling": { "trace": "Tr", "from_c": 90.0, "to_c": 40.0, "manufacturer_s": 816.3952034610902, "model_s": 882.0, "model_over_manufacturer": 1.0803591156106498 }, "curve3_2L_water_Tr_mode_heating": { "trace": "Tr", "from_c": 40.0, "to_c": 90.0, "manufacturer_s": 726.0286421380833, "model_s": 706.0, "model_over_manufacturer": 0.972413426997727 }, "curve3_2L_water_Tr_mode_cooling": { "trace": "Tr", "from_c": 90.0, "to_c": 40.0, "manufacturer_s": 1195.1548416734604, "model_s": 1042.0, "model_over_manufacturer": 0.8718535571014276 }, "curve4_1L_glycerol_Tr_mode_emergency_A_heating": { "trace": "Tr", "from_c": 40.0, "to_c": 180.0, "manufacturer_s": 1573.8879468579944, "model_s": 1612.0, "model_over_manufacturer": 1.0242152265147528 }, "curve4_1L_glycerol_Tr_mode_emergency_A_cooling": { "trace": "Tr", "from_c": 180.0, "to_c": 60.0, "manufacturer_s": 768.2960119733343, "model_s": 734.0, "model_over_manufacturer": 0.9553609397434636 } }, "limitations_zh": [ "拟合对象是前代RC1e与AP01-2的厂家“典型曲线”(仅作示意),RC1mx厂家未给同类曲线;拟合常数是集总工程值,不是部件实测。", "室温22°C、Tj PI增益、壁+油膜导热phi与冷回路室温得热为固定工程值;曲线的设定值切换时刻由数字化曲线读出。", "甘油曲线的U_GLY只用于该曲线(黏度随温度大幅变化,本模型的液膜系数不含温度依赖)。" ]}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192"""CHEM-148 NETZSCH MMC 315 Nexus + ARC module: single source of the interface numbers shared by geometry, runtime tests,Matterix metadata and the scene (SI, +Z up, +Y back, origin at the footprint centre, floor Z=0).
No manufacturer body dimensions or masses are public (workbook: "未取得本体外形或质量"): every dimension below is anengineering value read from the proportions of the two manufacturer photographs (2026 overview p.24 MMC 315 Nexus; MMC 274Nexus brochure p.2), except the sample container: its 10.028 g mass is the titanium sphere of the manufacturer's DTBP example and its innervolume is assumed at the documented 8.5 ml maximum (the example gives no volume)."""import math
SLUG = 'netzsch_mmc315'FOOT_H = 0.022# ---- base unit (white): left curved electronics housing + right module bay plinth + rear docking towerHOUSING_X = (-0.310, -0.040)BODY_Y = (-0.280, 0.300)HOUSING_FRONT_H = 0.240 # vertical front face height before the curved topHOUSING_TOP_Z = 0.480HOUSING_ARC_R = 0.240PLINTH_X = (-0.040, 0.310)PLINTH_TOP_Z = 0.110DOCK_Y = (0.200, 0.300)DOCK_TOP_Z = 0.300# ---- pull-out slide tray carrying the moduleTRAY_X = (0.000, 0.280)TRAY_Y = (-0.250, 0.170)TRAY_Z = (0.122, 0.132) # plate; telescopic rails below it 0.110-0.122TRAY_TRAVEL_M = 0.250 # prismatic -Y (towards the operator)HANDLE_Y = -0.268# ---- ARC module (child of the tray) in tray-plate coordinates (origin = tray plate top centre)TRAY_TOP_CENTER = ((TRAY_X[0] + TRAY_X[1]) / 2, (TRAY_Y[0] + TRAY_Y[1]) / 2 - 0.010, TRAY_Z[1])MODULE_R = 0.110MODULE_BODY_Z = (0.050, 0.350) # above the tray plateRING_Z = 0.300LID_H = 0.050LID_HINGE = (0.0, MODULE_R - 0.004, MODULE_BODY_Z[1]) # rear top edge, axis -X (front edge lifts)LID_OPEN_RAD = 1.90CAVITY_R = 0.050CAVITY_DEPTH = 0.120# ---- sample container: titanium sphere, 10.028 g documented, 8.5 ml assumed (documented maximum); outer radius derived (Ti 4.51 g/cm3)CONTAINER_VOLUME_M3 = 8.5e-6CONTAINER_MASS_KG = 10.028e-3TI_DENSITY = 4510.0R_INNER = (3 * CONTAINER_VOLUME_M3 / (4 * math.pi)) ** (1 / 3)R_OUTER = (R_INNER ** 3 + 3 * CONTAINER_MASS_KG / TI_DENSITY / (4 * math.pi)) ** (1 / 3)BOMB_CENTER_Z = MODULE_BODY_Z[1] - 0.060 # sphere centre below the lid plane, in module coordinates# ---- controls and readouts (status panel on the housing front)STATUS_PANEL = dict(center_x=-0.175, z=(0.080, 0.230), width=0.120)POWER_SWITCH = (-0.250, 0.300, 0.090) # rear panel rocker (x, y, z)POWER_SWITCH_ON_RAD = 0.30READOUT_NOTE_ZH = ('MMC 315 Nexus主机正面只有状态指示区,测量由Proteus软件完成;状态面板上的两行七段读数(样品温度°C、压力bar)是本资产的仿真叠加显示,' '不是原厂界面;两个状态灯=通电、测试进行中(工程灯语)。')LED_BG = (0.012, 0.02, 0.03)READOUTS = [dict(name='sample_temperature_sim', part='temperature_digits', face='-Y', digits=5, decimals=1, unit='C', on=(0.98, 0.55, 0.12), off=LED_BG, blank_channel=None, source={'bridge': ['sample.indicated_k'], 'offset': -273.15}), dict(name='pressure_sim', part='pressure_digits', face='-Y', digits=5, decimals=2, unit='bar', on=(0.98, 0.55, 0.12), off=LED_BG, blank_channel=None, source={'bridge': ['pressure.indicated_pa'], 'scale': 1e-5})]LAMPS = [dict(name='power_status', part='lamp_power', face='-Y', digits=0, decimals=0, unit='1', on=(0.20, 0.95, 0.25), off=(0.02, 0.05, 0.03), source={'lamp': {'bridge': 'power.enabled'}}), dict(name='run_status', part='lamp_run', face='-Y', digits=0, decimals=0, unit='1', on=(0.25, 0.55, 1.00), off=(0.02, 0.03, 0.06), source={'lamp': {'bridge': 'test.running'}})]# (part, state_id, capability, blender attribute, unit, upper) : process-authoritative mirrorsMOTION = [('tray', 'tray.position_m', 'tray.move', 'location', 'm', TRAY_TRAVEL_M), ('lid', 'lid.angle_rad', 'lid.set', 'rotation', 'rad', LID_OPEN_RAD), ('power_switch', 'power.angle_rad', 'power.set', 'rotation', 'rad', POWER_SWITCH_ON_RAD)]PASSIVE_JOINTS = []KEYS = []KEY_COMMANDS = {}_MX, _MY, _MZ = TRAY_TOP_CENTERPORTS = [('bomb_seat', 'sample_container', 'mechanical', 'bidirectional'), ('tray_handle', 'tray_handle', 'mechanical', 'bidirectional'), ('lid_grip', 'lid', 'mechanical', 'bidirectional'), ('pressure_feedthrough', 'pressure_line', 'gas', 'out'), ('thermocouple_clip', 'sample_thermocouple', 'electrical', 'out'), ('module_dock', 'dock_socket', 'electrical', 'bidirectional'), ('line_power', 'power_entry', 'electrical', 'in'), ('usb', 'usb_port', 'data', 'bidirectional'), ('ethernet', 'ethernet_port', 'data', 'bidirectional'), ('cooling_air', 'cooling_fan', 'gas', 'out')]PORT_MEANING = { 'bomb_seat': '量热腔内样品容器位(顶盖打开后放入/取出装样钛球并接取压管与热电偶)', 'tray_handle': '托盘前把手(拉出/推回模块托��)', 'lid_grip': '模块顶盖前缘把手(开/合量热腔)', 'pressure_feedthrough': '取压管后侧穿舱接头(样品容器→压力传感器)', 'thermocouple_clip': '样品热电偶在钛球赤道的夹持点', 'module_dock': '对接塔插座(加热器、热电偶、压力信号)', 'line_power': '电源输入(额定值厂家未公开)', 'usb': 'USB(连接Proteus电脑;接口类型为工程假设)', 'ethernet': '以太网(工程假设)', 'cooling_air': '冷却风扇排风口(冷却阶段)'}_NOTE = '接口位置由本资产照片比例几何推得(工程估计);捕获半径为工程几何,真实接头规格/pinout/机器人接触未验证。'PORT_GEOMETRY = { 'bomb_seat': dict(pos=[_MX, _MY, _MZ + BOMB_CENTER_Z + R_OUTER], insert_axis=[0, 0, 1], radius=R_OUTER, capture=0.02, access=['lid_joint']), 'tray_handle': dict(pos=[_MX, HANDLE_Y - 0.006, TRAY_Z[1] + 0.018], insert_axis=[0, -1, 0], radius=0.006, capture=0.03, access=[]), 'lid_grip': dict(pos=[_MX, _MY + LID_HINGE[1] - LID_HINGE[1] - MODULE_R + 0.020, _MZ + MODULE_BODY_Z[1] + LID_H + 0.018], insert_axis=[0, 0, 1], radius=0.012, capture=0.03, access=[]), 'pressure_feedthrough': dict(pos=[_MX, _MY + MODULE_R + 0.010, _MZ + MODULE_BODY_Z[1] - 0.006], insert_axis=[0, 1, 0], radius=0.004, capture=0.01, access=[]), 'thermocouple_clip': dict(pos=[_MX + R_OUTER, _MY, _MZ + BOMB_CENTER_Z], insert_axis=[0, 0, 1], radius=0.0008, capture=0.005, access=['lid_joint']), 'module_dock': dict(pos=[0.20, DOCK_Y[0] - 0.020, PLINTH_TOP_Z + 0.060], insert_axis=[0, -1, 0], radius=0.02, capture=0.02, access=[]), 'line_power': dict(pos=[-0.270, BODY_Y[1] + 0.012, 0.090], insert_axis=[0, 1, 0], radius=0.012, capture=0.015, access=[]), 'usb': dict(pos=[-0.150, BODY_Y[1] + 0.008, 0.090], insert_axis=[0, 1, 0], radius=0.006, capture=0.01, access=[]), 'ethernet': dict(pos=[-0.110, BODY_Y[1] + 0.008, 0.090], insert_axis=[0, 1, 0], radius=0.007, capture=0.01, access=[]), 'cooling_air': dict(pos=[-0.175, BODY_Y[1] + 0.012, 0.340], insert_axis=[0, 1, 0], radius=0.040, capture=0.04, access=[]),}for _v in PORT_GEOMETRY.values(): _v.update(position_evidence='geometry_derived_simulation_assumption', capture_evidence='simulation_assumption', note=_NOTE)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201{ "catalog_id": "CHEM-148", "status": "passed", "checked_at": "2026-09-24T22:01:07.419189+00:00", "library_sha256": "656294b299473c6192d21d94e2c61129e6299439aed71f856a0aac930e0e1783", "distinct_substances": 51, "max_half_life_deviation_K": 1.062, "method": "re-extract each cited pdftotext line from the hashed cache and match printed A, Ea and half-life temperatures; verbatim DTBP ARC values; PubChem/NIST rows", "checks": [ { "id": "sha256_SICA_en_web.pdf", "status": "passed", "detail": null }, { "id": "sha256_MMC_274_Nexus_en_web.pdf", "status": "passed", "detail": null }, { "id": "sha256_nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "status": "passed", "detail": null }, { "id": "sha256_nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "status": "passed", "detail": null }, { "id": "sha256_nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "status": "passed", "detail": null }, { "id": "sha256_arkema_luperox_brochure.pdf", "status": "passed", "detail": null }, { "id": "sha256_acc_safety_handling_organic_peroxides.pdf", "status": "passed", "detail": null }, { "id": "sha256_nist_toluene_phase.html", "status": "passed", "detail": null }, { "id": "sha256_pubchem_cas_verification.json", "status": "passed", "detail": null }, { "id": "unique_id_diisobutyryl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_diisobutyryl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_diisobutyryl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_diisobutyryl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 521, "text": "Diisobutyryl peroxide [3437-84-1] 174.2 9.18 ", "A": "3.37E+14", "Ea": 109.06, "temps_C": [ 57, 39, 23 ] } }, { "id": "name_block_diisobutyryl_peroxide_0", "status": "passed", "detail": { "cas": "3437-84-1" } }, { "id": "half_life_consistency_diisobutyryl_peroxide_0", "status": "passed", "detail": 0.22 }, { "id": "primary_kinetics_is_a_measurement_diisobutyryl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_diisobutyryl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_cumyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_cas_cumyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "cas_format_cumyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "line_values_cumyl_peroxyneodecanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 531, "text": "Cumyl peroxyneodecanoate [26748-47-0] 306.4 5.22 ", "A": "3.12E+14", "Ea": 114.59, "temps_C": [ 75, 56, 38 ] } }, { "id": "name_block_cumyl_peroxyneodecanoate_0", "status": "passed", "detail": { "cas": "26748-47-0" } }, { "id": "half_life_consistency_cumyl_peroxyneodecanoate_0", "status": "passed", "detail": 0.453 }, { "id": "primary_kinetics_is_a_measurement_cumyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_cumyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_id_1_1_3_3_tetramethylbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_3_3_tetramethylbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "cas_format_1_1_3_3_tetramethylbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "line_values_1_1_3_3_tetramethylbutyl_peroxyneodecanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 540, "text": "1,1,3,3-Tetramethylbutyl peroxyneodecanoate [51240-95-0] 300.5 5.32 ", "A": "3.98E+14", "Ea": 115.79, "temps_C": [ 76, 57, 40 ] } }, { "id": "name_block_1_1_3_3_tetramethylbutyl_peroxyneodecanoate_0", "status": "passed", "detail": { "cas": "51240-95-0" } }, { "id": "half_life_consistency_1_1_3_3_tetramethylbutyl_peroxyneodecanoate_0", "status": "passed", "detail": 0.453 }, { "id": "primary_kinetics_is_a_measurement_1_1_3_3_tetramethylbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_3_3_tetramethylbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_id_tamyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_cas_tamyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "cas_format_tamyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "line_values_tamyl_peroxyneodecanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 549, "text": "tert-Amyl peroxyneodecanoate [68299-16-1] 258.4 6.19 ", "A": "1.47E+14", "Ea": 114.38, "temps_C": [ 81, 61, 43 ] } }, { "id": "name_block_tamyl_peroxyneodecanoate_0", "status": "passed", "detail": { "cas": "68299-16-1" } }, { "id": "half_life_consistency_tamyl_peroxyneodecanoate_0", "status": "passed", "detail": 0.453 }, { "id": "primary_kinetics_is_a_measurement_tamyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_id_di_sec_butyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_di_sec_butyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_di_sec_butyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_di_sec_butyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 558, "text": "Di-sec-butyl peroxydicarbonate [19910-65-7] 234.2 6.83 ", "A": "3.19E+15", "Ea": 123.85, "temps_C": [ 82, 63, 47 ] } }, { "id": "name_block_di_sec_butyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "19910-65-7" } }, { "id": "half_life_consistency_di_sec_butyl_peroxydicarbonate_0", "status": "passed", "detail": 0.453 }, { "id": "primary_kinetics_is_a_measurement_di_sec_butyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_sec_butyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_diisopropyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_diisopropyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_diisopropyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_diisopropyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "line": 442, "text": "Diisopropyl peroxydicarbonate [105-64-6] 206.2 7.76 ", "A": "3.35E+15", "Ea": 124.01, "temps_C": [ 82, 64, 47 ] } }, { "id": "name_block_diisopropyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "105-64-6" } }, { "id": "half_life_consistency_diisopropyl_peroxydicarbonate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_diisopropyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_diisopropyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxyneodecanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 601, "text": "tert-Butyl peroxyneodecanoate [26748-41-4] 244.4 6.55 ", "A": "1.52E+14", "Ea": 115.47, "temps_C": [ 84, 64, 46 ] } }, { "id": "name_block_tbutyl_peroxyneodecanoate_0", "status": "passed", "detail": { "cas": "26748-41-4" } }, { "id": "half_life_consistency_tbutyl_peroxyneodecanoate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxyneodecanoate", "status": "passed", "detail": null }, { "id": "unique_id_di_2_ethylhexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_di_2_ethylhexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_di_2_ethylhexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_di_2_ethylhexyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 591, "text": "Di(2-ethylhexyl) peroxydicarbonate [16111-62-9] 346.5 4.62 ", "A": "1.83E+15", "Ea": 122.45, "temps_C": [ 83, 64, 47 ] } }, { "id": "name_block_di_2_ethylhexyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "16111-62-9" } }, { "id": "half_life_consistency_di_2_ethylhexyl_peroxydicarbonate_0", "status": "passed", "detail": 0.491 }, { "id": "line_values_di_2_ethylhexyl_peroxydicarbonate_1", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "line": 449, "text": "Di(2-ethylhexyl) peroxydicarbonate [16111-62-9]] 346.5 4.62 ", "A": "1.52E+14", "Ea": 115.47, "temps_C": [ 84, 64, 46 ] } }, { "id": "name_block_di_2_ethylhexyl_peroxydicarbonate_1", "status": "passed", "detail": { "cas": "16111-62-9" } }, { "id": "half_life_consistency_di_2_ethylhexyl_peroxydicarbonate_1", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_di_2_ethylhexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_2_ethylhexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_di_4_tbutylcyclohexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_di_4_tbutylcyclohexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_di_4_tbutylcyclohexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_di_4_tbutylcyclohexyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 567, "text": "Di(4-tert-butylcyclohexyl) peroxydicarbonate [15520-11-3] 398.5 4.01 ", "A": "7.44E+15", "Ea": 126.39, "temps_C": [ 82, 64, 48 ] } }, { "id": "name_block_di_4_tbutylcyclohexyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "15520-11-3" } }, { "id": "half_life_consistency_di_4_tbutylcyclohexyl_peroxydicarbonate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_di_4_tbutylcyclohexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_4_tbutylcyclohexyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_dimyristyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_dimyristyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_dimyristyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_dimyristyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 619, "text": "Dimyristyl peroxydicarbonate [53220-22-7] 514.8 3.11 ", "A": "2.82E+15", "Ea": 124.1, "temps_C": [ 84, 65, 48 ] } }, { "id": "name_block_dimyristyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "53220-22-7" } }, { "id": "half_life_consistency_dimyristyl_peroxydicarbonate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_dimyristyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_dimyristyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_dicetyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_cas_dicetyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "cas_format_dicetyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "line_values_dicetyl_peroxydicarbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 609, "text": "Dicetyl peroxydicarbonate [26322-14-5] 570.9 2.80 ", "A": "3.02E+15", "Ea": 124.3, "temps_C": [ 84, 65, 48 ] } }, { "id": "name_block_dicetyl_peroxydicarbonate_0", "status": "passed", "detail": { "cas": "26322-14-5" } }, { "id": "half_life_consistency_dicetyl_peroxydicarbonate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_dicetyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_dicetyl_peroxydicarbonate", "status": "passed", "detail": null }, { "id": "unique_id_1_1_3_3_tetramethylbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_3_3_tetramethylbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "cas_format_1_1_3_3_tetramethylbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "line_values_1_1_3_3_tetramethylbutyl_peroxypivalate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 629, "text": "1,1,3,3-Tetramethylbutyl peroxypivalate [22288-41-1] 230.3 6.95 ", "A": "2.47E+14", "Ea": 117.5, "temps_C": [ 86, 66, 48 ] } }, { "id": "name_block_1_1_3_3_tetramethylbutyl_peroxypivalate_0", "status": "passed", "detail": { "cas": "22288-41-1" } }, { "id": "half_life_consistency_1_1_3_3_tetramethylbutyl_peroxypivalate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_1_1_3_3_tetramethylbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_3_3_tetramethylbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_id_di_2_4_dichlorobenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_di_2_4_dichlorobenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_di_2_4_dichlorobenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_di_2_4_dichlorobenzoyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 831, "text": "PERKADOX PD Di(2,4-dichlorobenzoyl) peroxide VMQ 89 68 49 112.4 3.21E+13", "A": "3.21E+13", "Ea": 112.4, "temps_C": [ 89, 68, 49 ] } }, { "id": "name_block_di_2_4_dichlorobenzoyl_peroxide_0", "status": "passed", "detail": { "cas": "133-14-2" } }, { "id": "half_life_consistency_di_2_4_dichlorobenzoyl_peroxide_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_di_2_4_dichlorobenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_2_4_dichlorobenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_tamyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_cas_tamyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "cas_format_tamyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "line_values_tamyl_peroxypivalate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 638, "text": "tert-Amyl peroxypivalate [29240-17-3] 188.3 8.50 ", "A": "4.12E+15", "Ea": 127.76, "temps_C": [ 91, 72, 55 ] } }, { "id": "name_block_tamyl_peroxypivalate_0", "status": "passed", "detail": { "cas": "29240-17-3" } }, { "id": "half_life_consistency_tamyl_peroxypivalate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_tamyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxypivalate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 662, "text": "tert-Butyl peroxypivalate [927-07-1] 174.2 9.18 ", "A": "7.09E+14", "Ea": 123.59, "temps_C": [ 94, 75, 57 ] } }, { "id": "name_block_tbutyl_peroxypivalate_0", "status": "passed", "detail": { "cas": "927-07-1" } }, { "id": "half_life_consistency_tbutyl_peroxypivalate_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxypivalate", "status": "passed", "detail": null }, { "id": "unique_id_di_3_5_5_trimethylhexanoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_di_3_5_5_trimethylhexanoyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_di_3_5_5_trimethylhexanoyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_di_3_5_5_trimethylhexanoyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 672, "text": "Di(3,5,5-trimethylhexanoyl) peroxide [3851-87-4] 314.5 5.09 ", "A": "2.84E+15", "Ea": 128.34, "temps_C": [ 96, 77, 59 ] } }, { "id": "name_block_di_3_5_5_trimethylhexanoyl_peroxide_0", "status": "passed", "detail": { "cas": "3851-87-4" } }, { "id": "half_life_consistency_di_3_5_5_trimethylhexanoyl_peroxide_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_di_3_5_5_trimethylhexanoyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_3_5_5_trimethylhexanoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_dilauroyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_dilauroyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_dilauroyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_dilauroyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 684, "text": "Dilauroyl peroxide [105-74-8] 398.6 4.01 ", "A": "3.92E+14", "Ea": 123.37, "temps_C": [ 99, 79, 61 ] } }, { "id": "name_block_dilauroyl_peroxide_0", "status": "passed", "detail": { "cas": "105-74-8" } }, { "id": "half_life_consistency_dilauroyl_peroxide_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_dilauroyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_dilauroyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_2_2_azodi_isobutyronitrile", "status": "passed", "detail": null }, { "id": "unique_cas_2_2_azodi_isobutyronitrile", "status": "passed", "detail": null }, { "id": "cas_format_2_2_azodi_isobutyronitrile", "status": "passed", "detail": null }, { "id": "line_values_2_2_azodi_isobutyronitrile_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 693, "text": "2,2’-Azodi(isobutyronitrile) [78-67-1] 164.2 ", "A": "2.89E+15", "Ea": 130.23, "temps_C": [ 101, 82, 64 ] } }, { "id": "name_block_2_2_azodi_isobutyronitrile_0", "status": "passed", "detail": { "cas": "78-67-1" } }, { "id": "half_life_consistency_2_2_azodi_isobutyronitrile_0", "status": "passed", "detail": 0.491 }, { "id": "primary_kinetics_is_a_measurement_2_2_azodi_isobutyronitrile", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_2_azodi_isobutyronitrile", "status": "passed", "detail": null }, { "id": "unique_id_di_4_methylbenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_di_4_methylbenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_di_4_methylbenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_di_4_methylbenzoyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 829, "text": "PERKADOX PM Di(4-methylbenzoyl) peroxide VMQ 106 84 64 115.6 1.69E+13", "A": "1.69E+13", "Ea": 115.6, "temps_C": [ 106, 84, 64 ] } }, { "id": "name_block_di_4_methylbenzoyl_peroxide_0", "status": "passed", "detail": { "cas": "895-85-2" } }, { "id": "half_life_consistency_di_4_methylbenzoyl_peroxide_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_di_4_methylbenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_4_methylbenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_2_2_azodi_2_methylbutyronitrile", "status": "passed", "detail": null }, { "id": "unique_cas_2_2_azodi_2_methylbutyronitrile", "status": "passed", "detail": null }, { "id": "cas_format_2_2_azodi_2_methylbutyronitrile", "status": "passed", "detail": null }, { "id": "line_values_2_2_azodi_2_methylbutyronitrile_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 702, "text": "2,2’-Azodi(2-methylbutyronitrile) [13472-08-7] 192.3 ", "A": "1.38E+15", "Ea": 128.93, "temps_C": [ 104, 84, 66 ] } }, { "id": "name_block_2_2_azodi_2_methylbutyronitrile_0", "status": "passed", "detail": { "cas": "13472-08-7" } }, { "id": "half_life_consistency_2_2_azodi_2_methylbutyronitrile_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_2_2_azodi_2_methylbutyronitrile", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_2_azodi_2_methylbutyronitrile", "status": "passed", "detail": null }, { "id": "unique_id_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane", "status": "passed", "detail": null }, { "id": "unique_cas_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane", "status": "passed", "detail": null }, { "id": "cas_format_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane", "status": "passed", "detail": null }, { "id": "line_values_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 711, "text": "2,5-Dimethyl-2,5-di(2-ethylhexanoylperoxy)hexane [13052-09-0] 430.6 7.43 ", "A": "2.19E+15", "Ea": 130.88, "temps_C": [ 105, 86, 68 ] } }, { "id": "name_block_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane_0", "status": "passed", "detail": { "cas": "13052-09-0" } }, { "id": "half_life_consistency_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_5_dimethyl_2_5_di_2_ethylhexanoylperoxy_hexane", "status": "passed", "detail": null }, { "id": "unique_id_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "cas_format_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "line_values_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 742, "text": "1,1,3,3-Tetramethylbutyl peroxy-2-ethylhexanoate [22288-43-3] 272.4 5.87 109 88 ", "A": "1.62E+14", "Ea": 123.8, "temps_C": [ 109, 88, 69 ] } }, { "id": "name_block_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "cas": "22288-43-3" } }, { "id": "half_life_consistency_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_3_3_tetramethylbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_id_tamyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_cas_tamyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "cas_format_tamyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "line_values_tamyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 752, "text": "tert-Amyl peroxy-2-ethylhexanoate [686-31-7] 230.3 6.95 111 91 ", "A": "1.77E+15", "Ea": 132.11, "temps_C": [ 111, 91, 73 ] } }, { "id": "name_block_tamyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "cas": "686-31-7" } }, { "id": "half_life_consistency_tamyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_tamyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_id_dibenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_dibenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_dibenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_dibenzoyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 762, "text": "Dibenzoyl peroxide [94-36-0] 242.2 6.61 113 91 ", "A": "6.94E+13", "Ea": 122.35, "temps_C": [ 113, 91, 71 ] } }, { "id": "name_block_dibenzoyl_peroxide_0", "status": "passed", "detail": { "cas": "94-36-0" } }, { "id": "half_life_consistency_dibenzoyl_peroxide_0", "status": "passed", "detail": 0.774 }, { "id": "line_values_dibenzoyl_peroxide_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 830, "text": "PERKADOX L Dibenzoyl peroxide VMQ 106 83 63 112.5 5.97E+12", "A": "5.97E+12", "Ea": 112.5, "temps_C": [ 106, 83, 63 ] } }, { "id": "name_block_dibenzoyl_peroxide_1", "status": "passed", "detail": { "cas": "94-36-0" } }, { "id": "half_life_consistency_dibenzoyl_peroxide_1", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_dibenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_dibenzoyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 772, "text": "tert-Butyl peroxy-2-ethylhexanoate [3006-82-4] 216.3 7.40 113 91 ", "A": "1.54E+14", "Ea": 124.9, "temps_C": [ 113, 91, 72 ] } }, { "id": "name_block_tbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": { "cas": "3006-82-4" } }, { "id": "half_life_consistency_tbutyl_peroxy_2_ethylhexanoate_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxy_2_ethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxydiethylacetate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxydiethylacetate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxydiethylacetate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxydiethylacetate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "line": 556, "text": "tert-Butyl peroxydiethylacetate [2550-33-6] 188.3 8.50 113 93 ", "A": "2.45E+15", "Ea": 134.0, "temps_C": [ 113, 93, 75 ] } }, { "id": "name_block_tbutyl_peroxydiethylacetate_0", "status": "passed", "detail": { "cas": "2550-33-6" } }, { "id": "half_life_consistency_tbutyl_peroxydiethylacetate_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxydiethylacetate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxydiethylacetate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxyisobutyrate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxyisobutyrate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxyisobutyrate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxyisobutyrate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 782, "text": "tert-Butyl peroxyisobutyrate [109-13-7] 160.2 9.99 118 98 ", "A": "2.07E+15", "Ea": 135.16, "temps_C": [ 118, 98, 79 ] } }, { "id": "name_block_tbutyl_peroxyisobutyrate_0", "status": "passed", "detail": { "cas": "109-13-7" } }, { "id": "half_life_consistency_tbutyl_peroxyisobutyrate_0", "status": "passed", "detail": 0.774 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxyisobutyrate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxyisobutyrate", "status": "passed", "detail": null }, { "id": "unique_id_1_1_azodi_hexahydrobenzonitrile", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_azodi_hexahydrobenzonitrile", "status": "passed", "detail": null }, { "id": "cas_format_1_1_azodi_hexahydrobenzonitrile", "status": "passed", "detail": null }, { "id": "line_values_1_1_azodi_hexahydrobenzonitrile_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 806, "text": "1,1’-Azodi(hexahydrobenzonitrile) [2094-98-6] 244.3 ", "A": "1.10E+16", "Ea": 142.19, "temps_C": [ 123, 103, 85 ] } }, { "id": "name_block_1_1_azodi_hexahydrobenzonitrile_0", "status": "passed", "detail": { "cas": "2094-98-6" } }, { "id": "half_life_consistency_1_1_azodi_hexahydrobenzonitrile_0", "status": "passed", "detail": 0.774 }, { "id": "line_values_1_1_azodi_hexahydrobenzonitrile_1", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "line": 579, "text": "1,1’-Azodi(hexahydrobenzonitrile) [2094-98-6] 244.3 ", "A": "1.10E+16", "Ea": 142.0, "temps_C": [ 123, 103, 85 ] } }, { "id": "name_block_1_1_azodi_hexahydrobenzonitrile_1", "status": "passed", "detail": { "cas": "2094-98-6" } }, { "id": "half_life_consistency_1_1_azodi_hexahydrobenzonitrile_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_1_1_azodi_hexahydrobenzonitrile", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_azodi_hexahydrobenzonitrile", "status": "passed", "detail": null }, { "id": "unique_id_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane", "status": "passed", "detail": null }, { "id": "cas_format_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane", "status": "passed", "detail": null }, { "id": "line_values_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 825, "text": "1,1-Di(tert-butylperoxy)-3,3,5-trimethylcyclohexane [6731-36-8] 302.5 10.58 ", "A": "7.59E+13", "Ea": 127.52, "temps_C": [ 128, 105, 85 ] } }, { "id": "name_block_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_0", "status": "passed", "detail": { "cas": "6731-36-8" } }, { "id": "half_life_consistency_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 827, "text": "TRIGONOX 29 1,1-Di(tert-butylperoxy)-3,3,5-trimethylcyclohexane EPDM 135 111 89 124.5 1.69E+13", "A": "1.69E+13", "Ea": 124.5, "temps_C": [ 135, 111, 89 ] } }, { "id": "name_block_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_1", "status": "passed", "detail": { "cas": "6731-36-8" } }, { "id": "half_life_consistency_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_di_tbutylperoxy_3_3_5_trimethylcyclohexane", "status": "passed", "detail": null }, { "id": "unique_id_1_1_di_tamylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_di_tamylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "cas_format_1_1_di_tamylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "line_values_1_1_di_tamylperoxy_cyclohexane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 814, "text": "1,1-Di(tert-amylperoxy)cyclohexane [15667-10-4] 288.4 11.09 ", "A": "3.29E+15", "Ea": 139.46, "temps_C": [ 126, 106, 87 ] } }, { "id": "name_block_1_1_di_tamylperoxy_cyclohexane_0", "status": "passed", "detail": { "cas": "15667-10-4" } }, { "id": "half_life_consistency_1_1_di_tamylperoxy_cyclohexane_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_1_1_di_tamylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_di_tamylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "unique_id_1_1_di_tbutylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "unique_cas_1_1_di_tbutylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "cas_format_1_1_di_tbutylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "line_values_1_1_di_tbutylperoxy_cyclohexane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 839, "text": "1,1-Di(tert-butylperoxy)cyclohexane [3006-86-8] 260.4 12.29 ", "A": "3.47E+15", "Ea": 142.4, "temps_C": [ 134, 113, 94 ] } }, { "id": "name_block_1_1_di_tbutylperoxy_cyclohexane_0", "status": "passed", "detail": { "cas": "3006-86-8" } }, { "id": "half_life_consistency_1_1_di_tbutylperoxy_cyclohexane_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_1_1_di_tbutylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "no_invented_heat_1_1_di_tbutylperoxy_cyclohexane", "status": "passed", "detail": null }, { "id": "unique_id_tamylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_cas_tamylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "cas_format_tamylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "line_values_tamylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 850, "text": "tert-Amylperoxy 2-ethylhexyl carbonate [70833-40-8] 260.4 6.14 ", "A": "2.22E+16", "Ea": 148.41, "temps_C": [ 134, 113, 95 ] } }, { "id": "name_block_tamylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": { "cas": "70833-40-8" } }, { "id": "half_life_consistency_tamylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_tamylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 828, "text": "TRIGONOX 131 tert-amylperoxy 2-ethylhexyl carbonate EVA 129 103 80 112.1 7.29E+11", "A": "7.29E+11", "Ea": 112.1, "temps_C": [ 129, 103, 80 ] } }, { "id": "name_block_tamylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": { "cas": "70833-40-8" } }, { "id": "half_life_consistency_tamylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tamylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxy_3_5_5_trimethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxy_3_5_5_trimethylhexanoate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxy_3_5_5_trimethylhexanoate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxy_3_5_5_trimethylhexanoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 860, "text": "tert-Butyl peroxy-3,5,5-trimethylhexanoate [13122-18-4] 230.3 6.95 ", "A": "1.94E+15", "Ea": 140.78, "temps_C": [ 135, 114, 94 ] } }, { "id": "name_block_tbutyl_peroxy_3_5_5_trimethylhexanoate_0", "status": "passed", "detail": { "cas": "13122-18-4" } }, { "id": "half_life_consistency_tbutyl_peroxy_3_5_5_trimethylhexanoate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxy_3_5_5_trimethylhexanoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxy_3_5_5_trimethylhexanoate", "status": "passed", "detail": null }, { "id": "unique_id_tamyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "unique_cas_tamyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "cas_format_tamyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "line_values_tamyl_peroxyacetate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-acrylics-manufacturing-en_us.pdf", "line": 634, "text": "tert-Amyl peroxyacetate [690-83-5] 146.2 10.94 ", "A": "6.59E+16", "Ea": 152.16, "temps_C": [ 134, 114, 96 ] } }, { "id": "name_block_tamyl_peroxyacetate_0", "status": "passed", "detail": { "cas": "690-83-5" } }, { "id": "half_life_consistency_tamyl_peroxyacetate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tamyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "unique_id_2_2_di_tbutylperoxy_butane", "status": "passed", "detail": null }, { "id": "unique_cas_2_2_di_tbutylperoxy_butane", "status": "passed", "detail": null }, { "id": "cas_format_2_2_di_tbutylperoxy_butane", "status": "passed", "detail": null }, { "id": "line_values_2_2_di_tbutylperoxy_butane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 884, "text": "2,2-Di(tert-butylperoxy)butane [2167-23-9] 234.3 13.66 136 ", "A": "9.30E+16", "Ea": 154.08, "temps_C": [ 136, 116, 98 ] } }, { "id": "name_block_2_2_di_tbutylperoxy_butane_0", "status": "passed", "detail": { "cas": "2167-23-9" } }, { "id": "half_life_consistency_2_2_di_tbutylperoxy_butane_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_2_2_di_tbutylperoxy_butane", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_2_di_tbutylperoxy_butane", "status": "passed", "detail": null }, { "id": "unique_id_tbutylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "cas_format_tbutylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "line_values_tbutylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 904, "text": "tert-Butylperoxy 2-ethylhexyl carbonate [34443-12-4] 246.3 6.49 137 ", "A": "4.07E+16", "Ea": 151.72, "temps_C": [ 137, 117, 98 ] } }, { "id": "name_block_tbutylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": { "cas": "34443-12-4" } }, { "id": "half_life_consistency_tbutylperoxy_2_ethylhexyl_carbonate_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_tbutylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 826, "text": "TRIGONOX 117 tert-Butylperoxy 2-ethylhexyl carbonate EVA 139 114 92 124.0 1.04E+13", "A": "1.04E+13", "Ea": 124.0, "temps_C": [ 139, 114, 92 ] } }, { "id": "name_block_tbutylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": { "cas": "34443-12-4" } }, { "id": "half_life_consistency_tbutylperoxy_2_ethylhexyl_carbonate_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tbutylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutylperoxy_2_ethylhexyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_id_tbutylperoxy_isopropyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutylperoxy_isopropyl_carbonate", "status": "passed", "detail": null }, { "id": "cas_format_tbutylperoxy_isopropyl_carbonate", "status": "passed", "detail": null }, { "id": "line_values_tbutylperoxy_isopropyl_carbonate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 894, "text": "tert-Butylperoxy isopropyl carbonate [2372-21-6] 176.2 9.08 137 ", "A": "2.49E+16", "Ea": 150.15, "temps_C": [ 137, 117, 98 ] } }, { "id": "name_block_tbutylperoxy_isopropyl_carbonate_0", "status": "passed", "detail": { "cas": "2372-21-6" } }, { "id": "half_life_consistency_tbutylperoxy_isopropyl_carbonate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tbutylperoxy_isopropyl_carbonate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutylperoxy_isopropyl_carbonate", "status": "passed", "detail": null }, { "id": "unique_id_tamyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "unique_cas_tamyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "cas_format_tamyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "line_values_tamyl_peroxybenzoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 914, "text": "tert-Amyl peroxybenzoate [4511-39-1] 208.3 7.68 139 ", "A": "8.38E+15", "Ea": 147.02, "temps_C": [ 139, 118, 99 ] } }, { "id": "name_block_tamyl_peroxybenzoate_0", "status": "passed", "detail": { "cas": "4511-39-1" } }, { "id": "half_life_consistency_tamyl_peroxybenzoate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tamyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tamyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxyacetate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 924, "text": "tert-Butyl peroxyacetate [107-71-1] 132.2 12.11 139 ", "A": "1.57E+16", "Ea": 149.36, "temps_C": [ 139, 119, 100 ] } }, { "id": "name_block_tbutyl_peroxyacetate_0", "status": "passed", "detail": { "cas": "107-71-1" } }, { "id": "half_life_consistency_tbutyl_peroxyacetate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxyacetate", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_peroxybenzoate_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 934, "text": "tert-Butyl peroxybenzoate [614-45-9] 194.2 8.24 142 ", "A": "2.23E+16", "Ea": 151.59, "temps_C": [ 142, 122, 103 ] } }, { "id": "name_block_tbutyl_peroxybenzoate_0", "status": "passed", "detail": { "cas": "614-45-9" } }, { "id": "half_life_consistency_tbutyl_peroxybenzoate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_peroxybenzoate", "status": "passed", "detail": null }, { "id": "unique_id_butyl_4_4_di_tbutylperoxy_valerate", "status": "passed", "detail": null }, { "id": "unique_cas_butyl_4_4_di_tbutylperoxy_valerate", "status": "passed", "detail": null }, { "id": "cas_format_butyl_4_4_di_tbutylperoxy_valerate", "status": "passed", "detail": null }, { "id": "line_values_butyl_4_4_di_tbutylperoxy_valerate_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 825, "text": "TRIGONOX 17 Butyl 4,4-di(tert-butylperoxy)valerate EPDM 149 125 103 134.2 8.23E+13", "A": "8.23E+13", "Ea": 134.2, "temps_C": [ 149, 125, 103 ] } }, { "id": "name_block_butyl_4_4_di_tbutylperoxy_valerate_0", "status": "passed", "detail": { "cas": "995-33-5" } }, { "id": "half_life_consistency_butyl_4_4_di_tbutylperoxy_valerate_0", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_butyl_4_4_di_tbutylperoxy_valerate", "status": "passed", "detail": null }, { "id": "no_invented_heat_butyl_4_4_di_tbutylperoxy_valerate", "status": "passed", "detail": null }, { "id": "unique_id_dicumyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_dicumyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_dicumyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_dicumyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 958, "text": "Dicumyl peroxide [80-43-3] 270.4 5.92 154 13", "A": "9.24E+15", "Ea": 152.67, "temps_C": [ 154, 132, 112 ] } }, { "id": "name_block_dicumyl_peroxide_0", "status": "passed", "detail": { "cas": "80-43-3" } }, { "id": "half_life_consistency_dicumyl_peroxide_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_dicumyl_peroxide_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 824, "text": "PERKADOX BC Dicumyl peroxide EPDM 158 134 112 137.8 9.77E+13", "A": "9.77E+13", "Ea": 137.8, "temps_C": [ 158, 134, 112 ] } }, { "id": "name_block_dicumyl_peroxide_1", "status": "passed", "detail": { "cas": "80-43-3" } }, { "id": "half_life_consistency_dicumyl_peroxide_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_dicumyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_dicumyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_di_tbutylperoxyisopropyl_benzene", "status": "passed", "detail": null }, { "id": "unique_cas_di_tbutylperoxyisopropyl_benzene", "status": "passed", "detail": null }, { "id": "cas_format_di_tbutylperoxyisopropyl_benzene", "status": "passed", "detail": null }, { "id": "line_values_di_tbutylperoxyisopropyl_benzene_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 968, "text": "Di(tert-butylperoxyisopropyl)benzene [25155-25-3] 338.5 9.45 156 13", "A": "7.65E+15", "Ea": 152.69, "temps_C": [ 156, 134, 114 ] } }, { "id": "name_block_di_tbutylperoxyisopropyl_benzene_0", "status": "passed", "detail": { "cas": "25155-25-3" } }, { "id": "half_life_consistency_di_tbutylperoxyisopropyl_benzene_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_di_tbutylperoxyisopropyl_benzene_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 823, "text": "PERKADOX 14 Di-tert-butylperoxyisopropyl)benzene EPDM 164 140 118 143.5 2.68E+14", "A": "2.68E+14", "Ea": 143.5, "temps_C": [ 164, 140, 118 ] } }, { "id": "name_block_di_tbutylperoxyisopropyl_benzene_1", "status": "passed", "detail": { "cas": "25155-25-3" } }, { "id": "half_life_consistency_di_tbutylperoxyisopropyl_benzene_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_di_tbutylperoxyisopropyl_benzene", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_tbutylperoxyisopropyl_benzene", "status": "passed", "detail": null }, { "id": "unique_id_2_5_dimethyl_2_5_di_tbutylperoxy_hexane", "status": "passed", "detail": null }, { "id": "unique_cas_2_5_dimethyl_2_5_di_tbutylperoxy_hexane", "status": "passed", "detail": null }, { "id": "cas_format_2_5_dimethyl_2_5_di_tbutylperoxy_hexane", "status": "passed", "detail": null }, { "id": "line_values_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 978, "text": "2,5-Dimethyl-2,5-di(tert-butylperoxy)hexane [78-63-7] 290.4 11.02 156 13", "A": "1.68E+16", "Ea": 155.49, "temps_C": [ 156, 134, 115 ] } }, { "id": "name_block_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_0", "status": "passed", "detail": { "cas": "78-63-7" } }, { "id": "half_life_consistency_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 820, "text": "TRIGONOX 101 2,5-Dimethyl-2,5-di(tert-butylperoxy)hexane EPDM 166 143 121 147.4 6.41E+14", "A": "6.41E+14", "Ea": 147.4, "temps_C": [ 166, 143, 121 ] } }, { "id": "name_block_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_1", "status": "passed", "detail": { "cas": "78-63-7" } }, { "id": "half_life_consistency_2_5_dimethyl_2_5_di_tbutylperoxy_hexane_1", "status": "passed", "detail": 0.814 }, { "id": "primary_kinetics_is_a_measurement_2_5_dimethyl_2_5_di_tbutylperoxy_hexane", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_5_dimethyl_2_5_di_tbutylperoxy_hexane", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_cumyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_cumyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_cumyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_cumyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 821, "text": "TRIGONOX T tert-Butyl cumyl peroxide EPDM 164 140 118 142.9 2.30E+14", "A": "2.30E+14", "Ea": 142.9, "temps_C": [ 164, 140, 118 ] } }, { "id": "name_block_tbutyl_cumyl_peroxide_0", "status": "passed", "detail": { "cas": "3457-61-2" } }, { "id": "half_life_consistency_tbutyl_cumyl_peroxide_0", "status": "passed", "detail": 0.814 }, { "id": "line_values_tbutyl_cumyl_peroxide_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 822, "text": "TRIGONOX T tert-Butyl cumyl peroxide LDPE 172 146 123 138.9 3.55E+13", "A": "3.55E+13", "Ea": 138.9, "temps_C": [ 172, 146, 123 ] } }, { "id": "name_block_tbutyl_cumyl_peroxide_1", "status": "passed", "detail": { "cas": "3457-61-2" } }, { "id": "half_life_consistency_tbutyl_cumyl_peroxide_1", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_cumyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_cumyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_di_tbutyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_cas_di_tbutyl_peroxide", "status": "passed", "detail": null }, { "id": "cas_format_di_tbutyl_peroxide", "status": "passed", "detail": null }, { "id": "line_values_di_tbutyl_peroxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 987, "text": "Di-tert-butyl peroxide [110-05-4] 146.2 10.94 164 14", "A": "4.20E+15", "Ea": 153.46, "temps_C": [ 164, 141, 121 ] } }, { "id": "name_block_di_tbutyl_peroxide_0", "status": "passed", "detail": { "cas": "110-05-4" } }, { "id": "half_life_consistency_di_tbutyl_peroxide_0", "status": "passed", "detail": 1.062 }, { "id": "line_values_di_tbutyl_peroxide_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 819, "text": "TRIGONOX B 3 Di-tert-butyl peroxide HDPE 176 151 129 146.3 1.98E+14", "A": "1.98E+14", "Ea": 146.3, "temps_C": [ 176, 151, 129 ] } }, { "id": "name_block_di_tbutyl_peroxide_1", "status": "passed", "detail": { "cas": "110-05-4" } }, { "id": "half_life_consistency_di_tbutyl_peroxide_1", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_di_tbutyl_peroxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_di_tbutyl_peroxide", "status": "passed", "detail": null }, { "id": "unique_id_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane", "status": "passed", "detail": null }, { "id": "unique_cas_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane", "status": "passed", "detail": null }, { "id": "cas_format_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane", "status": "passed", "detail": null }, { "id": "line_values_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 997, "text": "3,6,9-Triethyl-3,6,9-trimethyl-1,4,7-triperoxonane [24748-23-0] 264.3 18.16 170 14", "A": "1.02E+15", "Ea": 150.23, "temps_C": [ 170, 146, 125 ] } }, { "id": "name_block_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_0", "status": "passed", "detail": { "cas": "24748-23-0" } }, { "id": "half_life_consistency_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_0", "status": "passed", "detail": 1.062 }, { "id": "line_values_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_1", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 817, "text": "TRIGONOX 301 3,6,9-Triethyl-3,6,9-trimethyl-1,4,7-triperoxonane HDPE 181 156 134 150.8 4.35E+14", "A": "4.35E+14", "Ea": 150.8, "temps_C": [ 181, 156, 134 ] } }, { "id": "name_block_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_1", "status": "passed", "detail": { "cas": "24748-23-0" } }, { "id": "half_life_consistency_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane_1", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane", "status": "passed", "detail": null }, { "id": "no_invented_heat_3_6_9_triethyl_3_6_9_trimethyl_1_4_7_triperoxonane", "status": "passed", "detail": null }, { "id": "unique_id_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3", "status": "passed", "detail": null }, { "id": "unique_cas_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3", "status": "passed", "detail": null }, { "id": "cas_format_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3", "status": "passed", "detail": null }, { "id": "line_values_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 818, "text": "TRIGONOX 145 2,5-Dimethyl-2,5-di(tert-butylperoxy)hexyne-3 EPDM 177 152 130 148.7 3.49E+14", "A": "3.49E+14", "Ea": 148.7, "temps_C": [ 177, 152, 130 ] } }, { "id": "name_block_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3_0", "status": "passed", "detail": { "cas": "1068-27-5" } }, { "id": "half_life_consistency_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3_0", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3", "status": "passed", "detail": null }, { "id": "no_invented_heat_2_5_dimethyl_2_5_di_tbutylperoxy_hexyne_3", "status": "passed", "detail": null }, { "id": "unique_id_cumyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "unique_cas_cumyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "cas_format_cumyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "line_values_cumyl_hydroperoxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 1041, "text": "Cumyl hydroperoxide [80-15-9] 152.2 10.51 195 166 140 1.15E+12 13", "A": "1.15E+12", "Ea": 132.56, "temps_C": [ 195, 166, 140 ] } }, { "id": "name_block_cumyl_hydroperoxide_0", "status": "passed", "detail": { "cas": "80-15-9" } }, { "id": "half_life_consistency_cumyl_hydroperoxide_0", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_cumyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_cumyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "unique_id_3_3_5_7_7_pentamethyl_1_2_4_trioxepane", "status": "passed", "detail": null }, { "id": "unique_cas_3_3_5_7_7_pentamethyl_1_2_4_trioxepane", "status": "passed", "detail": null }, { "id": "cas_format_3_3_5_7_7_pentamethyl_1_2_4_trioxepane", "status": "passed", "detail": null }, { "id": "line_values_3_3_5_7_7_pentamethyl_1_2_4_trioxepane_0", "status": "passed", "detail": { "file": "nouryon_brochure-crosslinking-peroxides-emeia-booklet-en_us.pdf", "line": 816, "text": "TRIGONOX 311 3,3,5,7,7-Pentamethyl-1,2,4-trioxepane HDPE 213 184 158 144.6 6.58E+12", "A": "6.58E+12", "Ea": 144.6, "temps_C": [ 213, 184, 158 ] } }, { "id": "name_block_3_3_5_7_7_pentamethyl_1_2_4_trioxepane_0", "status": "passed", "detail": { "cas": "215877-64-8" } }, { "id": "half_life_consistency_3_3_5_7_7_pentamethyl_1_2_4_trioxepane_0", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_3_3_5_7_7_pentamethyl_1_2_4_trioxepane", "status": "passed", "detail": null }, { "id": "no_invented_heat_3_3_5_7_7_pentamethyl_1_2_4_trioxepane", "status": "passed", "detail": null }, { "id": "unique_id_tbutyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "unique_cas_tbutyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "cas_format_tbutyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "line_values_tbutyl_hydroperoxide_0", "status": "passed", "detail": { "file": "nouryon_brochure-initiators-for-thermoplastics-en_us.pdf", "line": 1050, "text": "tert-Butyl hydroperoxide [75-91-2] 90.1 17.75 207 185 164 3.18E+17 18", "A": "3.18E+17", "Ea": 186.01, "temps_C": [ 207, 185, 164 ] } }, { "id": "name_block_tbutyl_hydroperoxide_0", "status": "passed", "detail": { "cas": "75-91-2" } }, { "id": "half_life_consistency_tbutyl_hydroperoxide_0", "status": "passed", "detail": 1.062 }, { "id": "primary_kinetics_is_a_measurement_tbutyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "no_invented_heat_tbutyl_hydroperoxide", "status": "passed", "detail": null }, { "id": "at_least_50_distinct_substances", "status": "passed", "detail": 51 }, { "id": "dtbp_text_5.74_g_of_20%_di-tert-butyl-pe", "status": "passed", "detail": null }, { "id": "dtbp_text_mass_10.028_g", "status": "passed", "detail": null }, { "id": "dtbp_text_exothermal_threshold", "status": "passed", "detail": null }, { "id": "dtbp_text_1.480", "status": "passed", "detail": null }, { "id": "dtbp_text_90.3_K", "status": "passed", "detail": null }, { "id": "dtbp_text_133.7_K", "status": "passed", "detail": null }, { "id": "dtbp_text_280.675_J/g", "status": "passed", "detail": null }, { "id": "dtbp_text_1611.075_J", "status": "passed", "detail": null }, { "id": "dtbp_text_15.152_log_(1/s)", "status": "passed", "detail": null }, { "id": "dtbp_text_151.039_kJ/mol", "status": "passed", "detail": null }, { "id": "dtbp_text_42.7_bar", "status": "passed", "detail": null }, { "id": "dtbp_text_At_110°C", "status": "passed", "detail": null }, { "id": "dtbp_phi_consistency", "status": "passed", "detail": 1.4806201550387597 }, { "id": "dtbp_total_heat_consistency", "status": "passed", "detail": null }, { "id": "pubchem_cas_all_confirmed", "status": "passed", "detail": null }, { "id": "antoine_273.13", "status": "passed", "detail": null }, { "id": "antoine_303.0", "status": "passed", "detail": null }, { "id": "antoine_420.0", "status": "passed", "detail": null }, { "id": "antoine_308.52", "status": "passed", "detail": null }, { "id": "antoine_273.0", "status": "passed", "detail": null } ], "failed": []}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142"""CHEM-146 Mflow 1128610 shared interface geometry (SI, +Z up, +Y rear, origin = bench footprint centre).
Single source for build_geometry.py, build_blender.py, verify_geometry.py and the Matterix scripts. The runtime(scripts/asset_runtime/zwick_mflow.py) keeps its own copies of the physical constants and the tests compare them.
Manufacturer facts (PI 434 725, item 1128610 column): body 479 x 524 x 548 mm (W x D x H), 55 kg without test weights,7" capacitive touch display, displacement transducer and automatic extrudate cutter included, barrel 1128612 bore9.55 mm, die 312342 2.095 mm x 8 mm, piston 1128614 = 0.325 kg test load. Every other number below is a photo /engineering estimate from the manufacturer photographs (evidence = photo_estimate or engineering_assumption)."""import math
# ---------------------------------------------------------------- envelope and barrel columnENVELOPE_M = (0.479, 0.524, 0.548)BARREL_XY = (-0.080, -0.125) # barrel / piston / die axis (photo estimate: ~65 % across the furnace cover)BARREL_BORE_DIAMETER_M = 0.00955 # 1128612, documentedPISTON_HEAD_DIAMETER_M = 0.009474 # ISO 1133-1 piston head (engineering reference to the standard)PISTON_HEAD_LENGTH_M = 0.00635DIE_DIAMETER_M = 0.002095 # 312342, documentedDIE_LENGTH_M = 0.008 # 312342, documentedDIE_EXIT_Z = 0.228 # die exit face (underside of the furnace die plate)DIE_TOP_Z = DIE_EXIT_Z + DIE_LENGTH_M # 0.236: piston position 0 = piston bottom on the die topBARREL_LENGTH_M = 0.180BARREL_TOP_Z = DIE_TOP_Z + BARREL_LENGTH_M # 0.416FURNACE_TOP_Z = 0.430PISTON_TRAVEL_M = BARREL_LENGTH_M # joint 0 .. 0.180 (withdrawn = piston bottom at the barrel top)PISTON_SEAT_LOCAL_Z = 0.246 # weight seat above the piston bottomWEIGHT_HEIGHT_M = 0.066 # standard 2.16 kg load stage weight (1.835 kg on top of the 0.325 kg piston)PISTON_MASS_KG = 0.325 # documented: piston alone = 0.325 kg test loadSTANDARD_WEIGHT_MASS_KG = 2.16 - 0.325 # documented load stage 2.16 kg minus the pistonassert abs(DIE_TOP_Z + PISTON_SEAT_LOCAL_Z + WEIGHT_HEIGHT_M - ENVELOPE_M[2]) < 1e-12
# ---------------------------------------------------------------- displacement transducer (rotary arm on a collar)SENSOR_COLLAR_LOCAL_Z = 0.218 # top of the transducer collar on the piston stemSENSOR_COLLAR_THICKNESS_M = 0.004SENSOR_COLLAR_RADIUS_M = 0.016SENSOR_ROLLER_RADIUS_M = 0.003 # two rollers, spring-loaded upward against the collar undersideSENSOR_ARM_LENGTH_M = 0.140SENSOR_PIVOT_XY = (BARREL_XY[0] - SENSOR_ARM_LENGTH_M / math.sqrt(2.0), BARREL_XY[1] + SENSOR_ARM_LENGTH_M / math.sqrt(2.0))SENSOR_ZERO_POSITION_M = 0.050 # arm horizontal when the piston bottom is 50 mm above the die (ISO start)SENSOR_PIVOT_Z = DIE_TOP_Z + SENSOR_ZERO_POSITION_M + SENSOR_COLLAR_LOCAL_Z - SENSOR_COLLAR_THICKNESS_M - SENSOR_ROLLER_RADIUS_MSENSOR_ARM_DIRECTION = (math.sqrt(0.5), -math.sqrt(0.5), 0.0) # horizontal, pivot -> piston axisSENSOR_ARM_AXIS = (-math.sqrt(0.5), -math.sqrt(0.5), 0.0) # = direction x Z, positive angle lifts the tipSENSOR_ELEVATION_MAX_RAD = 0.42 # upper stop of the arm (tip lifted)SENSOR_REFERENCE_ELEVATION_RAD = math.asin(-SENSOR_ZERO_POSITION_M / SENSOR_ARM_LENGTH_M) # arm on the collar, piston on the dieSENSOR_ARM_LIMITS_RAD = (0.0, SENSOR_ELEVATION_MAX_RAD - SENSOR_REFERENCE_ELEVATION_RAD) # joint 0 = reference poseSENSOR_CONTACT_RANGE_M = (0.0, SENSOR_ZERO_POSITION_M + SENSOR_ARM_LENGTH_M * math.sin(SENSOR_ELEVATION_MAX_RAD))
def sensor_arm_angle(piston_position_m): """Joint angle of the transducer arm for a piston position (0 = reference pose, piston on the die).
The roller tops (on the arm centre line at 140 mm, radius 3 mm) press against the collar underside, so exactly elevation = asin((position - 0.050) / 0.140). Beyond the reach (~107 mm) the arm rests on its upper stop below the collar and has no contact (the encoder then reports out of range). """ s = (piston_position_m - SENSOR_ZERO_POSITION_M) / SENSOR_ARM_LENGTH_M elevation = SENSOR_ELEVATION_MAX_RAD if s >= math.sin(SENSOR_ELEVATION_MAX_RAD) else math.asin(max(s, math.sin(SENSOR_REFERENCE_ELEVATION_RAD))) return elevation - SENSOR_REFERENCE_ELEVATION_RAD
# ---------------------------------------------------------------- automatic extrudate cutterCUTTER_PIVOT_XY = (BARREL_XY[0] - 0.040, BARREL_XY[1])CUTTER_BLADE_Z = (0.2244, 0.2254) # blade plane 2.6-3.6 mm below the die exitCUTTER_LIMITS_RAD = (0.0, math.pi) # alternate half turns 0 -> pi -> 0; crossing pi/2 severs the strand
# ---------------------------------------------------------------- tilted 7" touch display and illuminated keysPANEL_TILT_RAD = math.radians(75.0) # face tilted 15 deg back from verticalU = [1.0, 0.0, 0.0]V = [0.0, math.cos(PANEL_TILT_RAD), math.sin(PANEL_TILT_RAD)]N = [0.0, -math.sin(PANEL_TILT_RAD), math.cos(PANEL_TILT_RAD)]PANEL_BOTTOM = (0.1145, -0.2046, 0.240) # centre of the lower face edgePANEL_HEIGHT_M = 0.1915PANEL_WIDTH_M = 0.225PANEL_CENTER = [PANEL_BOTTOM[0], PANEL_BOTTOM[1] + V[1] * PANEL_HEIGHT_M / 2, PANEL_BOTTOM[2] + V[2] * PANEL_HEIGHT_M / 2]
def panel_point(u, v, n=0.0): """Face-local (u right, v up the face, n outward) -> asset frame.""" return [PANEL_CENTER[i] + u * U[i] + v * V[i] + n * N[i] for i in range(3)]
SCREEN_CENTER_UV = (0.0, 0.032)SCREEN_SIZE_M = (0.158, 0.094)BAND_CENTER_UV = (0.0, -0.034)KEY_ROW_V = -0.066KEYS = [('button_up', -0.080, 'up'), ('button_down', -0.054, 'down'), ('button_cycle', -0.014, 'cycle'), ('button_start', 0.030, 'start'), ('button_stop', 0.058, 'stop')]KEY_COMMANDS = {'button_start': 'acquisition.start', 'button_stop': 'acquisition.stop', 'button_cycle': 'cutter.cut'}
PORTS = [('sample_loading', 'barrel', 'mechanical'), ('die_outlet', 'die', 'liquid'), ('die_mount', 'die', 'mechanical'), ('piston_coupling', 'piston', 'mechanical'), ('weight_stack', 'test_weight', 'mechanical'), ('thermal_boundary', 'heater', 'thermal'), ('cut_collection', 'collection_tray', 'mechanical'), ('analytical_balance', 'balance_rs232', 'data'), ('raw_data', 'raw_rs232', 'data'), ('ethernet_host', 'ethernet_host', 'data'), ('usb_1', 'usb_1', 'data'), ('usb_2', 'usb_2', 'data'), ('line_power', 'line_power', 'electrical'), ('protective_ground', 'protective_ground', 'electrical')]# (part, state_id, capability, blender attribute, unit, upper) ; joints are process authoritative mirrorsMOTION = [('piston', 'piston.position_m', 'piston.insert', 'location[2]', 'm', PISTON_TRAVEL_M), ('sensor_arm', 'sensor_arm.angle_rad', 'piston.insert', 'rotation_axis_angle', 'rad', SENSOR_ARM_LIMITS_RAD[1]), ('cutter', 'cutter.angle_rad', 'cutter.cut', 'rotation_euler[2]', 'rad', math.pi), ('power_switch', 'power.angle_rad', 'power.set', 'rotation_euler[0]', 'rad', 0.28)]
LED_BG = (0.018, 0.034, 0.044)READOUTS = [dict(name='temperature_sim', part='temperature_digits', face='N', digits=5, decimals=1, unit='C', on=(0.95, 0.96, 0.97), off=LED_BG, blank_channel=None, source={'bridge': ['thermal.indicated_k'], 'offset': -273.15}), dict(name='piston_position_sim', part='position_digits', face='N', digits=6, decimals=3, unit='mm', on=(0.40, 0.84, 0.98), off=LED_BG, blank_channel=None, source={'bridge': ['encoder.position_m'], 'scale': 1000.0}), dict(name='live_mvr_sim', part='mvr_digits', face='N', digits=6, decimals=2, unit='cm3/10min', on=(0.55, 0.93, 0.55), off=LED_BG, blank_channel=None, source={'bridge': ['measurement.live_mvr_m3_s'], 'scale': 6.0e8})]READOUT_LINES_V = {'temperature_digits': 0.058, 'position_digits': 0.030, 'mvr_digits': 0.002}READOUT_BASIS = {r['name']: dict(u=U, v=V, normal=N) for r in READOUTS}READOUT_NOTE_ZH = ('厂家1128610确有7寸倾斜电容触屏(照片界面显示温度与活塞位置数值);本资产在屏上叠加三行工程七段读数:炉温°C(0.1 K显示)、' '活塞底距口模上表面mm(0.003 mm量化)、实时MVR cm³/10min,均来自公开传感状态,不是原厂界面、字体或驱动。' '面板基向量U=+X,V=[0,cos75°,sin75°],N=[0,-sin75°,cos75°]。未配气动升降/自动选重,上下箭头键保留为无指令弹簧键;' '开始/停止/切刀键经宿主能力触发。称量只经外部天平RS232语义口,不造内置天平。挤出丝与末段切段为本任务场景适配器的可视缩放,不是CFD或接触求解。')
REAR_Y = 0.256PORT_GEOMETRY = { 'sample_loading': dict(pos=[BARREL_XY[0], BARREL_XY[1], FURNACE_TOP_Z + 0.006], insert_axis=[0, 0, 1], radius=BARREL_BORE_DIAMETER_M / 2, capture=0.002), 'die_outlet': dict(pos=[BARREL_XY[0], BARREL_XY[1], DIE_EXIT_Z], insert_axis=[0, 0, -1], radius=DIE_DIAMETER_M / 2, capture=0.001), 'die_mount': dict(pos=[BARREL_XY[0], BARREL_XY[1], DIE_EXIT_Z - 0.0005], insert_axis=[0, 0, -1], radius=0.009, capture=0.002), 'piston_coupling': dict(pos=[BARREL_XY[0], BARREL_XY[1], DIE_TOP_Z + PISTON_SEAT_LOCAL_Z], insert_axis=[0, 0, 1], radius=0.007, capture=0.002), 'weight_stack': dict(pos=[BARREL_XY[0], BARREL_XY[1], ENVELOPE_M[2]], insert_axis=[0, 0, 1], radius=0.037, capture=0.003), 'thermal_boundary': dict(pos=[BARREL_XY[0], BARREL_XY[1], 0.330], insert_axis=[0, -1, 0], radius=0.030, capture=0.003), 'cut_collection': dict(pos=[BARREL_XY[0], BARREL_XY[1] - 0.020, 0.0342], insert_axis=[0, 0, 1], radius=0.060, capture=0.01),}REAR_CONNECTORS = [('line_power', 0.190, 0.105), ('protective_ground', 0.150, 0.105), ('ethernet_host', 0.080, 0.110), ('usb_1', 0.040, 0.110), ('usb_2', 0.040, 0.128), ('raw_rs232', -0.030, 0.110), ('balance_rs232', -0.100, 0.110)]CONNECTOR_PORT = {part: port for port, part, medium in PORTS if medium in ('data', 'electrical')}for _name, _x, _z in REAR_CONNECTORS: PORT_GEOMETRY[CONNECTOR_PORT[_name]] = dict(pos=[_x, 0.262, _z], insert_axis=[0, 1, 0], radius=0.004, capture=0.002)for _row in PORT_GEOMETRY.values(): _row.update(position_evidence='geometry_derived_simulation_assumption', capture_evidence='simulation_assumption', note='接口插入轴为向外预放置方向;局部接口布局和捕获半径为工程几何,物理pinout/机器人接触未验证。')
EXTRUDATE_RADIUS_M = 0.00115 # die radius 1.0475 mm x assumed swell 1.10 (visual only)EXTRUDATE_VISUAL_SPEC = dict( reference_length_m=0.020, radius_m=EXTRUDATE_RADIUS_M, max_visual_length_m=0.150, strand=dict(part='extrudate_strand', anchor=[BARREL_XY[0], BARREL_XY[1], DIE_EXIT_Z], axis=[0, 0, -1], state='extrudate.length_m'), segment=dict(part='extrudate_segment', anchor=[BARREL_XY[0] - 0.010, BARREL_XY[1] - 0.040, 0.0342 + EXTRUDATE_RADIUS_M], axis=[1, 0, 0], state='extrudate.last_cut_length_m'), scope='asset-local visual vertex scaling and visibility only; strand clipped to 150 mm (drop height to the plate ~194 mm); ' 'no CFD, die-swell measurement, coiling, contact or automatic transfer to the balance')123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471360,0.000129900000,0.000003917000,0.000606100000
361,0.000145847000,0.000004393581,0.000680879200
362,0.000163802100,0.000004929604,0.000765145600
363,0.000184003700,0.000005532136,0.000860012400
364,0.000206690200,0.000006208245,0.000966592800
365,0.000232100000,0.000006965000,0.001086000000
366,0.000260728000,0.000007813219,0.001220586000
367,0.000293075000,0.000008767336,0.001372729000
368,0.000329388000,0.000009839844,0.001543579000
369,0.000369914000,0.000011043230,0.001734286000
370,0.000414900000,0.000012390000,0.001946000000
371,0.000464158700,0.000013886410,0.002177777000
372,0.000518986000,0.000015557280,0.002435809000
373,0.000581854000,0.000017442960,0.002731953000
374,0.000655234700,0.000019583750,0.003078064000
375,0.000741600000,0.000022020000,0.003486000000
376,0.000845029600,0.000024839650,0.003975227000
377,0.000964526800,0.000028041260,0.004540880000
378,0.001094949000,0.000031531040,0.005158320000
379,0.001231154000,0.000035215210,0.005802907000
380,0.001368000000,0.000039000000,0.006450001000
381,0.001502050000,0.000042826400,0.007083216000
382,0.001642328000,0.000046914600,0.007745488000
383,0.001802382000,0.000051589600,0.008501152000
384,0.001995757000,0.000057176400,0.009414544000
385,0.002236000000,0.000064000000,0.010549990000
386,0.002535385000,0.000072344210,0.011965800000
387,0.002892603000,0.000082212240,0.013655870000
388,0.003300829000,0.000093508160,0.015588050000
389,0.003753236000,0.000106136100,0.017730150000
390,0.004243000000,0.000120000000,0.020050010000
391,0.004762389000,0.000134984000,0.022511360000
392,0.005330048000,0.000151492000,0.025202880000
393,0.005978712000,0.000170208000,0.028279720000
394,0.006741117000,0.000191816000,0.031897040000
395,0.007650000000,0.000217000000,0.036210000000
396,0.008751373000,0.000246906700,0.041437710000
397,0.010028880000,0.000281240000,0.047503720000
398,0.011421700000,0.000318520000,0.054119880000
399,0.012869010000,0.000357266700,0.060998030000
400,0.014310000000,0.000396000000,0.067850010000
401,0.015704430000,0.000433714700,0.074486320000
402,0.017147440000,0.000473024000,0.081361560000
403,0.018781220000,0.000517876000,0.089153640000
404,0.020748010000,0.000572218700,0.098540480000
405,0.023190000000,0.000640000000,0.110200000000
406,0.026207360000,0.000724560000,0.124613300000
407,0.029782480000,0.000825500000,0.141701700000
408,0.033880920000,0.000941160000,0.161303500000
409,0.038468240000,0.001069880000,0.183256800000
410,0.043510000000,0.001210000000,0.207400000000
411,0.048995600000,0.001362091000,0.233692100000
412,0.055022600000,0.001530752000,0.262611400000
413,0.061718800000,0.001720368000,0.294774600000
414,0.069212000000,0.001935323000,0.330798500000
415,0.077630000000,0.002180000000,0.371300000000
416,0.086958110000,0.002454800000,0.416209100000
417,0.097176720000,0.002764000000,0.465464200000
418,0.108406300000,0.003117800000,0.519694800000
419,0.120767200000,0.003526400000,0.579530300000
420,0.134380000000,0.004000000000,0.645600000000
421,0.149358200000,0.004546240000,0.718483800000
422,0.165395700000,0.005159320000,0.796713300000
423,0.181983100000,0.005829280000,0.877845900000
424,0.198611000000,0.006546160000,0.959439000000
425,0.214770000000,0.007300000000,1.039050100000
426,0.230186800000,0.008086507000,1.115367300000
427,0.244879700000,0.008908720000,1.188497100000
428,0.258777300000,0.009767680000,1.258123300000
429,0.271807900000,0.010664430000,1.323929600000
430,0.283900000000,0.011600000000,1.385600000000
431,0.294943800000,0.012573170000,1.442635200000
432,0.304896500000,0.013582720000,1.494803500000
433,0.313787300000,0.014629680000,1.542190300000
434,0.321645400000,0.015715090000,1.584880700000
435,0.328500000000,0.016840000000,1.622960000000
436,0.334351300000,0.018007360000,1.656404800000
437,0.339210100000,0.019214480000,1.685295900000
438,0.343121300000,0.020453920000,1.709874500000
439,0.346129600000,0.021718240000,1.730382100000
440,0.348280000000,0.023000000000,1.747060000000
441,0.349599900000,0.024294610000,1.760044600000
442,0.350147400000,0.025610240000,1.769623300000
443,0.350013000000,0.026958570000,1.776263700000
444,0.349287000000,0.028351250000,1.780433400000
445,0.348060000000,0.029800000000,1.782600000000
446,0.346373300000,0.031310830000,1.782968200000
447,0.344262400000,0.032883680000,1.781699800000
448,0.341808800000,0.034521120000,1.779198200000
449,0.339094100000,0.036225710000,1.775867100000
450,0.336200000000,0.038000000000,1.772110000000
451,0.333197700000,0.039846670000,1.768258900000
452,0.330041100000,0.041768000000,1.764039000000
453,0.326635700000,0.043766000000,1.758943800000
454,0.322886800000,0.045842670000,1.752466300000
455,0.318700000000,0.048000000000,1.744100000000
456,0.314025100000,0.050243680000,1.733559500000
457,0.308884000000,0.052573040000,1.720858100000
458,0.303290400000,0.054980560000,1.705936900000
459,0.297257900000,0.057458720000,1.688737200000
460,0.290800000000,0.060000000000,1.669200000000
461,0.283970100000,0.062601970000,1.647528700000
462,0.276721400000,0.065277520000,1.623412700000
463,0.268917800000,0.068042080000,1.596022300000
464,0.260422700000,0.070911090000,1.564528000000
465,0.251100000000,0.073900000000,1.528100000000
466,0.240847500000,0.077016000000,1.486111400000
467,0.229851200000,0.080266400000,1.439521500000
468,0.218407200000,0.083666800000,1.389879900000
469,0.206811500000,0.087232800000,1.338736200000
470,0.195360000000,0.090980000000,1.287640000000
471,0.184213600000,0.094917550000,1.237422300000
472,0.173327300000,0.099045840000,1.187824300000
473,0.162688100000,0.103367400000,1.138761100000
474,0.152283300000,0.107884600000,1.090148000000
475,0.142100000000,0.112600000000,1.041900000000
476,0.132178600000,0.117532000000,0.994197600000
477,0.122569600000,0.122674400000,0.947347300000
478,0.113275200000,0.127992800000,0.901453100000
479,0.104297900000,0.133452800000,0.856619300000
480,0.095640000000,0.139020000000,0.812950100000
481,0.087299550000,0.144676400000,0.770517300000
482,0.079308040000,0.150469300000,0.729444800000
483,0.071717760000,0.156461900000,0.689913600000
484,0.064580990000,0.162717700000,0.652104900000
485,0.057950010000,0.169300000000,0.616200000000
486,0.051862110000,0.176243100000,0.582328600000
487,0.046281520000,0.183558100000,0.550416200000
488,0.041150880000,0.191273500000,0.520337600000
489,0.036412830000,0.199418000000,0.491967300000
490,0.032010000000,0.208020000000,0.465180000000
491,0.027917200000,0.217119900000,0.439924600000
492,0.024144400000,0.226734500000,0.416183600000
493,0.020687000000,0.236857100000,0.393882200000
494,0.017540400000,0.247481200000,0.372945900000
495,0.014700000000,0.258600000000,0.353300000000
496,0.012161790000,0.270184900000,0.334857800000
497,0.009919960000,0.282293900000,0.317552100000
498,0.007967240000,0.295050500000,0.301337500000
499,0.006296346000,0.308578000000,0.286168600000
500,0.004900000000,0.323000000000,0.272000000000
501,0.003777173000,0.338402100000,0.258817100000
502,0.002945320000,0.354685800000,0.246483800000
503,0.002424880000,0.371698600000,0.234771800000
504,0.002236293000,0.389287500000,0.223453300000
505,0.002400000000,0.407300000000,0.212300000000
506,0.002925520000,0.425629900000,0.201169200000
507,0.003836560000,0.444309600000,0.190119600000
508,0.005174840000,0.463394400000,0.179225400000
509,0.006982080000,0.482939500000,0.168560800000
510,0.009300000000,0.503000000000,0.158200000000
511,0.012149490000,0.523569300000,0.148138300000
512,0.015535880000,0.544512000000,0.138375800000
513,0.019477520000,0.565690000000,0.128994200000
514,0.023992770000,0.586965300000,0.120075100000
515,0.029100000000,0.608200000000,0.111700000000
516,0.034814850000,0.629345600000,0.103904800000
517,0.041120160000,0.650306800000,0.096667480000
518,0.047985040000,0.670875200000,0.089982720000
519,0.055378610000,0.690842400000,0.083845310000
520,0.063270000000,0.710000000000,0.078249990000
521,0.071635010000,0.728185200000,0.073208990000
522,0.080462240000,0.745463600000,0.068678160000
523,0.089739960000,0.761969400000,0.064567840000
524,0.099456450000,0.777836800000,0.060788350000
525,0.109600000000,0.793200000000,0.057250010000
526,0.120167400000,0.808110400000,0.053904350000
527,0.131114500000,0.822496200000,0.050746640000
528,0.142367900000,0.836306800000,0.047752760000
529,0.153854200000,0.849491600000,0.044898590000
530,0.165500000000,0.862000000000,0.042160000000
531,0.177257100000,0.873810800000,0.039507280000
532,0.189140000000,0.884962400000,0.036935640000
533,0.201169400000,0.895493600000,0.034458360000
534,0.213365800000,0.905443200000,0.032088720000
535,0.225749900000,0.914850100000,0.029840000000
536,0.238320900000,0.923734800000,0.027711810000
537,0.251066800000,0.932092400000,0.025694440000
538,0.263992200000,0.939922600000,0.023787160000
539,0.277101700000,0.947225200000,0.021989250000
540,0.290400000000,0.954000000000,0.020300000000
541,0.303891200000,0.960256100000,0.018718050000
542,0.317572600000,0.966007400000,0.017240360000
543,0.331438400000,0.971260600000,0.015863640000
544,0.345482800000,0.976022500000,0.014584610000
545,0.359700000000,0.980300000000,0.013400000000
546,0.374083900000,0.984092400000,0.012307230000
547,0.388639600000,0.987418200000,0.011301880000
548,0.403378400000,0.990312800000,0.010377920000
549,0.418311500000,0.992811600000,0.009529306000
550,0.433449900000,0.994950100000,0.008749999000
551,0.448795300000,0.996710800000,0.008035200000
552,0.464336000000,0.998098300000,0.007381600000
553,0.480064000000,0.999112000000,0.006785400000
554,0.495971300000,0.999748200000,0.006242800000
555,0.512050100000,1.000000000000,0.005749999000
556,0.528295900000,0.999856700000,0.005303600000
557,0.544691600000,0.999304600000,0.004899800000
558,0.561209400000,0.998325500000,0.004534200000
559,0.577821500000,0.996898700000,0.004202400000
560,0.594500000000,0.995000000000,0.003900000000
561,0.611220900000,0.992600500000,0.003623200000
562,0.627975800000,0.989742600000,0.003370600000
563,0.644760200000,0.986444400000,0.003141400000
564,0.661569700000,0.982724100000,0.002934800000
565,0.678400000000,0.978600000000,0.002749999000
566,0.695239200000,0.974083700000,0.002585200000
567,0.712058600000,0.969171200000,0.002438600000
568,0.728828400000,0.963856800000,0.002309400000
569,0.745518800000,0.958134900000,0.002196800000
570,0.762100000000,0.952000000000,0.002100000000
571,0.778543200000,0.945450400000,0.002017733000
572,0.794825600000,0.938499200000,0.001948200000
573,0.810926400000,0.931162800000,0.001889800000
574,0.826824800000,0.923457600000,0.001840933000
575,0.842500000000,0.915400000000,0.001800000000
576,0.857932500000,0.907006400000,0.001766267000
577,0.873081600000,0.898277200000,0.001737800000
578,0.887894400000,0.889204800000,0.001711200000
579,0.902318100000,0.879781600000,0.001683067000
580,0.916300000000,0.870000000000,0.001650001000
581,0.929799500000,0.859861300000,0.001610133000
582,0.942798400000,0.849392000000,0.001564400000
583,0.955277600000,0.838622000000,0.001513600000
584,0.967217900000,0.827581300000,0.001458533000
585,0.978600000000,0.816300000000,0.001400000000
586,0.989385600000,0.804794700000,0.001336667000
587,0.999548800000,0.793082000000,0.001270000000
588,1.009089200000,0.781192000000,0.001205000000
589,1.018006400000,0.769154700000,0.001146667000
590,1.026300000000,0.757000000000,0.001100000000
591,1.033982700000,0.744754100000,0.001068800000
592,1.040986000000,0.732422400000,0.001049400000
593,1.047188000000,0.720003600000,0.001035600000
594,1.052466700000,0.707496500000,0.001021200000
595,1.056700000000,0.694900000000,0.001000000000
596,1.059794400000,0.682219200000,0.000968640000
597,1.061799200000,0.669471600000,0.000929920000
598,1.062806800000,0.656674400000,0.000886880000
599,1.062909600000,0.643844800000,0.000842560000
600,1.062200000000,0.631000000000,0.000800000000
601,1.060735200000,0.618155500000,0.000760960000
602,1.058443600000,0.605314400000,0.000723680000
603,1.055224400000,0.592475600000,0.000685920000
604,1.050976800000,0.579637900000,0.000645440000
605,1.045600000000,0.566800000000,0.000600000000
606,1.039036900000,0.553961100000,0.000547866700
607,1.031360800000,0.541137200000,0.000491600000
608,1.022666200000,0.528352800000,0.000435400000
609,1.013047700000,0.515632300000,0.000383466700
610,1.002600000000,0.503000000000,0.000340000000
611,0.991367500000,0.490468800000,0.000307253300
612,0.979331400000,0.478030400000,0.000283160000
613,0.966491600000,0.465677600000,0.000265440000
614,0.952847900000,0.453403200000,0.000251813300
615,0.938400000000,0.441200000000,0.000240000000
616,0.923194000000,0.429080000000,0.000229546700
617,0.907244000000,0.417036000000,0.000220640000
618,0.890502000000,0.405032000000,0.000211960000
619,0.872920000000,0.393032000000,0.000202186700
620,0.854449900000,0.381000000000,0.000190000000
621,0.835084000000,0.368918400000,0.000174213300
622,0.814946000000,0.356827200000,0.000155640000
623,0.794186000000,0.344776800000,0.000135960000
624,0.772954000000,0.332817600000,0.000116853300
625,0.751400000000,0.321000000000,0.000100000000
626,0.729583600000,0.309338100000,0.000086133330
627,0.707588800000,0.297850400000,0.000074600000
628,0.685602200000,0.286593600000,0.000065000000
629,0.663810400000,0.275624500000,0.000056933330
630,0.642400000000,0.265000000000,0.000049999990
631,0.621514900000,0.254763200000,0.000044160000
632,0.601113800000,0.244889600000,0.000039480000
633,0.581105200000,0.235334400000,0.000035720000
634,0.561397700000,0.226052800000,0.000032640000
635,0.541900000000,0.217000000000,0.000030000000
636,0.522599500000,0.208161600000,0.000027653330
637,0.503546400000,0.199548800000,0.000025560000
638,0.484743600000,0.191155200000,0.000023640000
639,0.466193900000,0.182974400000,0.000021813330
640,0.447900000000,0.175000000000,0.000020000000
641,0.429861300000,0.167223500000,0.000018133330
642,0.412098000000,0.159646400000,0.000016200000
643,0.394644000000,0.152277600000,0.000014200000
644,0.377533300000,0.145125900000,0.000012133330
645,0.360800000000,0.138200000000,0.000010000000
646,0.344456300000,0.131500300000,0.000007733333
647,0.328516800000,0.125024800000,0.000005400000
648,0.313019200000,0.118779200000,0.000003200000
649,0.298001100000,0.112769100000,0.000001333333
650,0.283500000000,0.107000000000,0.000000000000
651,0.269544800000,0.101476200000,0.000000000000
652,0.256118400000,0.096188640000,0.000000000000
653,0.243189600000,0.091122960000,0.000000000000
654,0.230727200000,0.086264850000,0.000000000000
655,0.218700000000,0.081600000000,0.000000000000
656,0.207097100000,0.077120640000,0.000000000000
657,0.195923200000,0.072825520000,0.000000000000
658,0.185170800000,0.068710080000,0.000000000000
659,0.174832300000,0.064769760000,0.000000000000
660,0.164900000000,0.061000000000,0.000000000000
661,0.155366700000,0.057396210000,0.000000000000
662,0.146230000000,0.053955040000,0.000000000000
663,0.137490000000,0.050673760000,0.000000000000
664,0.129146700000,0.047549650000,0.000000000000
665,0.121200000000,0.044580000000,0.000000000000
666,0.113639700000,0.041758720000,0.000000000000
667,0.106465000000,0.039084960000,0.000000000000
668,0.099690440000,0.036563840000,0.000000000000
669,0.093330610000,0.034200480000,0.000000000000
670,0.087400000000,0.032000000000,0.000000000000
671,0.081900960000,0.029962610000,0.000000000000
672,0.076804280000,0.028076640000,0.000000000000
673,0.072077120000,0.026329360000,0.000000000000
674,0.067686640000,0.024708050000,0.000000000000
675,0.063600000000,0.023200000000,0.000000000000
676,0.059806850000,0.021800770000,0.000000000000
677,0.056282160000,0.020501120000,0.000000000000
678,0.052971040000,0.019281080000,0.000000000000
679,0.049818610000,0.018120690000,0.000000000000
680,0.046770000000,0.017000000000,0.000000000000
681,0.043784050000,0.015903790000,0.000000000000
682,0.040875360000,0.014837180000,0.000000000000
683,0.038072640000,0.013810680000,0.000000000000
684,0.035404610000,0.012834780000,0.000000000000
685,0.032900000000,0.011920000000,0.000000000000
686,0.030564190000,0.011068310000,0.000000000000
687,0.028380560000,0.010273390000,0.000000000000
688,0.026344840000,0.009533311000,0.000000000000
689,0.024452750000,0.008846157000,0.000000000000
690,0.022700000000,0.008210000000,0.000000000000
691,0.021084290000,0.007623781000,0.000000000000
692,0.019599880000,0.007085424000,0.000000000000
693,0.018237320000,0.006591476000,0.000000000000
694,0.016987170000,0.006138485000,0.000000000000
695,0.015840000000,0.005723000000,0.000000000000
696,0.014790640000,0.005343059000,0.000000000000
697,0.013831320000,0.004995796000,0.000000000000
698,0.012948680000,0.004676404000,0.000000000000
699,0.012129200000,0.004380075000,0.000000000000
700,0.011359160000,0.004102000000,0.000000000000
701,0.010629350000,0.003838453000,0.000000000000
702,0.009938846000,0.003589099000,0.000000000000
703,0.009288422000,0.003354219000,0.000000000000
704,0.008678854000,0.003134093000,0.000000000000
705,0.008110916000,0.002929000000,0.000000000000
706,0.007582388000,0.002738139000,0.000000000000
707,0.007088746000,0.002559876000,0.000000000000
708,0.006627313000,0.002393244000,0.000000000000
709,0.006195408000,0.002237275000,0.000000000000
710,0.005790346000,0.002091000000,0.000000000000
711,0.005409826000,0.001953587000,0.000000000000
712,0.005052583000,0.001824580000,0.000000000000
713,0.004717512000,0.001703580000,0.000000000000
714,0.004403507000,0.001590187000,0.000000000000
715,0.004109457000,0.001484000000,0.000000000000
716,0.003833913000,0.001384496000,0.000000000000
717,0.003575748000,0.001291268000,0.000000000000
718,0.003334342000,0.001204092000,0.000000000000
719,0.003109075000,0.001122744000,0.000000000000
720,0.002899327000,0.001047000000,0.000000000000
721,0.002704348000,0.000976589600,0.000000000000
722,0.002523020000,0.000911108800,0.000000000000
723,0.002354168000,0.000850133200,0.000000000000
724,0.002196616000,0.000793238400,0.000000000000
725,0.002049190000,0.000740000000,0.000000000000
726,0.001910960000,0.000690082700,0.000000000000
727,0.001781438000,0.000643310000,0.000000000000
728,0.001660110000,0.000599496000,0.000000000000
729,0.001546459000,0.000558454700,0.000000000000
730,0.001439971000,0.000520000000,0.000000000000
731,0.001340042000,0.000483913600,0.000000000000
732,0.001246275000,0.000450052800,0.000000000000
733,0.001158471000,0.000418345200,0.000000000000
734,0.001076430000,0.000388718400,0.000000000000
735,0.000999949300,0.000361100000,0.000000000000
736,0.000928735800,0.000335383500,0.000000000000
737,0.000862433200,0.000311440400,0.000000000000
738,0.000800750300,0.000289165600,0.000000000000
739,0.000743396000,0.000268453900,0.000000000000
740,0.000690078600,0.000249200000,0.000000000000
741,0.000640515600,0.000231301900,0.000000000000
742,0.000594502100,0.000214685600,0.000000000000
743,0.000551864600,0.000199288400,0.000000000000
744,0.000512429000,0.000185047500,0.000000000000
745,0.000476021300,0.000171900000,0.000000000000
746,0.000442453600,0.000159778100,0.000000000000
747,0.000411511700,0.000148604400,0.000000000000
748,0.000382981400,0.000138301600,0.000000000000
749,0.000356649100,0.000128792500,0.000000000000
750,0.000332301100,0.000120000000,0.000000000000
751,0.000309758600,0.000111859500,0.000000000000
752,0.000288887100,0.000104322400,0.000000000000
753,0.000269539400,0.000097335600,0.000000000000
754,0.000251568200,0.000090845870,0.000000000000
755,0.000234826100,0.000084800000,0.000000000000
756,0.000219171000,0.000079146670,0.000000000000
757,0.000204525800,0.000073858000,0.000000000000
758,0.000190840500,0.000068916000,0.000000000000
759,0.000178065400,0.000064302670,0.000000000000
760,0.000166150500,0.000060000000,0.000000000000
761,0.000155023600,0.000055981870,0.000000000000
762,0.000144621900,0.000052225600,0.000000000000
763,0.000134909800,0.000048718400,0.000000000000
764,0.000125852000,0.000045447470,0.000000000000
765,0.000117413000,0.000042400000,0.000000000000
766,0.000109551500,0.000039561040,0.000000000000
767,0.000102224500,0.000036915120,0.000000000000
768,0.000095394450,0.000034448680,0.000000000000
769,0.000089023900,0.000032148160,0.000000000000
770,0.000083075270,0.000030000000,0.000000000000
771,0.000077512690,0.000027991250,0.000000000000
772,0.000072313040,0.000026113560,0.000000000000
773,0.000067457780,0.000024360240,0.000000000000
774,0.000062928440,0.000022724610,0.000000000000
775,0.000058706520,0.000021200000,0.000000000000
776,0.000054770280,0.000019778550,0.000000000000
777,0.000051099180,0.000018452850,0.000000000000
778,0.000047676540,0.000017216870,0.000000000000
779,0.000044485670,0.000016064590,0.000000000000
780,0.000041509940,0.000014990000,0.000000000000
781,0.000038733240,0.000013987280,0.000000000000
782,0.000036142030,0.000013051550,0.000000000000
783,0.000033723520,0.000012178180,0.000000000000
784,0.000031464870,0.000011362540,0.000000000000
785,0.000029353260,0.000010600000,0.000000000000
786,0.000027375730,0.000009885877,0.000000000000
787,0.000025524330,0.000009217304,0.000000000000
788,0.000023793760,0.000008592362,0.000000000000
789,0.000022178700,0.000008009133,0.000000000000
790,0.000020673830,0.000007465700,0.000000000000
791,0.000019272260,0.000006959567,0.000000000000
792,0.000017966400,0.000006487995,0.000000000000
793,0.000016749910,0.000006048699,0.000000000000
794,0.000015616480,0.000005639396,0.000000000000
795,0.000014559770,0.000005257800,0.000000000000
796,0.000013573870,0.000004901771,0.000000000000
797,0.000012654360,0.000004569720,0.000000000000
798,0.000011797230,0.000004260194,0.000000000000
799,0.000010998440,0.000003971739,0.000000000000
800,0.000010253980,0.000003702900,0.000000000000
801,0.000009559646,0.000003452163,0.000000000000
802,0.000008912044,0.000003218302,0.000000000000
803,0.000008308358,0.000003000300,0.000000000000
804,0.000007745769,0.000002797139,0.000000000000
805,0.000007221456,0.000002607800,0.000000000000
806,0.000006732475,0.000002431220,0.000000000000
807,0.000006276423,0.000002266531,0.000000000000
808,0.000005851304,0.000002113013,0.000000000000
809,0.000005455118,0.000001969943,0.000000000000
810,0.000005085868,0.000001836600,0.000000000000
811,0.000004741466,0.000001712230,0.000000000000
812,0.000004420236,0.000001596228,0.000000000000
813,0.000004120783,0.000001488090,0.000000000000
814,0.000003841716,0.000001387314,0.000000000000
815,0.000003581652,0.000001293400,0.000000000000
816,0.000003339127,0.000001205820,0.000000000000
817,0.000003112949,0.000001124143,0.000000000000
818,0.000002902121,0.000001048009,0.000000000000
819,0.000002705645,0.000000977058,0.000000000000
820,0.000002522525,0.000000910930,0.000000000000
821,0.000002351726,0.000000849251,0.000000000000
822,0.000002192415,0.000000791721,0.000000000000
823,0.000002043902,0.000000738090,0.000000000000
824,0.000001905497,0.000000688110,0.000000000000
825,0.000001776509,0.000000641530,0.000000000000
826,0.000001656215,0.000000598090,0.000000000000
827,0.000001544022,0.000000557575,0.000000000000
828,0.000001439440,0.000000519808,0.000000000000
829,0.000001341977,0.000000484612,0.000000000000
830,0.000001251141,0.000000451810,0.000000000000123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687{ "catalog_id": "CHEM-151", "built_at": "2026-09-26T00:05:56.714310+00:00", "script": "derive_optics_parameters.py", "model": "d^2 = 4I/(pi^2 beta a^2) + (Cs a^3/2)^2 + (Cc a dE/E0)^2 + (1.22 lambda/a)^2 at the optimum a; quoted resolution = K_RES d", "fixed": { "beta_reduced_A_m2_sr_V": 33333.333333333336, "energy_spread_eV": 1.5, "test_probe_current_A": 3e-12, "edge_resolution_factor": 0.6, "lens_gap_m": 0.002 }, "fitted": { "c_s": 0.9315669301523783, "c_c": 0.1320663205093771, "Cs_at_8mm_m": 0.009315669301523784, "Cc_at_8mm_m": 0.001320663205093771, "rms_log_error": 0.026419401556548577 }, "bed_lv_resolution_factor": 1.430569028448803, "reproduced": [ { "kv": 30.0, "wd_mm": 8.0, "catalogue_nm": 3.0, "model_nm": 3.0619849421713834, "probe_nm": 5.103308236952305, "alpha_mrad": 8.151742790420595, "rel_error": 0.020661647390461058 }, { "kv": 3.0, "wd_mm": 6.0, "catalogue_nm": 8.0, "model_nm": 7.707058783048531, "probe_nm": 12.845097971747553, "alpha_mrad": 10.985859336200035, "rel_error": -0.03661765211893364 }, { "kv": 1.0, "wd_mm": 6.0, "catalogue_nm": 14.999999999999998, "model_nm": 15.254949626593532, "probe_nm": 25.424916044322558, "alpha_mrad": 10.62139488762313, "rel_error": 0.016996641772902388 } ], "lv": { "catalogue_nm": 4.0, "wd_m": 0.005, "pressure_pa": 10.0, "hv_model_nm_at_that_wd": 2.7960901714314943 }, "caveat_zh": "β与Cs、ΔE与Cc互相替代,拟合不唯一;常数是能复现目录分辨率的等效模型,不是实测透镜数据。", "environment": { "python": "3.12.14", "numpy": "2.3.1", "platform": "Linux-x86_64" }, "checks": [ { "id": "fit_within_5_percent", "ok": true, "detail": [ 0.0207, -0.0366, 0.017 ] }, { "id": "cs_cc_positive_and_finite", "ok": true, "detail": [ 0.9315669301523783, 0.1320663205093771 ] }, { "id": "bed_factor_above_one", "ok": true, "detail": 1.430569028448803 } ], "status": "passed"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518"""Lake Shore8604, room-temperature86-LC/standard poles/ExactGAP2.SI magnetic moment A m2 (1 emu=1e-3 A m2). Rate-limited external B,explicit interval-mean lock-in observations, synthetic Preisach memory whenrequested, and separately conserved electrical/magnetic/passive-thermal energy."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npPROTOCOL_VERSION='1.0.0';SLUG='lakeshore_8604vsm';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-143'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'magnetic_library.json'MU0=4e-7*math.pi;MAX_FIELD_T=2.37;FIELD_RESOLUTION_T=1e-7;MIN_MOMENT_A_M2=2.5e-11;MAX_MOMENT_A_M2=1.class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
def library():return {x['id']:x for x in json.loads(LIBRARY_PATH.read_text())['templates']}def quant(value,resolution):return float(round(value/resolution)*resolution)def weighted_exponential_integrals(dt,tau): x=dt/tau if x<.5: out=[] for n in range(3): term=1/(n+1);total=term for k in range(1,30):term*=-x/(n+k+1);total+=term out.append(dt**(n+1)*total) return out j0=-tau*math.expm1(-x);j1=tau*dt-tau*j0;return j0,j1,tau*dt*dt-2*tau*j1
def infer_moment(voltage_v,sensitivity_v_per_a_m2,calibration_gain,calibration_offset_v): if sensitivity_v_per_a_m2<=0 or calibration_gain<=0:raise ActionRejected('CALIBRATION_INVALID') return (voltage_v-calibration_offset_v)*calibration_gain/sensitivity_v_per_a_m2
def analyze_loop(rows): if len(rows)<3 or any(x['moment_a_m2'] is None for x in rows):raise ActionRejected('INVALID_OBSERVATIONS') crossings=[];remanence=[] for a,b in zip(rows,rows[1:]): b0,b1=a['field_t'],b['field_t'];m0,m1=a['moment_a_m2'],b['moment_a_m2'];direction='ascending' if b1>b0 else 'descending' if b0==b1:continue if m0*m1<=0 and m0!=m1: value=b0-m0*(b1-b0)/(m1-m0);crossings.append(dict(field_t=value,external_h_a_m=value/MU0,direction=direction)) if b0*b1<=0: value=m0-b0*(m1-m0)/(b1-b0);remanence.append(dict(moment_a_m2=value,direction=direction)) area=float(sum((a['field_t']+b['field_t'])*.5*(b['moment_a_m2']-a['moment_a_m2']) for a,b in zip(rows,rows[1:]))) return dict(coercive_crossings=crossings,remanence_estimates=remanence,observed_b_dm_j=area,evidence='external_observations_linear_zero_crossings; applied_B_over_mu0_is_external_H_not_demagnetization_corrected_internal_H; open_path_integral_not_necessarily_cycle_loss')
def analyze_forc(rows): valid=[r for r in rows if r['reversal_field_t'] is not None] if len(valid)<6 or any(r['moment_a_m2'] is None for r in valid):raise ActionRejected('INVALID_OBSERVATIONS') x=np.array([[r['field_t'],r['reversal_field_t']] for r in valid]);y=np.array([r['moment_a_m2'] for r in valid]);scale=float(np.ptp(x,axis=0).max()) if scale<=0 or len(set(x[:,1]))<3:raise ActionRejected('FORC_GRID_REQUIRED') out=[] for i,point in enumerate(x): ids=np.argsort(np.linalg.norm(x-point,axis=1))[:min(15,len(x))];q=(x[ids]-point)/scale;A=np.column_stack([np.ones(len(q)),q[:,0],q[:,1],q[:,0]**2,q[:,0]*q[:,1],q[:,1]**2]) if np.linalg.matrix_rank(A)<6:continue c=np.linalg.lstsq(A,y[ids],rcond=None)[0];out.append(dict(field_t=float(point[0]),reversal_field_t=float(point[1]),coercive_coordinate_t=float((point[0]-point[1])/2),interaction_coordinate_t=float((point[0]+point[1])/2),density_a_m2_per_t2=float(-.5*c[4]/scale**2),fit_residual_a_m2=float(np.sqrt(np.mean((A@c-y[ids])**2))),neighbours=len(ids))) if not out:raise ActionRejected('FORC_GRID_REQUIRED') return dict(distribution=out,evidence='local_quadratic_fit_to_external_FORC_observations; rho=-0.5*d2m/(dB*dBr); SI_A_m2_per_T2; not_unique_material_microstructure_or_FORCinel_reproduction')
PLANT_EXAMPLE=dict(ambient_k=300.,field_per_current_t_a=.04,coil_inductance_h=.05,coil_resistance_ohm=.25,magnet_thermal_capacity_j_k=5000.,magnet_cooling_conductance_w_k=50.,sample_local_capacity_j_k=.01,sample_conductance_w_k=.01,pickup_coupling_wb_per_a_m3=.1,voltage_gain=1.03,voltage_offset_v=2e-7,detector_tau_s=.01,lift_speed_m_s=.1,rotation_speed_rad_s=1.,drawer_speed_m_s=.1,accept_engineering=True)PLANT=obj({k:(BOOL if type(v) is bool else number({'ambient_k':'K','field_per_current_t_a':'T/A','coil_inductance_h':'H','coil_resistance_ohm':'ohm','magnet_thermal_capacity_j_k':'J/K','magnet_cooling_conductance_w_k':'W/K','sample_local_capacity_j_k':'J/K','sample_conductance_w_k':'W/K','pickup_coupling_wb_per_a_m3':'Wb/(A*m^3)','voltage_gain':'1','voltage_offset_v':'V','detector_tau_s':'s','lift_speed_m_s':'m/s','rotation_speed_rad_s':'rad/s','drawer_speed_m_s':'m/s'}[k], -1. if k=='voltage_offset_v' else 1e-12)) for k,v in PLANT_EXAMPLE.items()})PLANT['properties']['ambient_k']=number('K',285,303)VIBRATION_EXAMPLE=dict(enabled=True,amplitude_m=.0005,frequency_hz=82.)VIBRATION=obj(dict(enabled=BOOL,amplitude_m=number('m',1e-6,.001),frequency_hz=number('Hz',1,200)))COIL_EXAMPLE=dict(nominal_coupling_wb_per_a_m3=.1,moment_range_a_m2=.01)COIL=obj(dict(nominal_coupling_wb_per_a_m3=number('Wb/(A*m^3)',1e-10,1e6),moment_range_a_m2=number('A*m^2',MIN_MOMENT_A_M2,MAX_MOMENT_A_M2)))RELAY=obj(dict(coercive_field_t=number('T',1e-8,10),bias_field_t=number('T',-10,10),weight=number('1',1e-12,1),initial_sign={'type':'integer','enum':[-1,1],'x-unit':'1'}))RELAYS_EXAMPLE=[dict(coercive_field_t=v,bias_field_t=0.,weight=1/5,initial_sign=-1) for v in [.02,.035,.05,.065,.08]]SAMPLE_EXAMPLE=dict(reference_id='kuleuven_cf_300k',mass_kg=5e-5,volume_m3=math.pi*(.001)**2*.002,specific_heat_capacity_j_kg_k=650.,initial_temperature_k=300.,temperature_tolerance_k=.5,linear_valid_max_field_t=.6,magnetic_model='preisach_proxy',proxy_specific_moment_a_m2_kg=None,relays=RELAYS_EXAMPLE,accept_engineering_assumptions=True)SAMPLE=obj(dict(reference_id=TEXT,mass_kg=number('kg',0,.01),volume_m3=number('m^3',1e-15,1e-5),specific_heat_capacity_j_kg_k=number('J/(kg*K)',1,1e5),initial_temperature_k=number('K',285,303),temperature_tolerance_k=number('K',0,5),linear_valid_max_field_t=number('T',1e-7,MAX_FIELD_T),magnetic_model=enum(['linear_susceptibility','preisach_proxy']),proxy_specific_moment_a_m2_kg=nullable(number('A*m^2/kg',0,1e5)),relays=array(RELAY,1,1000),accept_engineering_assumptions=BOOL))STANDARD_EXAMPLE=dict(mass_kg=.00006316,volume_m3=math.pi/6*.002383**3,specific_heat_capacity_j_kg_k=440.,initial_temperature_k=298.,reference_field_t=MU0*398000.,reference_moment_a_m2=.00347,accept_host_standard_proxy=True)STANDARD=obj(dict(mass_kg=number('kg',0,.01),volume_m3=number('m^3',1e-15,1e-5),specific_heat_capacity_j_kg_k=number('J/(kg*K)',1,1e5),initial_temperature_k=number('K',285,303),reference_field_t=number('T',1e-7,MAX_FIELD_T),reference_moment_a_m2=number('A*m^2',MIN_MOMENT_A_M2,MAX_MOMENT_A_M2),accept_host_standard_proxy=BOOL))METHOD_EXAMPLE=dict(field_points_t=[.2,.1,.075,.05,.025,0.,-.025,-.05,-.075,-.1,-.2,-.1,-.075,-.05,-.025,0.,.025,.05,.075,.1,.2],ramp_rate_t_s=1.,averaging_time_s=.05,settling_time_s=.05,require_calibration=False)METHOD=obj(dict(field_points_t=array(number('T',-MAX_FIELD_T,MAX_FIELD_T),1,50000),ramp_rate_t_s=number('T/s',1e-6,1),averaging_time_s=number('s',.01,3600),settling_time_s=number('s',0,3600),require_calibration=BOOL))FORC_EXAMPLE=dict(saturation_field_t=.2,reversal_fields_t=[-.12,-.08,-.04,0.],points_per_curve=9,ramp_rate_t_s=1.,averaging_time_s=.05,settling_time_s=.05,require_calibration=False)FORC=obj(dict(saturation_field_t=number('T',1e-7,MAX_FIELD_T),reversal_fields_t=array(number('T',-MAX_FIELD_T,MAX_FIELD_T),3,1000),points_per_curve={'type':'integer','minimum':3,'maximum':1000,'x-unit':'1'},ramp_rate_t_s=number('T/s',1e-6,1),averaging_time_s=number('s',.01,3600),settling_time_s=number('s',0,3600),require_calibration=BOOL))ROW=obj(dict(point_index={'type':'integer','x-unit':'1'},field_t=number('T'),external_h_a_m=number('A/m'),in_phase_voltage_v=number('V'),moment_a_m2=nullable(number('A*m^2')),angle_rad=number('rad'),window_start_s=number('s'),window_end_s=number('s'),reversal_field_t=nullable(number('T')),quality=enum(['estimated','below_documented_dynamic_range','overflow','reference_temperature_invalid'])))RESULT=obj(dict(operation_id=nullable(TEXT),phase=PHASE,kind=TEXT,elapsed_s=number('s'),rows=array(ROW),error=nullable(TEXT),template_source=nullable(TEXT),evidence=TEXT))LEDGER_KEYS=['loaded_mass_kg','removed_mass_kg','mass_kg','mass_residual_kg','loaded_volume_m3','removed_volume_m3','volume_m3','volume_residual_m3','source_energy_j','coil_joule_j','magnetic_work_j','hysteresis_heat_j','sample_sensible_loaded_j','sample_sensible_removed_j','magnetic_loaded_j','magnetic_removed_j','coil_stored_j','magnetic_stored_j','sample_thermal_j','magnet_thermal_j','sample_heat_export_j','magnet_heat_export_j','energy_residual_j']LEDGER=obj({k:number('kg' if k.endswith('_kg') else 'm^3' if k.endswith('_m3') else 'J') for k in LEDGER_KEYS})CROSS=obj(dict(field_t=number('T'),external_h_a_m=number('A/m'),direction=enum(['ascending','descending'])))LOOP_OUTPUT=obj(dict(coercive_crossings=array(CROSS),remanence_estimates=array(obj(dict(moment_a_m2=number('A*m^2'),direction=enum(['ascending','descending'])))),observed_b_dm_j=number('J'),evidence=TEXT))FORC_OUTPUT=obj(dict(distribution=array(obj(dict(field_t=number('T'),reversal_field_t=number('T'),coercive_coordinate_t=number('T'),interaction_coordinate_t=number('T'),density_a_m2_per_t2=number('A*m^2/T^2'),fit_residual_a_m2=number('A*m^2'),neighbours={'type':'integer','x-unit':'1'}))),evidence=TEXT))CAPS={}def cap(k,s,o,example,component,meaning,visibility='agent',kind='device_command'):CAPS[k]=dict(input_schema=s,output_schema=o,example_arguments=example,component_ids=[component],function_zh=meaning,visibility=visibility,kind=kind,effects=[])for key,schema,example,component in [('plant.configure',PLANT,PLANT_EXAMPLE,'magnet'),('coil.configure',COIL,COIL_EXAMPLE,'controller'),('method.configure',METHOD,METHOD_EXAMPLE,'controller'),('forc.configure',FORC,FORC_EXAMPLE,'controller')]:cap(key,schema,obj(dict(configured=BOOL)),example,component,'设置明确工程参数或采集方法;不推进时间','evaluator' if key=='plant.configure' else 'agent','configuration')cap('sample.load',SAMPLE,obj(dict(present=BOOL)),SAMPLE_EXAMPLE,'sample','载入真实磁性参考与显式磁滞/热假设','evaluator')cap('standard.load',STANDARD,obj(dict(present=BOOL)),STANDARD_EXAMPLE,'sample','宿主装入已知磁矩标准代理;真实标准证书并非对本仿真认证','evaluator')cap('sample.remove',obj({}),obj(dict(removed_mass_kg=number('kg'),removed_volume_m3=number('m^3'))),{},'sample','取走磁性库存、质量和当前显热','evaluator')cap('power.set',obj(dict(enabled=BOOL)),obj(dict(enabled=BOOL)),{'enabled':True},'power_switch','控制电源;非零场拒绝断电以免瞬间销毁储能')cap('field.set_target',obj(dict(field_t=number('T',-MAX_FIELD_T,MAX_FIELD_T),ramp_rate_t_s=number('T/s',1e-6,1))),obj(dict(target_t=number('T'))),dict(field_t=.1,ramp_rate_t_s=1.),'power_supply','只写量化目标,B由step以有限速率推进')cap('sample.set_lift',obj(dict(lift_m=number('m',0,.35))),obj(dict(target_m=number('m'))),dict(lift_m=0.),'head_lift','电动测量头有限速率升降,需零场/振动关闭')cap('sample.set_angle',obj(dict(angle_rad=number('rad',-1e6,1e6))),obj(dict(target_rad=number('rad'))),dict(angle_rad=math.pi/2),'sample_rotor','零外场、关闭振动后以0.1度设置分辨有限旋转')cap('storage.set_open',obj(dict(opened=BOOL)),obj(dict(target_m=number('m'))),dict(opened=True),'storage_drawer','手工抽屉工程有限运动代理','evaluator')cap('vibration.configure',VIBRATION,obj(dict(enabled=BOOL)),VIBRATION_EXAMPLE,'vibration_carriage','配置振动工程频率幅度;解析采样姿态与锁相包络,非完整波形求解')cap('calibration.start',obj(dict(reference_moment_a_m2=number('A*m^2',MIN_MOMENT_A_M2,1),field_t=number('T',1e-6,MAX_FIELD_T),averaging_time_s=number('s',.01,3600))),obj(dict(operation_id=TEXT)),dict(reference_moment_a_m2=.00347,field_t=MU0*398000.,averaging_time_s=1.),'controller','实际正负场积分观测拟合增益/零偏,不读隐藏真实增益')cap('calibration.clear',obj({}),obj(dict(valid=BOOL)),{},'controller','清除校准')cap('acquisition.start',obj({}),obj(dict(operation_id=TEXT)),{},'controller','依有限扫场、等待、真实积分采集loop或FORC')cap('acquisition.stop',obj({}),obj(dict(phase=PHASE,elapsed_s=number('s'))),{},'controller','保留完成读数及磁记忆/热账,停止扫场于实际值')cap('acquisition.result',obj({}),RESULT,{},'controller','返回实际区间观测及明确合成模型标记','agent','query')cap('analysis.loop',obj(dict(rows=array(ROW,3))),LOOP_OUTPUT,dict(rows=[]),'controller','从外部曲线估计零场剩磁、零矩外场矫顽与路径功','agent','analysis')cap('analysis.forc',obj(dict(rows=array(ROW,6))),FORC_OUTPUT,dict(rows=[]),'controller','从外部FORC局部二次拟合混合导数','agent','analysis')cap('analysis.moment',obj(dict(voltage_v=number('V'),sensitivity_v_per_a_m2=number('V/(A*m^2)',1e-12),calibration_gain=number('1',1e-12),calibration_offset_v=number('V'))),obj(dict(moment_a_m2=number('A*m^2'))),dict(voltage_v=.001,sensitivity_v_per_a_m2=1.,calibration_gain=1.,calibration_offset_v=0.),'controller','仅按外部电压/校准/灵敏度反演磁矩','agent','analysis')cap('provenance.read',obj({}),obj(dict(current_sample=nullable(TEXT),operation_source=nullable(TEXT))),{},'controller','选中来源与测量来源快照仅限宿主','evaluator','query')cap('ledger.read',obj({}),LEDGER,{},'controller','受限样品库存及有范围的电磁热能账','evaluator','query')cap('sim.step',obj(dict(dt_s=number('s',0,86400))),obj(dict(time_s=number('s'))),dict(dt_s=.02),'controller','唯一宿主时钟','evaluator','simulation')UNSUPPORTED={'hardware.connect':'没有真实驱动','robot.load':'没有机器人装样','thermal.set_temperature':'未选温控附件,不能给基础仪器假加热器','magnet.change_gap':'固定标准极帽Gap2,无在线极距/高场帽切换','measurement.vector':'未选矢量线圈','noise.empirical':'无独立实测噪声模型,不从15nemu规格虚构分布','accuracy.certification':'未验证厂家条件准确度','analysis.unique_forc_from_major_loop':'majorloop不能唯一决定FORC或微结构'}for k,v in UNSUPPORTED.items():cap(k,obj({}),obj({}),{},'controller',v)SLOTS={}def slot(k,s,unit,origin,component,meaning,visibility='agent'):SLOTS[k]=dict(schema=s,unit=unit,origin=origin,component=component,meaning=meaning,visibility=visibility,write=None)slot('clock.time_s',number('s'),'s','derived','controller','宿主统一仿真时钟,read不推进')for k in ['plant.configured','coil.configured','method.configured','sample.present','power.enabled','vibration.enabled','calibration.valid']:slot(k,BOOL,'1','setpoint','controller','已配置/存在/启用状态;不是完整计量认证')for k in ['sample.lift_m','sample.target_lift_m','storage.position_m','storage.target_m']:slot(k,number('m'),'m','scene' if 'target' not in k else 'setpoint','head_lift' if k.startswith('sample') else 'storage_drawer','实际有限运动位置或目标,单位m;只由宿主step推进')for k in ['sample.angle_rad','sample.target_angle_rad','sample.orientation_rad']:slot(k,number('rad'),'rad','scene' if 'target' not in k else 'setpoint','sample_rotor','无界累计转角/目标及周期等价场景姿态;不是磁性各向异性实测参数')slot('sample.vibration_z_m',number('m'),'m','scene','vibration_carriage','工程正弦振动解析时刻姿态;场景采样可混叠,不声称解析全频运动')slot('power.angle_rad',number('rad'),'rad','scene','power_switch','开关显示姿态代理')for k in ['field.target_t','field.indicated_t']:slot(k,nullable(number('T')) if 'indicated' in k else number('T'),'T','sensor' if 'indicated' in k else 'setpoint','hall_probe','Gap2外施空气场B或量化目标;100nT分辨;不是样品内部B')slot('field.external_h_a_m',nullable(number('A/m')),'A/m','derived','hall_probe','外场B/μ0,未做样品退磁场修正')slot('moment.indicated_a_m2',nullable(number('A*m^2')),'A*m^2','sensor','controller','锁相包络估算磁矩;1emu=1e-3 A m²,掉电/未开振动不可用')slot('detector.in_phase_v',nullable(number('V')),'V','sensor','controller','有符号锁相同相电压包络含工程一阶响应,不是负RMS幅值')for k in ['thermal.sample_k','thermal.magnet_k']:slot(k,nullable(number('K')),'K','sensor','sample' if 'sample' in k else 'magnet','模型被动集中热节点;不是温控附件或整机热容')slot('acquisition.phase',PHASE,'1','derived','controller','异步操作终态或运行态')slot('acquisition.stage',TEXT,'1','derived','controller','ramping/settling/averaging,均等待真实host时间')slot('acquisition.elapsed_s',number('s'),'s','derived','controller','操作实际已耗时间')slot('acquisition.points',{'type':'integer','x-unit':'1'},'1','derived','controller','已完成积分观测数')slot('calibration.gain',number(),'1','derived','controller','外部±已知磁矩与实际观测拟合出的乘性校正')slot('calibration.offset_v',number('V'),'V','derived','controller','外部双极标准观测拟合出的电压零偏')for k,u in [('truth.field_t','T'),('truth.moment_a_m2','A*m^2'),('truth.mass_kg','kg'),('truth.sample_k','K')]:slot(k,number(u),u,'process_truth','sample','受限过程真值,公共结果不透出材料身份','evaluator')
class LakeShore8604VsmRuntime: def __init__(self,instance_id='vsm_01'): self.instance_id=instance_id;self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0;self.power=False;self.plant=None;self.coil=None;self.method=None;self.sample=None;self.record=None;self.source=None self.axes={k:dict(position=v,target=v,start=v,start_ns=0,arrival_ns=0) for k,v in [('field',0.),('lift',.35),('angle',0.),('drawer',0.)]};self.ramp_rate=1. self.vibration=dict(enabled=False,amplitude_m=.0005,frequency_hz=82.);self.sensor=0.;self.sample_k=300.;self.magnet_k=300.;self.linear_coefficient=0.;self.relays=[];self.amplitudes=[] self.calibration_valid=False;self.calibration_gain=1.;self.calibration_offset=0.;self.phase='idle';self.stage='idle';self.elapsed=0.;self.rows=[];self.operation_id=None;self.operation_kind='none';self.error=None;self._counter=0;self._operation_source=None;self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={};self._event_ns=None;self._sequence=[];self._index=0;self._v_integral=0.;self._b_integral=0. self.book={k:0. for k in ['loaded_mass_kg','removed_mass_kg','loaded_volume_m3','removed_volume_m3','source_energy_j','coil_joule_j','magnetic_work_j','hysteresis_heat_j','sample_sensible_loaded_j','sample_sensible_removed_j','magnetic_loaded_j','magnetic_removed_j','sample_heat_export_j','magnet_heat_export_j']} @property def time_s(self):return self.time_ns/1e9 def register_principal(self,name,visibility): if not isinstance(name,str) or not name or visibility not in ('agent','evaluator','debug') or name in self._principals:raise ActionRejected('INVALID_ARGUMENT') self._principals[name]=visibility def session(self,name): if name not in self._principals:raise ActionRejected('ACCESS_DENIED') return LakeShore8604VsmSession(self,name) def _pos(self,k):return self.axes[k]['position'] def _moving(self,k):return self.time_ns<self.axes[k]['arrival_ns'] def _speed(self,k):return self.ramp_rate if k=='field' else self.plant[{'lift':'lift_speed_m_s','angle':'rotation_speed_rad_s','drawer':'drawer_speed_m_s'}[k]] def _target(self,k,value): a=self.axes[k];distance=abs(value-a['position']);a.update(start=a['position'],target=float(value),start_ns=self.time_ns,arrival_ns=self.time_ns+int(math.ceil(distance/self._speed(k)*1e9))) def _rate(self,k): a=self.axes[k] return (a['target']-a['start'])/((a['arrival_ns']-a['start_ns'])/1e9) if self._moving(k) else 0. def _positions(self): for a in self.axes.values():a['position']=a['target'] if self.time_ns>=a['arrival_ns'] else a['start']+(a['target']-a['start'])*(self.time_ns-a['start_ns'])/(a['arrival_ns']-a['start_ns']) def _capacity(self):return self.plant['sample_local_capacity_j_k']+(self.sample['mass_kg']*self.sample['specific_heat_capacity_j_kg_k'] if self.sample else 0.) def _sensitivity(self,actual=False): if not self.coil:return 0. coupling=self.plant['pickup_coupling_wb_per_a_m3'] if actual else self.coil['nominal_coupling_wb_per_a_m3'] return coupling*self.vibration['amplitude_m']*2*math.pi*self.vibration['frequency_hz']/math.sqrt(2) def _moment(self,B=None): B=self._pos('field') if B is None else B;c=math.cos(self._pos('angle')) return self.linear_coefficient*B+sum(a*r['state'] for a,r in zip(self.amplitudes,self.relays))*c def _magnetic_energy(self):return .5*self.linear_coefficient*self._pos('field')**2+sum(a*r['bias_field_t']*r['state'] for a,r in zip(self.amplitudes,self.relays)) def _temperature_valid(self): if not self.sample or self.sample.get('standard'):return True nominal=self.record.get('reference_temperature_K');interval=self.record.get('valid_temperature_range_K') if nominal is not None and abs(self.sample_k-nominal)>self.sample['temperature_tolerance_k']+1e-9:return False if interval and interval[1]-interval[0]>1e-9 and not interval[0]-1e-9<=self.sample_k<=interval[1]+1e-9:return False return abs(self.sample_k-self.sample['initial_temperature_k'])<=self.sample['temperature_tolerance_k']+1e-9 def ledger(self): d=copy.deepcopy(self.book);mass=self.sample['mass_kg'] if self.sample else 0.;volume=self.sample['volume_m3'] if self.sample else 0.;d.update(mass_kg=mass,mass_residual_kg=d['loaded_mass_kg']-d['removed_mass_kg']-mass,volume_m3=volume,volume_residual_m3=d['loaded_volume_m3']-d['removed_volume_m3']-volume,coil_stored_j=0.,magnetic_stored_j=self._magnetic_energy(),sample_thermal_j=0.,magnet_thermal_j=0.) if self.plant:d.update(coil_stored_j=.5*self.plant['coil_inductance_h']*(self._pos('field')/self.plant['field_per_current_t_a'])**2,sample_thermal_j=self._capacity()*(self.sample_k-self.plant['ambient_k']),magnet_thermal_j=self.plant['magnet_thermal_capacity_j_k']*(self.magnet_k-self.plant['ambient_k'])) d['energy_residual_j']=d['source_energy_j']+d['sample_sensible_loaded_j']+d['magnetic_loaded_j']-d['sample_sensible_removed_j']-d['magnetic_removed_j']-sum(d[k] for k in ['coil_stored_j','magnetic_stored_j','sample_thermal_j','magnet_thermal_j','sample_heat_export_j','magnet_heat_export_j']);return d def read(self,visibility='agent'): indicated=None if self.power and self.vibration['enabled'] and self.coil: inferred=infer_moment(self.sensor,self._sensitivity(),self.calibration_gain,self.calibration_offset) if abs(inferred)<=self.coil['moment_range_a_m2'] and self._temperature_valid():indicated=inferred field=quant(self._pos('field'),FIELD_RESOLUTION_T) if self.power else None d={'clock.time_s':self.time_s,'plant.configured':self.plant is not None,'coil.configured':self.coil is not None,'method.configured':self.method is not None,'sample.present':self.sample is not None,'power.enabled':self.power,'vibration.enabled':self.vibration['enabled'],'calibration.valid':self.calibration_valid,'sample.lift_m':self._pos('lift'),'sample.target_lift_m':self.axes['lift']['target'],'storage.position_m':self._pos('drawer'),'storage.target_m':self.axes['drawer']['target'],'sample.angle_rad':self._pos('angle'),'sample.target_angle_rad':self.axes['angle']['target'],'sample.orientation_rad':math.atan2(math.sin(self._pos('angle')),math.cos(self._pos('angle'))),'sample.vibration_z_m':self.vibration['amplitude_m']*math.sin(2*math.pi*self.vibration['frequency_hz']*self.time_s) if self.power and self.vibration['enabled'] else 0.,'power.angle_rad':.28 if self.power else 0.,'field.target_t':self.axes['field']['target'],'field.indicated_t':field,'field.external_h_a_m':None if field is None else field/MU0,'moment.indicated_a_m2':indicated,'detector.in_phase_v':self.sensor if self.power and self.vibration['enabled'] else None,'thermal.sample_k':self.sample_k if self.plant else None,'thermal.magnet_k':self.magnet_k if self.plant else None,'acquisition.phase':self.phase,'acquisition.stage':self.stage,'acquisition.elapsed_s':self.elapsed,'acquisition.points':len(self.rows),'calibration.gain':self.calibration_gain,'calibration.offset_v':self.calibration_offset,'truth.field_t':self._pos('field'),'truth.moment_a_m2':self._moment(),'truth.mass_kg':self.sample['mass_kg'] if self.sample else 0.,'truth.sample_k':self.sample_k} return {k:copy.deepcopy(v) for k,v in d.items() if visibility!='agent' or SLOTS[k]['visibility']=='agent'} def _propagate(self,ns): dt=ns/1e9 if dt<=0 or not self.plant:return p=self.plant;B0=self._pos('field');rate=self._rate('field');B1=B0+rate*dt;I0=B0/p['field_per_current_t_a'];I1=B1/p['field_per_current_t_a'];r=p['coil_resistance_ohm']/p['field_per_current_t_a']**2 joule=r*(B0*B0*dt+B0*rate*dt*dt+rate*rate*dt**3/3);dcoil=.5*p['coil_inductance_h']*(I1*I1-I0*I0);dmag=.5*self.linear_coefficient*(B1*B1-B0*B0) self.book['coil_joule_j']+=joule;self.book['magnetic_work_j']+=dmag;self.book['source_energy_j']+=joule+dcoil+dmag C=p['magnet_thermal_capacity_j_k'];G=p['magnet_cooling_conductance_w_k'];tau=C/G;before=C*(self.magnet_k-p['ambient_k']);j0,j1,j2=weighted_exponential_integrals(dt,tau);after=before*math.exp(-dt/tau)+r*(B0*B0*j0+2*B0*rate*j1+rate*rate*j2);self.magnet_k=p['ambient_k']+after/C;self.book['magnet_heat_export_j']+=joule-(after-before) C=self._capacity();before=C*(self.sample_k-p['ambient_k']);after=before*math.exp(-p['sample_conductance_w_k']*dt/C);self.sample_k=p['ambient_k']+after/C;self.book['sample_heat_export_j']+=before-after active=self.power and self.vibration['enabled'];gain=p['voltage_gain']*self._sensitivity(True) if active else 0.;f0=gain*self._moment(B0)+(p['voltage_offset_v'] if active else 0.);f1=gain*self.linear_coefficient*rate;old=self.sensor;tau=p['detector_tau_s'];self.sensor=f0+f1*(dt-tau)+(old-f0+f1*tau)*math.exp(-dt/tau) if self.phase=='running' and self.stage=='averaging':self._v_integral+=f0*dt+.5*f1*dt*dt-tau*(self.sensor-old);self._b_integral+=B0*dt+.5*rate*dt*dt def _next_switch(self): B=self._pos('field');c=math.cos(self._pos('angle'));v=self._rate('field')*c if not v:return None times=[] for r in self.relays: if v>0 and r['state']<0:threshold=r['bias_field_t']+r['coercive_field_t'] elif v<0 and r['state']>0:threshold=r['bias_field_t']-r['coercive_field_t'] else:continue dt=(threshold-B*c)/v if dt>=-1e-12:times.append(self.time_ns+max(1,int(math.ceil(dt*1e9-1e-7)))) return min(times) if times else None def _switch(self): B=self._pos('field');c=math.cos(self._pos('angle'));effective=B*c for amplitude,r in zip(self.amplitudes,self.relays): state=1 if effective>=r['bias_field_t']+r['coercive_field_t']-1e-12 else -1 if effective<=r['bias_field_t']-r['coercive_field_t']+1e-12 else r['state'] if state==r['state']:continue dm=amplitude*(state-r['state']);work=effective*dm;stored=r['bias_field_t']*dm;heat=work-stored if heat<-1e-12:raise RuntimeError('Nonpassive relay switch') r['state']=state;self.book['magnetic_work_j']+=work;self.book['source_energy_j']+=work;self.book['hysteresis_heat_j']+=heat;self.sample_k+=heat/self._capacity() def _result(self): if self.phase!='running' and self.operation_id in self.records:return copy.deepcopy(self.records[self.operation_id]) return dict(operation_id=self.operation_id,phase=self.phase,kind=self.operation_kind,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),error=self.error,template_source=self._operation_source,evidence='synthetic_forward_model; actual_host_time_interval_observations; measured_reference_anchor_is_not_measured_this_loop_or_FORC') def _finish(self,phase,error=None): self.phase=phase;self.stage='idle';self.error=error;self._event_ns=None if self.operation_id:self.records[self.operation_id]=dict(operation_id=self.operation_id,phase=phase,kind=self.operation_kind,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),error=error,template_source=self._operation_source,evidence='synthetic_forward_model; actual_host_time_interval_observations; measured_reference_anchor_is_not_measured_this_loop_or_FORC') def _begin_point(self): point=self._sequence[self._index];self.ramp_rate=self._job_method['ramp_rate_t_s'];self._target('field',point['field_t']);self.stage='ramping';self._event_ns=self.axes['field']['arrival_ns'] def _advance(self): while self.phase=='running' and self._event_ns<=self.time_ns: if self.stage=='ramping':self.stage='settling';self._event_ns=self.time_ns+round(self._job_method['settling_time_s']*1e9) elif self.stage=='settling': if not self._sequence[self._index]['record']: self._index+=1;self._begin_point();continue self.stage='averaging';self._window_start_ns=self.time_ns;self._v_integral=0.;self._b_integral=0.;self._event_ns=self.time_ns+round(self._job_method['averaging_time_s']*1e9) else: dt=(self.time_ns-self._window_start_ns)/1e9;v=self._v_integral/dt;B=quant(self._b_integral/dt,FIELD_RESOLUTION_T);moment=infer_moment(v,self._sensitivity(),self.calibration_gain,self.calibration_offset);quality='estimated';error=None if abs(moment)>self.coil['moment_range_a_m2']:quality='overflow';error='MOMENT_OVERFLOW';moment=None elif not self._temperature_valid():quality='reference_temperature_invalid';error='REFERENCE_TEMPERATURE_RANGE';moment=None elif abs(moment)<MIN_MOMENT_A_M2:quality='below_documented_dynamic_range' self.rows.append(dict(point_index=len(self.rows),field_t=B,external_h_a_m=B/MU0,in_phase_voltage_v=v,moment_a_m2=moment,angle_rad=self._pos('angle'),window_start_s=self._window_start_ns/1e9,window_end_s=self.time_s,reversal_field_t=self._sequence[self._index]['reversal_field_t'],quality=quality)) if error:self._finish('failed',error);break self._index+=1 if self._index==len(self._sequence): if self.operation_kind=='calibration': vplus,vminus=[r['in_phase_voltage_v'] for r in self.rows];den=vplus-vminus if den<=0:self._finish('failed','CALIBRATION_INVALID');break self.calibration_gain=2*self._cal_reference*self._sensitivity()/den;self.calibration_offset=(vplus+vminus)/2;self.calibration_valid=True self._finish('succeeded');break self._begin_point() def _load_guard(self): if not self.plant:raise ActionRejected('NOT_CONFIGURED') if self.sample:raise ActionRejected('SAMPLE_PRESENT') if self._pos('lift')<.34 or self._moving('lift') or self._moving('angle') or self.vibration['enabled'] or abs(self._pos('field'))>1e-10 or self._moving('field'):raise ActionRejected('LOADING_POSITION_REQUIRED') def _field_guard(self,values): if self.sample and not self.sample.get('standard') and any(abs(x)>self.sample['linear_valid_max_field_t']+1e-12 for x in values):raise ActionRejected('HOST_MAGNETIC_VALIDITY_RANGE') def invoke(self,capability,**a): if capability not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability]['input_schema'],a) if capability in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if capability=='acquisition.result':return self._result() if capability=='ledger.read':return self.ledger() if capability=='provenance.read':return dict(current_sample=self.source,operation_source=self._operation_source) if capability=='analysis.loop':return analyze_loop(a['rows']) if capability=='analysis.forc':return analyze_forc(a['rows']) if capability=='analysis.moment':return dict(moment_a_m2=infer_moment(**a)) if capability=='sim.step':self.step(a['dt_s']);return dict(time_s=self.time_s) if self.phase=='running' and capability not in ('acquisition.stop','power.set'):raise ActionRejected('BUSY') if capability=='plant.configure': if self.plant or self.sample or self.power:raise ActionRejected('ALREADY_CONFIGURED') if not a['accept_engineering']:raise ActionRejected('EXPLICIT_ASSUMPTIONS_REQUIRED') I=MAX_FIELD_T/a['field_per_current_t_a'];V=a['coil_resistance_ohm']*I+a['coil_inductance_h']/a['field_per_current_t_a'] if I>70+1e-12 or V>35+1e-12 or I*V>2450+1e-12:raise ActionRejected('POWER_SUPPLY_ENVELOPE') self.plant=copy.deepcopy(a);self.sample_k=self.magnet_k=a['ambient_k'];out=dict(configured=True) elif capability=='coil.configure':self.coil=copy.deepcopy(a);self.calibration_valid=False;self.calibration_gain=1.;self.calibration_offset=0.;out=dict(configured=True) elif capability in ('method.configure','forc.configure'): if capability=='forc.configure': quantized=[quant(x,FIELD_RESOLUTION_T) for x in a['reversal_fields_t']];saturation=quant(a['saturation_field_t'],FIELD_RESOLUTION_T) if any(x>=saturation for x in quantized) or len(set(quantized))!=len(quantized) or len(quantized)*(a['points_per_curve']+1)>50000:raise ActionRejected('FORC_GRID_REQUIRED') a=copy.deepcopy(a);a['reversal_fields_t']=quantized;a['saturation_field_t']=saturation self.method=copy.deepcopy(a);self.method['kind']='forc' if capability=='forc.configure' else 'points';out=dict(configured=True) elif capability in ('sample.load','standard.load'): self._load_guard();standard=capability=='standard.load';record=None;relays=[];amplitudes=[];linear=0. if standard: if not a['accept_host_standard_proxy']:raise ActionRejected('EXPLICIT_ASSUMPTIONS_REQUIRED') linear=a['reference_moment_a_m2']/a['reference_field_t'];source=json.dumps(dict(kind='host_linear_calibrant_proxy',numerical_example_anchor='NIST772a298K398kA_m_not_certificate_validation'),sort_keys=True) else: if not a['accept_engineering_assumptions']:raise ActionRejected('EXPLICIT_ASSUMPTIONS_REQUIRED') record=library().get(a['reference_id']) if record is None:raise ActionRejected('UNKNOWN_REFERENCE') temp=record.get('reference_temperature_K');domain=record.get('valid_temperature_range_K') if temp is not None and abs(a['initial_temperature_k']-temp)>a['temperature_tolerance_k'] or domain and domain[1]-domain[0]>1e-9 and not domain[0]<=a['initial_temperature_k']<=domain[1]:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') chi=record.get('molar_susceptibility_m3_mol');molar_mass=record.get('molar_mass_kg_mol') if chi is not None and molar_mass is not None:linear=a['mass_kg']/molar_mass*chi/MU0 if a['magnetic_model']=='linear_susceptibility' and (chi is None or molar_mass is None):raise ActionRejected('REFERENCE_PROPERTY_MISSING') if a['magnetic_model']=='preisach_proxy': value=a['proxy_specific_moment_a_m2_kg'] if value is None:value=record.get('measured_specific_moment_max_abs_a_m2_kg') if value is None:raise ActionRejected('EXPLICIT_PROXY_AMPLITUDE_REQUIRED') if not math.isclose(sum(r['weight'] for r in a['relays']),1.,rel_tol=0,abs_tol=1e-10):raise ActionRejected('RELAY_WEIGHTS') for r in a['relays']: if r['bias_field_t']+r['coercive_field_t']<=0 and r['initial_sign']<0 or r['bias_field_t']-r['coercive_field_t']>=0 and r['initial_sign']>0:raise ActionRejected('INCONSISTENT_INITIAL_MAGNETIC_STATE') relays=[dict(r,state=r['initial_sign']) for r in a['relays']];amplitudes=[a['mass_kg']*value*r['weight'] for r in relays] source=json.dumps(record.get('source'),sort_keys=True,ensure_ascii=False) p=copy.deepcopy(a);p['standard']=standard;C0=self._capacity();old=C0*(self.sample_k-self.plant['ambient_k']);incoming=a['mass_kg']*a['specific_heat_capacity_j_kg_k']*(a['initial_temperature_k']-self.plant['ambient_k']);self.sample=p;self.record=record;self.source=source;self.linear_coefficient=linear;self.relays=relays;self.amplitudes=amplitudes;self.sample_k=self.plant['ambient_k']+(old+incoming)/self._capacity();self.book['sample_sensible_loaded_j']+=incoming;self.book['magnetic_loaded_j']+=self._magnetic_energy();self.book['loaded_mass_kg']+=a['mass_kg'];self.book['loaded_volume_m3']+=a['volume_m3'];out=dict(present=True) elif capability=='sample.remove': if not self.sample:raise ActionRejected('NO_SAMPLE') if self._pos('lift')<.34 or self._moving('lift') or self.vibration['enabled'] or abs(self._pos('field'))>1e-10 or self._moving('field'):raise ActionRejected('LOADING_POSITION_REQUIRED') m=self.sample['mass_kg'];v=self.sample['volume_m3'];self.book['removed_mass_kg']+=m;self.book['removed_volume_m3']+=v;self.book['sample_sensible_removed_j']+=m*self.sample['specific_heat_capacity_j_kg_k']*(self.sample_k-self.plant['ambient_k']);self.book['magnetic_removed_j']+=self._magnetic_energy();self.sample=None;self.record=None;self.source=None;self.linear_coefficient=0.;self.relays=[];self.amplitudes=[];out=dict(removed_mass_kg=m,removed_volume_m3=v) elif capability=='power.set': if not self.plant:raise ActionRejected('NOT_CONFIGURED') if not a['enabled'] and (abs(self._pos('field'))>1e-10 or self._moving('field')):raise ActionRejected('ZERO_FIELD_REQUIRED') if not a['enabled']: if self.phase=='running':self._finish('cancelled','POWER_OFF') self.vibration['enabled']=False for k in self.axes:self._target(k,self._pos(k)) self.power=a['enabled'];out=dict(enabled=self.power) elif capability=='field.set_target': if not self.power:raise ActionRejected('POWER_OFF') if self._pos('lift')>1e-9 and self.sample or self._moving('lift') or self._moving('angle'):raise ActionRejected('MEASUREMENT_POSITION_REQUIRED') target=quant(a['field_t'],FIELD_RESOLUTION_T);self._field_guard([target]);self.ramp_rate=a['ramp_rate_t_s'];self._target('field',target);out=dict(target_t=target) elif capability in ('sample.set_lift','sample.set_angle','storage.set_open'): if not self.plant or not self.power:raise ActionRejected('POWER_OFF') if capability!='storage.set_open' and (abs(self._pos('field'))>1e-10 or self._moving('field') or self.vibration['enabled']):raise ActionRejected('ZERO_FIELD_AND_VIBRATION_OFF_REQUIRED') k='lift' if capability=='sample.set_lift' else 'angle' if capability=='sample.set_angle' else 'drawer';value=a['lift_m'] if k=='lift' else quant(a['angle_rad'],math.pi/1800) if k=='angle' else .2 if a['opened'] else 0.;self._target(k,value);out={'target_rad' if k=='angle' else 'target_m':value} elif capability=='vibration.configure': if not self.power or not self.coil:raise ActionRejected('NOT_CONFIGURED') if a['enabled'] and (self._pos('lift')>1e-9 or self._moving('lift') or self._moving('angle')):raise ActionRejected('MEASUREMENT_POSITION_REQUIRED') if any(a[k]!=self.vibration[k] for k in ('amplitude_m','frequency_hz')):self.calibration_valid=False self.vibration=copy.deepcopy(a);out=dict(enabled=a['enabled']) elif capability=='calibration.clear':self.calibration_valid=False;self.calibration_gain=1.;self.calibration_offset=0.;out=dict(valid=False) elif capability in ('acquisition.start','calibration.start'): iscal=capability=='calibration.start' if not self.power or not self.plant or not self.coil or not self.vibration['enabled']:raise ActionRejected('NOT_CONFIGURED') if not self.sample:raise ActionRejected('NO_SAMPLE') if self._pos('lift')>1e-9 or self._moving('lift') or self._moving('angle'):raise ActionRejected('MEASUREMENT_POSITION_REQUIRED') if not self._temperature_valid():raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if iscal: method=dict(ramp_rate_t_s=1.,averaging_time_s=a['averaging_time_s'],settling_time_s=max(.05,10*self.plant['detector_tau_s']));sequence=[dict(field_t=quant(B,FIELD_RESOLUTION_T),record=True,reversal_field_t=None) for B in [a['field_t'],-a['field_t']]] else: if not self.method:raise ActionRejected('NOT_CONFIGURED') if self.method['require_calibration'] and not self.calibration_valid:raise ActionRejected('CALIBRATION_REQUIRED') method=copy.deepcopy(self.method);sequence=[] if method['kind']=='points':sequence=[dict(field_t=quant(B,FIELD_RESOLUTION_T),record=True,reversal_field_t=None) for B in method['field_points_t']] else: saturation=method['saturation_field_t'] for Br in method['reversal_fields_t']: sequence.append(dict(field_t=quant(saturation,FIELD_RESOLUTION_T),record=False,reversal_field_t=Br)) sequence.extend(dict(field_t=quant(float(B),FIELD_RESOLUTION_T),record=True,reversal_field_t=Br) for B in np.linspace(Br,saturation,method['points_per_curve'])) self._field_guard([p['field_t'] for p in sequence]) if not iscal and method['kind']=='forc' and self.relays and method['saturation_field_t']*abs(math.cos(self._pos('angle')))<max(r['coercive_field_t']+abs(r['bias_field_t']) for r in self.relays):raise ActionRejected('MODEL_SATURATION_UNREACHABLE') self._counter+=1;self.operation_id=f'{self.instance_id}:acquisition:{self._counter}';self._operation_source=self.source;self.operation_kind='calibration' if iscal else method['kind'];self.phase='running';self.elapsed=0.;self.rows=[];self.error=None;self._start_ns=self.time_ns;self._job_method=method;self._sequence=sequence;self._index=0;self._cal_reference=a['reference_moment_a_m2'] if iscal else None;self._begin_point();out=dict(operation_id=self.operation_id) elif capability=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._target('field',self._pos('field'));self._finish('cancelled','USER_CANCEL');out=dict(phase=self.phase,elapsed_s=self.elapsed) else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(out) def step(self,dt_s): validate(number('s',0,86400),dt_s);total=math.fsum((self._clock_remainder_ns,dt_s*1e9));ns=round(total);self._clock_remainder_ns=total-ns if not ns:return end=self.time_ns+ns while self.time_ns<end: if self.phase=='running' and self._event_ns<=self.time_ns:self._advance() boundary=end for k in self.axes: if self._moving(k):boundary=min(boundary,self.axes[k]['arrival_ns']) switch=self._next_switch() if switch is not None:boundary=min(boundary,switch) if self.phase=='running':boundary=min(boundary,self._event_ns) self._propagate(boundary-self.time_ns);self.time_ns=boundary;self._positions();self._switch() if self.phase=='running': self.elapsed=(self.time_ns-self._start_ns)/1e9 if self._event_ns<=self.time_ns:self._advance() self.revision+=1
class LakeShore8604VsmSession: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_lakeshore_8604vsm_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'synthetic_forward_model; observed_interval_mean_lockin_voltage; measured_library_reference_anchor_not_original_this_loop_or_FORC; selected record restricted' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id in ('acquisition.start','calibration.start') else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
for i,B in enumerate([-.1,0.,.1]): row=dict(point_index=i,field_t=B,external_h_a_m=B/MU0,in_phase_voltage_v=B*.001,moment_a_m2=B*.001,angle_rad=0.,window_start_s=float(i),window_end_s=i+.1,reversal_field_t=None,quality='estimated') CAPS['analysis.loop']['example_arguments']['rows'].append(row)for Br in [-.1,-.05,0.]: for B in [0.,.05,.1]: row=copy.deepcopy(CAPS['analysis.loop']['example_arguments']['rows'][0]);row.update(field_t=B,external_h_a_m=B/MU0,moment_a_m2=.001*(B-Br*B),reversal_field_t=Br) CAPS['analysis.forc']['example_arguments']['rows'].append(row)EFFECTS={ 'plant.configure':['plant.configured','thermal.sample_k','thermal.magnet_k','truth.sample_k'], 'coil.configure':['coil.configured','calibration.valid','calibration.gain','calibration.offset_v'], 'method.configure':['method.configured'],'forc.configure':['method.configured'], 'sample.load':['sample.present','thermal.sample_k','truth.sample_k','truth.mass_kg','truth.moment_a_m2'], 'standard.load':['sample.present','thermal.sample_k','truth.sample_k','truth.mass_kg','truth.moment_a_m2'], 'sample.remove':['sample.present','truth.mass_kg','truth.moment_a_m2'], 'power.set':['power.enabled','power.angle_rad','field.indicated_t','field.external_h_a_m','moment.indicated_a_m2','detector.in_phase_v','vibration.enabled','sample.vibration_z_m','sample.target_lift_m','sample.target_angle_rad','storage.target_m','field.target_t','acquisition.phase','acquisition.stage'], 'field.set_target':['field.target_t'],'sample.set_lift':['sample.target_lift_m'],'sample.set_angle':['sample.target_angle_rad'],'storage.set_open':['storage.target_m'], 'vibration.configure':['vibration.enabled','sample.vibration_z_m','moment.indicated_a_m2','detector.in_phase_v','calibration.valid'], 'calibration.clear':['calibration.valid','calibration.gain','calibration.offset_v'], 'acquisition.start':['acquisition.phase','acquisition.stage','acquisition.elapsed_s','acquisition.points','field.target_t'], 'calibration.start':['acquisition.phase','acquisition.stage','acquisition.elapsed_s','acquisition.points','field.target_t'], 'acquisition.stop':['acquisition.phase','acquisition.stage','field.target_t'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'POWER_OFF','USER_CANCEL','MOMENT_OVERFLOW','REFERENCE_TEMPERATURE_RANGE'})LIMITATIONS=[ '固定Lake Shore8604/86-LC单轴线圈/标准极帽ExactGAP2,样品空间8mm,外施空气场±2.37T;高场帽2.76T、其它gap、矢量线圈与温控附件未选。样品0..10g,磁矩1emu=1e-3 A m²。', '公共field_t指外施空气磁感应B,H_external=B/μ0;样品内部B、H与退磁张量未求解,不把外场矫顽值冒充��禀矫顽力。', '厂家动态范围25nemu至1000emu只限定可配置满量程;零交叉和低于25nemu仍可返回估计并明确below_documented_dynamic_range,不宣称低场准确度。15nemu RMS@10s与100nT场分辨是不同规格;未将RMS当任意积分时长下的随机分布。', '真实数据包含原文室温285..300K的CRC molarχ、300K的SQUID铁氧体majorloops与Ni校准证书锚;证据/原始条件逐条保留,真实SQUID回线不冒充本8604原生输出。', 'linear_susceptibility: m=(mass/molar_mass)*χmol*B/μ0,低场线性/无退磁/温度容差为宿主接受的近似。Preisach使用真实高场比磁矩端点或显式host幅度,再加显式coercivity/bias/weights,属于synthetic_forward_model;端点不自动叫饱和Ms,±6T源major不可截成±2.37T实测饱和loop。', '独立矩形Preisach hysterons保留反转记忆;FORC小回线由显式假设驱动,不能从实测majorloop唯一推导。旋转投影m_x=m_axis*cosθ,加各向同性线性项;不是全Stoner-Wohlfarth、矢量磁畴或退磁场模型。', '磁化开关是有限能量的理想瞬时事件;W=B_eff*Δm、ΔU=bias*Δm、Q=(B_eff-bias)*Δm≥0,线性可逆能量U=.5*a*B²(抗磁参考可为负相对量)。未求开关脉冲峰值功率。', '磁体工程常数B=kI、V=RI+L*dI/dt;plant只允许在完整±2.37T及1T/s线性工作包络内满足70A/35V/2450W。绕组Joule、L储能、磁化功与冷却输出独立留账;4250W整机冷却要求不等于本模型线圈耗散。', '样品与局部夹持热容、磁体局部绕组热容均为宿主工程输入,非183/429/612kg整机热容;基础常温配置没有主动样品加热。载入取出质量体积、当前显热与磁态能量随库存转移。', '为保持已实现能量边界,断电只允许零外场,非零场请求原子拒绝;停止采集只停止当前扫场并保留实际场,磁体电流及Joule耗散继续,需另设零场后才能断电。', '锁相V=m*pickup_coupling*A*2πf/√2,含显式工程增益/零偏和一阶包络响应;average_time≥.01s真实区间积分,无随机噪声。解析振动姿态是宿主时刻采样,可混叠,不表示场景碰撞全频求解。', '位移/角度/抽屉有限速率,样品仅在零场和振动关闭时移动;0.1°为真实设置分辨率,实际转角保留多圈,orientation仅提供周期等价场景姿态。', '校准用外部给定的±已知标准磁矩及真实±场积分电压拟合零偏/增益,不读隐藏plant;defaultNi数值锚仅在原证书条件成立,host线性calibrant proxy不声称真实Ni全场响应或NIST认证。', '分析仅读外部rows:分支线性零点给Hc/Mr,∫Bdm对于未闭合路径不是cycleloss;FORC用最多15邻点的局部二次混合导数,不假称FORCinel或真实微结构唯一识别。', '所有角色普通acquisition.result/poll同样去身份,完整来源独立evaluator provenance.read;共享磁盘/Python不是OS隔离。硬件、机器人、真实噪声/准确度与附件温控not_run。']
def export_lakeshore_8604vsm_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI, fixed standard poles ExactGAP2/86-LC, room temperature; magnetic field is externally applied B in air.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'LakeShore8604VsmSession.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Reads do not advance time; acquisition rows separately give actual integration windows, instantaneous detector state is not an interval mean.'),source_ids=['simulation_assumption']) for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k in ('acquisition.start','calibration.start');caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.lakeshore_8604vsm.LakeShore8604VsmSession.invoke',invocation=f'session.invoke(instance_id="vsm_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='入口原子核对量程、选型、温域、供磁包络、零场机械移动和真实采集前提。',state_ids=['power.enabled','sample.present','sample.lift_m','field.target_t','vibration.enabled','acquisition.phase'],enforced_by='runtime',check='LakeShore8604VsmRuntime.invoke')],state_effects=[dict(state_id=s,timing='on_step' if k=='sim.step' else 'immediate',description_zh='声明状态变化;实际物理与观测只在step推进') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='运行层仅输出可绑定状态,实际几何和读数联动由独立scene证据验证。',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='所有有限扫场、等待与真实积分窗口完成' if async_ else '原子命令;仅step推进实际物理',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','magnet_power_supply','vsm_head','lockin_detector'],partial_failure_zh='取消保留完成点、实际B和磁态、已积磁功/Joule热;停止记录不清空剩磁或热量。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('MOMENT_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','USER_CANCEL') else 'none') for e in ERRORS],verification=[],limitations=LIMITATIONS,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('acquisition.start','calibration.start','field.set_target','sample.set_lift','sample.set_angle','storage.set_open','vibration.configure'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='由宿主显式时间推进物理或实际积分读数') for s in SLOTS if s not in v['effects'] and SLOTS[s]['origin'] in ('sensor','derived','scene','process_truth')] mechanism=dict(component_ids=['magnet','power_supply','sample','sample_rotor','head_lift','vibration_carriage','controller','sense_coil_left','sense_coil_right'],state_ids=list(slots),meaning_zh='外磁场有限扫场、显式Preisach记忆、VSM锁相包络实际积分和电磁被动热守恒',implementation='lumped',equations=['H_external=B_applied/mu0; m_linear=(sample_mass/molar_mass)*chi_molar*H_external.','Preisach: state flips at B*cos(theta)=bias +/- coercivity; m_x=sum(moment_weight*state)*cos(theta)+a*B.','Switch: W=B_eff*dm, dU=bias*dm, Q=(B_eff-bias)*dm>=0; reversible linear U=0.5*a*B^2.','I=B/k; V=R*I+L*dI/dt; P_R=I^2*R, E_L=0.5*L*I^2. Electrical input=dE_L+Joule+magnetic work.','Cmag*dTmag/dt=I^2*R-Gmag*(Tmag-Tambient); Csample*dTsample/dt=-Gsample*(Tsample-Tambient)+hysteretic event heat.','V_inphase=engineering_gain*pickup_coupling*amplitude*2*pi*frequency*m/sqrt(2)+offset; detector tau*dV/dt=V_inphase-V.','Recorded Vbar=(integral V dt)/actual_window; observed moment=(Vbar-cal_offset)*cal_gain/nominal_sensitivity.','Calibration gain=2*external_reference_moment*nominal_sensitivity/(Vplus-Vminus); offset=(Vplus+Vminus)/2.','FORC rho=-0.5*d2(moment)/(dB*dBr), evaluated by local quadratic fit to external observations only.','Host step is sole clock, with fractional-nanosecond carry; switching/ramp/axis/integration events split propagation analytically.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=LIMITATIONS) spec=importlib.util.spec_from_file_location('_vsm_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'vsm_magnetometry':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'coil.configure':(COIL,COIL_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'standard.load':(STANDARD,STANDARD_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE),'forc.configure':(FORC,FORC_EXAMPLE),'vibration.configure':(VIBRATION,VIBRATION_EXAMPLE)}) for k,v in SLOTS.items():slots[k]['meaning_zh']=v['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'vsm_magnetometry':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495"""CHEM141 M91: traditional current/field reversal, external magnet and vdP.
Only observed voltages/currents/fields enter inverse Hall/vdP fits. A host-controlledexternal field boundary evolves in time; M91 does not create a magnetic field."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npfrom scipy.integrate import solve_ivpPROTOCOL_VERSION='1.0.0';SLUG='lakeshore_measurereadym91';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-141'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'hall_library.json'
class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
from scipy.linalg import expmfrom scipy.optimize import brentqELEMENTARY_CHARGE_C=1.602176634e-19WARMUP_S=1800.CURRENT_RANGES=[1e-6,1e-5,1e-4,1e-3,1e-2,1e-1]VOLTAGE_RANGES=[.001,.01,.1,1.,10.]VOLTAGE_EXCITATION_RANGES=[.01,.1,1.,10.]CURRENT_MEASUREMENT_RANGES=[1e-8,1e-5,.01,.1]CONTACTS=['vdp_a','vdp_b','hall']
def library():return {x['id']:x for x in json.loads(LIBRARY_PATH.read_text())['templates']}def transport(record,temperature,clamp=False): curves=record['curves'];values={};lo=-math.inf;hi=math.inf for key,field in [('hall_coefficient','value_m3_C'),('resistivity','value_ohm_m')]: rows=curves[key];tt=np.array([v['temperature_K'] for v in rows]);vv=np.array([v[field] for v in rows]);lo=max(lo,float(tt[0]));hi=min(hi,float(tt[-1]));values[key]=float(np.interp(temperature,tt,vv)) allowed=record.get('valid_temperature_range_K',[lo,hi]);lo=max(lo,allowed[0]);hi=min(hi,allowed[1]);valid=lo-1e-6<=temperature<=hi+1e-6 if not valid and not clamp:return None return dict(hall_coefficient_m3_c=values['hall_coefficient'],resistivity_ohm_m=values['resistivity'],valid=bool(valid),domain_k=[lo,hi])
def vdp_resistances(sheet_ohm,asymmetry):return sheet_ohm*np.logaddexp(0.,np.array([asymmetry,-asymmetry]))/math.pi
def external_field_at(initial,target,dt,slew,tau): error=target-initial;edge=slew*tau if abs(error)<=edge:return target-error*math.exp(-dt/tau) linear_time=(abs(error)-edge)/slew if dt<=linear_time:return initial+math.copysign(slew*dt,error) return target-math.copysign(edge,error)*math.exp(-(dt-linear_time)/tau)
def _linear_fit(X,y): coefficient,_,rank,_=np.linalg.lstsq(X,y,rcond=None) if rank<X.shape[1]:raise ActionRejected('ANALYSIS_UNIDENTIFIABLE') return coefficient,float(np.sqrt(np.mean((np.asarray(y)-X@coefficient)**2)))
def infer_hall_vdp(observations,thickness_m,hall_geometry_factor,hall_factor,field_symmetry_relative,accept_single_carrier_model): if not accept_single_carrier_model:raise ActionRejected('ASSUMPTION_NOT_ACCEPTED') t=np.array([x['host_time_s'] for x in observations]);I=np.array([x['current_a'] for x in observations]);B=np.array([x['field_t'] for x in observations]);V=np.array([x['voltage_v'] for x in observations]);configs=np.array([x['contact_configuration'] for x in observations]);iscale=max(np.max(abs(I)),1e-30);bscale=max(np.max(abs(B)),1e-30);times=(t-np.mean(t))/max(np.ptp(t),1e-12) if not np.any(B>1e-6) or not np.any(B < -1e-6):raise ActionRejected('FIELD_REVERSAL_REQUIRED') bp=float(np.mean(B[B>0]));bn=float(np.mean(B[B<0])) if abs(bp+bn)/max(abs(bp),abs(bn))>field_symmetry_relative:raise ActionRejected('FIELD_PAIR_ASYMMETRY') resistance=[];rms=[] for name in CONTACTS[:2]: idx=configs==name if sum(idx)<4:raise ActionRejected('ANALYSIS_DATA') X=np.column_stack([I[idx]/iscale,np.ones(sum(idx)),times[idx]]);fit,error=_linear_fit(X,V[idx]);R=float(fit[0]/iscale) if not .01<=R<=1e7:raise ActionRejected('RESISTANCE_RANGE') resistance.append(R);rms.append(error) idx=configs=='hall' if sum(idx)<6:raise ActionRejected('ANALYSIS_DATA') X=np.column_stack([I[idx]/iscale,I[idx]*B[idx]/(iscale*bscale),np.ones(sum(idx)),times[idx]]);fit,error=_linear_fit(X,V[idx]);rms.append(error);RH=float(fit[1]/(iscale*bscale)*thickness_m/hall_geometry_factor) if abs(RH)<1e-30:raise ActionRejected('HALL_UNRESOLVED') ra,rb=resistance;sheet=brentq(lambda rs:math.exp(-math.pi*ra/rs)+math.exp(-math.pi*rb/rs)-1,min(ra,rb)*1e-6,math.pi*(ra+rb)*100,xtol=1e-13,rtol=1e-13);rho=sheet*thickness_m;nH=1/(ELEMENTARY_CHARGE_C*abs(RH));muH=abs(RH)/rho return dict(hall_coefficient_m3_c=RH,resistivity_ohm_m=rho,sheet_resistance_ohm=sheet,vdp_resistance_a_ohm=ra,vdp_resistance_b_ohm=rb,hall_carrier_density_m3=nH,hall_mobility_m2_v_s=muH,assumed_single_carrier_density_m3=hall_factor*nH,assumed_drift_mobility_m2_v_s=muH/hall_factor,carrier_type='hole_like_positive_hall' if RH>0 else 'electron_like_negative_hall',fit_rms_v=max(rms),evidence='external_current_and_field_reversal_voltage_fit; scalar_van_der_Pauw_and_single_carrier_Hall_factor_assumptions; not_proprietary_FastHall_algorithm')
PLANT_EXAMPLE=dict(ambient_k=300.,contact_asymmetry=.2,hall_misalignment_fraction=.02,hall_geometry_factor=1.,drive_geometry_factor=1.,current_contact_resistance_ohm=20.,compliance_voltage_v=10.,voltage_offset_a_v=2e-6,voltage_offset_b_v=-1e-6,voltage_offset_hall_v=3e-6,voltage_drift_v_s=1e-10,voltage_gain=1.,voltage_resolution_fraction=1e-7,voltage_response_tau_s=.002,temperature_resolution_k=1e-4,clamp_speed_m_s=.006,ui_tilt_speed_rad_s=.5,accept_engineering=True)PLANT=obj({'ambient_k':number('K',283.15,313.15),'contact_asymmetry':number('1',-5,5),'hall_misalignment_fraction':number('1',-.5,.5),'hall_geometry_factor':number('1',.1,2),'drive_geometry_factor':number('1',.1,100),'current_contact_resistance_ohm':number('ohm',0,1e9),'compliance_voltage_v':number('V',1,10),'voltage_offset_a_v':number('V',-.1,.1),'voltage_offset_b_v':number('V',-.1,.1),'voltage_offset_hall_v':number('V',-.1,.1),'voltage_drift_v_s':number('V/s',-1e-3,1e-3),'voltage_gain':number('1',.1,10),'voltage_resolution_fraction':number('1',1e-12,.01),'voltage_response_tau_s':number('s',1e-5,10),'temperature_resolution_k':number('K',1e-6,1),'clamp_speed_m_s':number('m/s',.00001,.1),'ui_tilt_speed_rad_s':number('rad/s',.0001,1.),'accept_engineering':BOOL})GEOMETRY_EXAMPLE=dict(side_m=.01,thickness_m=.0005)GEOMETRY=obj({'side_m':number('m',.001,.1),'thickness_m':number('m',1e-7,.01)})THERMAL_EXAMPLE=dict(minimum_temperature_k=290.,maximum_temperature_k=350.,closed_conductance_w_k=.2,open_conductance_w_k=.02,controller_gain_w_k=.5,heating_limit_w=5.,cooling_limit_w=5.,accept_external_thermal_boundary=True)THERMAL=obj({'minimum_temperature_k':number('K',1,1500),'maximum_temperature_k':number('K',1,1500),'closed_conductance_w_k':number('W/K',1e-6,1000),'open_conductance_w_k':number('W/K',0,1000),'controller_gain_w_k':number('W/K',1e-6,1e5),'heating_limit_w':number('W',.001,1e5),'cooling_limit_w':number('W',.001,1e5),'accept_external_thermal_boundary':BOOL})FIELD_EXAMPLE=dict(maximum_abs_t=2.,slew_t_s=1.,response_tau_s=.1,probe_gain=1.,probe_offset_t=0.,probe_resolution_t=1e-7,accept_external_magnet=True)FIELD=obj({'maximum_abs_t':number('T',.001,100),'slew_t_s':number('T/s',1e-6,100),'response_tau_s':number('s',.001,1e5),'probe_gain':number('1',.1,10),'probe_offset_t':number('T',-1,1),'probe_resolution_t':number('T',1e-12,.1),'accept_external_magnet':BOOL})SAMPLE_EXAMPLE=dict(reference_id='starry_40927',density_kg_m3=6000.,specific_heat_capacity_j_kg_k=300.,initial_temperature_k=300.,accept_directional_scalar_and_thermal_assumptions=True)SAMPLE=obj({'reference_id':TEXT,'density_kg_m3':number('kg/m^3',1,30000),'specific_heat_capacity_j_kg_k':number('J/kg/K',1,10000),'initial_temperature_k':number('K',1,1500),'accept_directional_scalar_and_thermal_assumptions':BOOL})METHOD_EXAMPLE=dict(current_range_a=.001,current_a=.0005,voltage_range_v=.001,phase_duration_s=.1,repeats=1,field_settling_tolerance_t=1e-4)METHOD=obj({'current_range_a':dict(type='number',enum=CURRENT_RANGES,**{'x-unit':'A'}),'current_a':number('A',0,.1),'voltage_range_v':dict(type='number',enum=VOLTAGE_RANGES,**{'x-unit':'V'}),'phase_duration_s':number('s',.001,60),'repeats':dict(type='integer',minimum=1,maximum=100,**{'x-unit':'1'}),'field_settling_tolerance_t':number('T',1e-8,.1)})VOLTAGE_EXAMPLE=dict(voltage_range_v=.1,voltage_v=.01,current_measurement_range_a=.01,current_limit_a=.1,current_resolution_fraction=1e-7)VOLTAGE=obj({'voltage_range_v':dict(type='number',enum=VOLTAGE_EXCITATION_RANGES,**{'x-unit':'V'}),'voltage_v':number('V',0,10),'current_measurement_range_a':dict(type='number',enum=CURRENT_MEASUREMENT_RANGES,**{'x-unit':'A'}),'current_limit_a':number('A',1e-7,.1),'current_resolution_fraction':number('1',1e-12,.01)})CALIBRATION_EXAMPLE=dict(voltage_gain_correction=1.,voltage_offset_v=0.,field_gain_correction=1.,field_offset_t=0.)CALIBRATION=obj({'voltage_gain_correction':number('1',.1,10),'voltage_offset_v':number('V',-.1,.1),'field_gain_correction':number('1',.1,10),'field_offset_t':number('T',-1,1)})CONTACT_SCHEMA=enum(CONTACTS)ROW=obj({'time_s':number('s',0),'host_time_s':number('s',0),'contact_configuration':CONTACT_SCHEMA,'polarity':enum(['zero','positive','negative']),'current_a':nullable(number('A')),'voltage_v':nullable(number('V')),'field_t':nullable(number('T')),'temperature_k':nullable(number('K')),'quality':enum(['estimated','unavailable']),'error_code':nullable(TEXT)})ANALYSIS_ROW=obj({'host_time_s':number('s',0),'contact_configuration':CONTACT_SCHEMA,'current_a':number('A'),'voltage_v':number('V'),'field_t':number('T')})ANALYSIS_INPUT=obj({'observations':array(ANALYSIS_ROW,18,2000),'thickness_m':number('m',1e-7,.01),'hall_geometry_factor':number('1',.1,2),'hall_factor':number('1',.1,10),'field_symmetry_relative':number('1',1e-6,.1),'accept_single_carrier_model':BOOL})INFERENCE=obj({'hall_coefficient_m3_c':number('m^3/C'),'resistivity_ohm_m':number('ohm*m',0),'sheet_resistance_ohm':number('ohm',0),'vdp_resistance_a_ohm':number('ohm',0),'vdp_resistance_b_ohm':number('ohm',0),'hall_carrier_density_m3':number('1/m^3',0),'hall_mobility_m2_v_s':number('m^2/V/s',0),'assumed_single_carrier_density_m3':number('1/m^3',0),'assumed_drift_mobility_m2_v_s':number('m^2/V/s',0),'carrier_type':enum(['hole_like_positive_hall','electron_like_negative_hall']),'fit_rms_v':number('V',0),'evidence':TEXT})_ex=[]for block,B in enumerate([.5,-.5]): for j,name in enumerate(CONTACTS): for k,I in enumerate([0.,.0005,-.0005]): tm=block*5+j*.3+k*.1;R=[.2,.3,.001*B/.0005+.03][j];_ex.append(dict(host_time_s=tm,contact_configuration=name,current_a=I,voltage_v=I*R+2e-6+1e-8*tm,field_t=B))ANALYSIS_EXAMPLE=dict(observations=_ex,thickness_m=.0005,hall_geometry_factor=1.,hall_factor=1.,field_symmetry_relative=.01,accept_single_carrier_model=True)RESULT=obj({'operation_id':nullable(TEXT),'phase':PHASE,'elapsed_s':number('s',0),'rows':array(ROW,0,900),'template_source':nullable(TEXT),'evidence':TEXT,'error_code':nullable(TEXT)})CAPS={};SLOTS={}def cap(k,i,o,c,z,kind='device_command',visibility='agent',example=None):CAPS[k]=dict(input_schema=i,output_schema=o,component_ids=c,function_zh=z,kind=kind,visibility=visibility,example_arguments=copy.deepcopy(example or {}),effects=[])def slot(k,s,u,z,origin='derived',visibility='agent',component='controller'):SLOTS[k]=dict(schema=s,unit=u,meaning=z,origin=origin,visibility=visibility,component=component,write=None)cap('plant.configure',PLANT,obj({'configured':BOOL}),['controller','contact_carriage'],'宿主显式接触/顺从电压/传感/几何误差参数,非OEM精度常数','configuration','evaluator',PLANT_EXAMPLE)cap('geometry.configure',GEOMETRY,obj({'configured':BOOL}),['sample_sheet'],'方形vdP薄片几何,四角接点;装样后锁定质量体积','configuration','evaluator',GEOMETRY_EXAMPLE)cap('thermal.configure',THERMAL,obj({'configured':BOOL}),['thermal_port'],'宿主外部工程热边界,非M91加热器或OEM温控系统','configuration','evaluator',THERMAL_EXAMPLE)cap('field.configure',FIELD,obj({'configured':BOOL}),['field_reference'],'宿主外部磁体边界及场探头,磁体参数不冒充M91能力','configuration','evaluator',FIELD_EXAMPLE)cap('field.set_target',obj({'field_t':number('T',-100,100)}),obj({'target_t':number('T')}),['field_reference'],'仅宿主设置外场目标;实际B受slew/τ随step演化,M91本体不造磁','simulation','evaluator',{'field_t':.5})cap('sample.load',SAMPLE,obj({'loaded':BOOL}),['sample_sheet'],'装入带真实RH/rho实验曲线的样品,热参数与标量方向明确接受','configuration','evaluator',SAMPLE_EXAMPLE)cap('sample.remove',obj({}),obj({'loaded':BOOL}),['sample_sheet'],'卸下整片及当前显热,保留已焦耳耗散账','configuration','evaluator')cap('sample.set_clamp',obj({'closed':BOOL}),obj({'target_m':number('m',0,.012)}),['contact_carriage'],'宿主手动四针整体抬起/接触,有限移动代理','simulation','evaluator',{'closed':True})cap('ui.set_tilt',obj({'angle_rad':number('rad',0,.26)}),obj({'target_rad':number('rad',0,.26)}),['controller'],'TiltView人工调角有限速度代理,范围为工程假设','simulation','evaluator',{'angle_rad':.13})cap('power.set',obj({'enabled':BOOL}),obj({'enabled':BOOL}),['power_button'],'控制器电源;每次重新上电需宿主累计1800s预热,短按动画仅状态代理',example={'enabled':True})cap('thermal.set_temperature',obj({'temperature_k':number('K',1,1500)}),obj({'target_k':number('K')}),['thermal_port'],'宿主外部热控制目标,温度只随step变化','simulation','evaluator',{'temperature_k':300.})cap('thermal.disable',obj({}),obj({'enabled':BOOL}),['thermal_port'],'停止外部主动调温,已有显热和焦耳过程不回滚','simulation','evaluator')cap('method.configure',METHOD,obj({'configured':BOOL,'programmed_current_a':number('A',0,.1)}),['controller'],'电流六档及每档1e-5分辨率,电压量程是满量程非最小信号阈值','configuration',example=METHOD_EXAMPLE)cap('options.configure',obj({'high_resistance_firmware_enabled':BOOL}),obj({'high_resistance_firmware_enabled':BOOL}),['controller'],'宿主明确选择M9-ADD-HR固件以开放电压激励,默认未选;不宣称200GΩ全域计量','configuration','evaluator',{'high_resistance_firmware_enabled':True})cap('excitation.voltage.configure',VOLTAGE,obj({'configured':BOOL,'programmed_voltage_v':number('V',0,10),'current_limit_a':number('A',1e-7,.1)}),['controller'],'HR固件下配置并选择电压激励:电压编程1e-5满档;真实负载电流、独立电流量程和显式分辨率模型','configuration',example=VOLTAGE_EXAMPLE)cap('sensor.calibrate',CALIBRATION,obj({'configured':BOOL}),['controller','field_reference'],'使用外部标准给出的电压和场探头校正,不读取真值','configuration',example=CALIBRATION_EXAMPLE)cap('acquisition.start',obj({}),obj({'operation_id':TEXT,'expected_duration_s':number('s',0)}),['controller','contact_carriage'],'在一个已稳定外场下依次采vdP-A/vdP-B/Hall的零/正/负激励观测;current模式±I、voltage模式±V')cap('acquisition.stop',obj({}),obj({'phase':PHASE,'elapsed_s':number('s',0)}),['controller'],'停止激励并冻结已完成相,外部场和已有显热继续演化')cap('acquisition.result',obj({}),RESULT,['controller'],'公开反转原始观测,所有会话统一隐去选中来源','query')cap('analysis.hall_vdp',ANALYSIS_INPUT,INFERENCE,['controller'],'从两种相反外场实测代理拟合电流/磁场反转项并数值解vdP;非FastHall私有算法','analysis',example=ANALYSIS_EXAMPLE)cap('provenance.read',obj({}),obj({'reference_id':nullable(TEXT),'template_source':nullable(TEXT),'evidence':TEXT}),['controller'],'仅宿主读取当前真实RH/rho曲线记录','query','evaluator')LEDGER_UNITS=dict(mass_loaded_kg='kg',mass_present_kg='kg',mass_removed_kg='kg',mass_error_kg='kg',volume_loaded_m3='m^3',volume_present_m3='m^3',volume_removed_m3='m^3',volume_error_m3='m^3',source_input_j='J',sample_joule_j='J',contact_heat_export_j='J',electrical_error_j='J',controller_input_j='J',ambient_loss_j='J',loaded_sensible_j='J',removed_sensible_j='J',thermal_stored_j='J',thermal_energy_error_j='J')cap('ledger.read',obj({}),obj({k:number(u) for k,u in LEDGER_UNITS.items()}),['controller'],'样品质量/体积/显热/焦耳、接触热外流与外部温控账;不计外部磁体供电','query','evaluator')cap('sim.step',obj({'dt_s':number('s',0,86400)}),obj({'time_s':number('s',0)}),['controller'],'单一宿主时间推进真实1800s预热、外部磁场、温度与反转采样','simulation','evaluator',{'dt_s':10.})UNSUPPORTED=['hardware.connect','robot.load','measurement.fasthall_proprietary','measurement.hall_bar','measurement.high_resistance_200gohm_range','measurement.multicarrier_tensor','noise.empirical','accuracy.certification']for k in UNSUPPORTED:cap(k,obj({}),obj({}),['controller'],'未实现:'+k)for k,c in [('plant.configured','controller'),('geometry.configured','sample_sheet'),('thermal.configured','thermal_port'),('field.configured','field_reference'),('sample.present','sample_sheet'),('power.enabled','power_button'),('warmup.ready','controller'),('thermal.enabled','thermal_port'),('clamp.moving','contact_carriage')]:slot(k,BOOL,'1','当前配置/运行状态',component=c)for k,z in [('clamp.position_m','四针当前上提量'),('clamp.target_m','四针目标上提量')]:slot(k,number('m',0,.012),'m',z+';0接触/.012装卸开放','setpoint' if 'target' in k else 'scene',component='contact_carriage')for k,z in [('ui.tilt_rad','TiltView当前手动代理角'),('ui.target_tilt_rad','TiltView目标手动代理角')]:slot(k,number('rad',0,.26),'rad',z+',范围和速度为工程假设','setpoint' if 'target' in k else 'scene',component='controller')slot('power.position_m',number('m',0,.0015),'m','电源按键100ms三角按下释放姿态代理,不把通电状态当永久按住','scene',component='power_button')slot('warmup.elapsed_s',number('s',0,1800),'s','当前连续供电累计预热,1800s封顶,掉电清零')slot('thermal.target_k',number('K'),'K','宿主外部热边界目标','setpoint',component='thermal_port')slot('thermal.indicated_k',nullable(number('K')),'K','样品与固定0.1J/K夹具集中节点量化观测','sensor',component='sample_sheet')slot('field.target_t',number('T'),'T','宿主外部磁体目标,不是M91磁场输出','setpoint',component='field_reference')slot('field.indicated_t',nullable(number('T')),'T','外部探头增益/偏置/量化后的垂直样品场观测','sensor',component='field_reference')slot('excitation.programmed_current_a',number('A',0,.1),'A','经当前量程1e-5分辨率量化的电流幅度','setpoint')slot('options.high_resistance_firmware_enabled',BOOL,'1','宿主明确配置的M9-ADD-HR固件选型,默认关闭')slot('excitation.mode',enum(['current','voltage']),'1','当前激励模式;method.configure回到电流模式,电压模式须已选HR固件','setpoint')slot('excitation.programmed_voltage_v',number('V',0,10),'V','电压模式经1e-5满档量化的源幅度,电流模式为零','setpoint')slot('excitation.current_measurement_range_a',nullable(number('A',1e-8,.1)),'A','电压模式下独立电流观测满量程;不会据此限制实际电流','setpoint')slot('excitation.source_voltage_v',nullable(number('V',-10,10)),'V','当前实际源端电压模型估计,触发限流或顺从后按真实负载计算,不等于四接点输入电压','derived')slot('measured.current_a',nullable(number('A')),'A','电流模式为实际源电流估计;电压模式为显式分辨率量化电流观测,独立测量档溢出不可用','sensor')slot('measured.voltage_v',nullable(number('V')),'V','当前接点配置的量化电压观测;不把所有相都叫Hall电压','sensor')slot('acquisition.contact_configuration',enum(CONTACTS+['idle']),'1','当前真实测量接点配置')slot('acquisition.polarity',enum(['zero','positive','negative']),'1','当前电流相,停止时为零')slot('clock.time_s',number('s',0),'s','唯一宿主时钟')slot('acquisition.phase',PHASE,'1','异步反转采样状态')slot('acquisition.elapsed_s',number('s',0),'s','本次真实采样时长')slot('acquisition.points',{'type':'integer','minimum':0,'maximum':900,'x-unit':'1'},'1','实际完成相数')for k,u in [('truth.sample_k','K'),('truth.field_t','T'),('truth.sample_mass_kg','kg')]:slot(k,nullable(number(u)),u,'宿主真实样品/外部场状态,非代理可见真值','process_truth','evaluator')
class LakeShoreMeasurereadyM91Runtime: def __init__(self,instance_id='m91_01'): self.instance_id=instance_id;self.plant=None;self.geometry=None;self.thermal=None;self.field=None;self.sample=None;self.record=None;self.power=False;self._power_started_ns=None;self._button_started_ns=-1000000000;self.thermal_enabled=False;self.target=300.;self.field_actual=0.;self.field_target=0.;self.axes={'clamp':dict(position=.012,target=.012,start=.012,start_ns=0,arrival_ns=0),'ui':dict(position=0.,target=0.,start=0.,start_ns=0,arrival_ns=0)};self.x=np.zeros(7);self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0;self.method=copy.deepcopy(METHOD_EXAMPLE);self.programmed_current=METHOD_EXAMPLE['current_a'];self.calibration=copy.deepcopy(CALIBRATION_EXAMPLE);self.high_resistance_firmware_enabled=False;self.excitation_mode='current';self.voltage=copy.deepcopy(VOLTAGE_EXAMPLE);self.programmed_voltage=VOLTAGE_EXAMPLE['voltage_v'];self.current_limit=VOLTAGE_EXAMPLE['current_limit_a'];self.phase='idle';self.elapsed=0.;self.rows=[];self.error=None;self.operation_id=None;self._counter=0;self._start_ns=0;self._phase_index=0;self.expected_duration=0.;self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={};self._source=None;self._reference_id=None;self._evidence='no_sample';self._operation_source=None;self._operation_evidence='no_measurement';self.mass_loaded=self.mass_removed=self.volume_loaded=self.volume_removed=self.loaded_sensible=self.removed_sensible=0. @property def time_s(self):return self.time_ns/1e9 def register_principal(self,principal_id,visibility='agent'): if not isinstance(principal_id,str) or not principal_id or principal_id in self._principals or visibility not in ('agent','debug','evaluator'):raise ActionRejected('REQUEST_CONFLICT') self._principals[principal_id]=visibility def session(self,principal_id): if principal_id not in self._principals:raise ActionRejected('ACCESS_DENIED') return LakeShoreMeasurereadyM91Session(self,principal_id) def describe(self):return export_lakeshore_measurereadym91_contract_metadata() def _warmup(self):return min(WARMUP_S,(self.time_ns-self._power_started_ns)/1e9) if self.power and self._power_started_ns is not None else 0. def _moving(self,key):return self.time_ns<self.axes[key]['arrival_ns'] def _closed(self):return self.axes['clamp']['position']<=1e-12 and self.axes['clamp']['target']==0. def _volume(self):return self.geometry['side_m']**2*self.geometry['thickness_m'] if self.sample else 0. def _mass(self):return self._volume()*self.sample['density_kg_m3'] if self.sample else 0. def _capacity(self):return .1+(self._mass()*self.sample['specific_heat_capacity_j_kg_k'] if self.sample else 0.) def _temperature(self):return self.plant['ambient_k']+float(self.x[0]) if self.plant else None def _contact(self):return CONTACTS[(self._phase_index//3)%3] if self.phase=='running' else 'idle' def _polarity(self):return ['zero','positive','negative'][self._phase_index%3] if self.phase=='running' else 'zero' def _button_position(self): t=(self.time_ns-self._button_started_ns)/1e9 return .0015*(1-abs(t-.05)/.05) if 0<=t<=.1 else 0. def _field_at(self,t):return external_field_at(self.field_actual,self.field_target,t,self.field['slew_t_s'],self.field['response_tau_s']) if self.field else self.field_actual def _field_observed(self,B=None): if not self.field:return None B=self.field_actual if B is None else B;f=self.field;c=self.calibration;v=(f['probe_gain']*B+f['probe_offset_t']-c['field_offset_t'])*c['field_gain_correction'];return float(round(v/f['probe_resolution_t'])*f['probe_resolution_t']) def _electrical(self,T=None,B=None): if not self.sample or not self.power or self.phase!='running' or not self._closed():return dict(current=0.,requested=0.,voltage=0.,source_voltage=0.,sample_power=0.,contact_power=0.,valid=True,compliance=False,resistance=0.) T=self._temperature() if T is None else T;B=self.field_actual if B is None else B;v=transport(self.record,T,clamp=True);sheet=v['resistivity_ohm_m']/self.geometry['thickness_m'];ra,rb=vdp_resistances(sheet,self.plant['contact_asymmetry']);bulk=sheet*self.plant['drive_geometry_factor'];contact=self.plant['current_contact_resistance_ohm'];sign={'zero':0.,'positive':1.,'negative':-1.}[self._polarity()] if self.excitation_mode=='voltage': requested=self.programmed_voltage*sign/(bulk+contact);I=math.copysign(min(abs(requested),self.current_limit),requested) else: requested=self.programmed_current*sign;I=math.copysign(min(abs(requested),self.plant['compliance_voltage_v']/(bulk+contact)),requested) configuration=self._contact();R=float(ra if configuration=='vdp_a' else rb if configuration=='vdp_b' else v['hall_coefficient_m3_c']*B/self.geometry['thickness_m']*self.plant['hall_geometry_factor']+self.plant['hall_misalignment_fraction']*math.sqrt(ra*rb));return dict(current=I,requested=requested,voltage=I*R,source_voltage=I*(bulk+contact),sample_power=I*I*bulk,contact_power=I*I*contact,valid=v['valid'],compliance=abs(I-requested)>max(abs(requested)*1e-10,1e-18),resistance=R) def _observed_current(self,e=None): if not self.power or self.phase!='running':return None e=self._electrical() if e is None else e if self.excitation_mode=='current':return e['current'] full=self.voltage['current_measurement_range_a'] if abs(e['current'])>full:return None q=full*self.voltage['current_resolution_fraction'];return float(round(e['current']/q)*q) def _observed_voltage(self): if not self.power or self.phase!='running':return None c=self.calibration;voltage=(self.x[1]-c['voltage_offset_v'])*c['voltage_gain_correction'] if abs(voltage)>self.method['voltage_range_v']:return None q=self.method['voltage_range_v']*self.plant['voltage_resolution_fraction'];return float(round(voltage/q)*q) def read(self,role='evaluator'): if role not in ('agent','debug','evaluator'):raise ActionRejected('ACCESS_DENIED') active=self.power and self.phase=='running';e=self._electrical();d={'plant.configured':self.plant is not None,'geometry.configured':self.geometry is not None,'thermal.configured':self.thermal is not None,'field.configured':self.field is not None,'sample.present':self.sample is not None,'power.enabled':self.power,'warmup.ready':self._warmup()>=WARMUP_S,'thermal.enabled':self.thermal_enabled,'clamp.moving':self._moving('clamp'),'clamp.position_m':self.axes['clamp']['position'],'clamp.target_m':self.axes['clamp']['target'],'ui.tilt_rad':self.axes['ui']['position'],'ui.target_tilt_rad':self.axes['ui']['target'],'power.position_m':self._button_position(),'warmup.elapsed_s':self._warmup(),'thermal.target_k':self.target,'thermal.indicated_k':float(round(self._temperature()/self.plant['temperature_resolution_k'])*self.plant['temperature_resolution_k']) if self.plant and self.thermal else None,'field.target_t':self.field_target,'field.indicated_t':self._field_observed(),'excitation.programmed_current_a':self.programmed_current,'measured.current_a':self._observed_current(e),'options.high_resistance_firmware_enabled':self.high_resistance_firmware_enabled,'excitation.mode':self.excitation_mode,'excitation.programmed_voltage_v':self.programmed_voltage if self.excitation_mode=='voltage' else 0.,'excitation.current_measurement_range_a':self.voltage['current_measurement_range_a'] if self.excitation_mode=='voltage' else None,'excitation.source_voltage_v':e['source_voltage'] if active else None,'measured.voltage_v':self._observed_voltage(),'acquisition.contact_configuration':self._contact(),'acquisition.polarity':self._polarity(),'clock.time_s':self.time_s,'acquisition.phase':self.phase,'acquisition.elapsed_s':self.elapsed,'acquisition.points':len(self.rows),'truth.sample_k':self._temperature(),'truth.field_t':self.field_actual if self.field else None,'truth.sample_mass_kg':self._mass() if self.sample else None} return {k:v for k,v in d.items() if role!='agent' or SLOTS[k]['visibility']=='agent'} def _propagate(self,ns): if not ns:return dt=ns/1e9;field_end=self._field_at(dt) if not self.plant or not self.thermal:self.field_actual=field_end;return p=self.plant;th=self.thermal;C=self._capacity();G=th['closed_conductance_w_k'] if self._closed() else th['open_conductance_w_k'];K=th['controller_gain_w_k'] if self.thermal_enabled and self._closed() else 0.;target=self.target-p['ambient_k'];active=self.power and self.phase=='running' def thermal_control(delta):return min(th['heating_limit_w'],max(-th['cooling_limit_w'],(K+G)*target-K*delta)) if K else 0. if active: name=self._contact();offset=p[{'vdp_a':'voltage_offset_a_v','vdp_b':'voltage_offset_b_v','hall':'voltage_offset_hall_v'}[name]];start_time=self.time_s def rhs(t,y): e=self._electrical(p['ambient_k']+y[0],self._field_at(t));controller=thermal_control(y[0]);ambient=G*y[0];signal=p['voltage_gain']*e['voltage']+offset+p['voltage_drift_v_s']*(start_time+t);return [(controller-ambient+e['sample_power'])/C,(signal-y[1])/p['voltage_response_tau_s'],e['sample_power'],e['contact_power'],e['current']*e['source_voltage'],controller,ambient] sol=solve_ivp(rhs,(0.,dt),self.x,method='Radau',rtol=1e-10,atol=[1e-11,1e-14,1e-15,1e-15,1e-15,1e-12,1e-12]) if not sol.success:raise RuntimeError('INTEGRATION_FAILED') self.x=sol.y[:,-1] else: initial=float(self.x[0]);low=min(initial,0.,target);high=max(initial,0.,target);saturated=K and ((K+G)*target-K*low>th['heating_limit_w'] or (K+G)*target-K*high < -th['cooling_limit_w']) if saturated: def rhs(_t,y): control=thermal_control(y[0]);ambient=G*y[0];return [(control-ambient)/C,control,ambient] sol=solve_ivp(rhs,(0.,dt),[self.x[0],self.x[5],self.x[6]],method='Radau',rtol=1e-10,atol=1e-11) if not sol.success:raise RuntimeError('THERMAL_INTEGRATION_FAILED') self.x[[0,5,6]]=sol.y[:,-1] else: A=np.zeros((4,4));A[0,0]=-(G+K)/C;A[0,3]=(K+G)*target/C if K else 0.;A[1,0]=-K;A[1,3]=(K+G)*target if K else 0.;A[2,0]=G;self.x[[0,5,6]]=(expm(A*dt)@np.array([self.x[0],self.x[5],self.x[6],1.]))[:3] self.x[1]*=math.exp(-dt/p['voltage_response_tau_s']) self.field_actual=field_end def _ledger(self): stored=self._capacity()*float(self.x[0]);joule,contact,source,control,ambient=self.x[2:];return dict(mass_loaded_kg=self.mass_loaded,mass_present_kg=self._mass(),mass_removed_kg=self.mass_removed,mass_error_kg=self.mass_loaded-self._mass()-self.mass_removed,volume_loaded_m3=self.volume_loaded,volume_present_m3=self._volume(),volume_removed_m3=self.volume_removed,volume_error_m3=self.volume_loaded-self._volume()-self.volume_removed,source_input_j=float(source),sample_joule_j=float(joule),contact_heat_export_j=float(contact),electrical_error_j=float(source-joule-contact),controller_input_j=float(control),ambient_loss_j=float(ambient),loaded_sensible_j=self.loaded_sensible,removed_sensible_j=self.removed_sensible,thermal_stored_j=stored,thermal_energy_error_j=float(control+joule-ambient+self.loaded_sensible-self.removed_sensible-stored)) def _result(self):return dict(operation_id=self.operation_id,phase=self.phase,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),template_source=self._operation_source,evidence=self._operation_evidence,error_code=self.error) def _finish(self,phase,error=None): self.phase=phase;self.error=error if self.operation_id:self.records[self.operation_id]=self._result() def _record(self): e=self._electrical();voltage=self._observed_voltage();current=self._observed_current(e);error='REFERENCE_TEMPERATURE_RANGE' if not e['valid'] else 'SOURCE_COMPLIANCE' if e['compliance'] else 'CURRENT_MEASUREMENT_OVERFLOW' if current is None else 'VOLTAGE_OVERFLOW' if voltage is None else None if not error and self._contact()!='hall' and self._polarity()!='zero' and not .01<=abs(e['resistance'])<=1e7:error='RESISTANCE_RANGE' self.rows.append(dict(time_s=self.elapsed,host_time_s=self.time_s,contact_configuration=self._contact(),polarity=self._polarity(),current_a=current,voltage_v=voltage,field_t=self._field_observed(),temperature_k=self.read()['thermal.indicated_k'],quality='unavailable' if error else 'estimated',error_code=error));self._phase_index+=1 if error:self._finish('failed',error) elif self._phase_index>=9*self.method['repeats']:self._finish('succeeded') def invoke(self,capability,**a): if capability not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability]['input_schema'],a) if capability in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if capability=='analysis.hall_vdp':return infer_hall_vdp(**a) if capability=='acquisition.result':return self._result() if capability=='provenance.read':return dict(reference_id=self._reference_id,template_source=self._source,evidence=self._evidence) if capability=='ledger.read':return self._ledger() if capability=='sim.step':self.step(a['dt_s']);return {'time_s':self.time_s} if self.phase=='running' and capability not in ('acquisition.stop','power.set'):raise ActionRejected('BUSY') if capability=='plant.configure': if self.plant or not a['accept_engineering']:raise ActionRejected('PRECONDITION_FAILED') self.plant=copy.deepcopy(a);self.target=a['ambient_k'];out={'configured':True} elif capability=='geometry.configure': if self.sample:raise ActionRejected('PRECONDITION_FAILED') self.geometry=copy.deepcopy(a);out={'configured':True} elif capability=='thermal.configure': if not self.plant or self.thermal or not a['accept_external_thermal_boundary'] or not a['minimum_temperature_k']<=self.plant['ambient_k']<=a['maximum_temperature_k'] or a['minimum_temperature_k']>=a['maximum_temperature_k']:raise ActionRejected('THERMAL_ENVELOPE') self.thermal=copy.deepcopy(a);out={'configured':True} elif capability=='field.configure': if self.field or not a['accept_external_magnet']:raise ActionRejected('PRECONDITION_FAILED') self.field=copy.deepcopy(a);out={'configured':True} elif capability=='field.set_target': if not self.field or abs(a['field_t'])>self.field['maximum_abs_t']:raise ActionRejected('FIELD_ENVELOPE') self.field_target=a['field_t'];out={'target_t':self.field_target} elif capability=='sample.load': if not self.plant or not self.thermal or not self.geometry or self.sample or self._moving('clamp') or self.axes['clamp']['position']<.011 or not a['accept_directional_scalar_and_thermal_assumptions']:raise ActionRejected('PRECONDITION_FAILED') record=library().get(a['reference_id']) if record is None:raise ActionRejected('UNKNOWN_REFERENCE') if transport(record,a['initial_temperature_k']) is None:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if not self.thermal['minimum_temperature_k']<=a['initial_temperature_k']<=self.thermal['maximum_temperature_k']:raise ActionRejected('THERMAL_ENVELOPE') old=self._capacity();self.sample=copy.deepcopy(a);self.record=copy.deepcopy(record);new=self._capacity();delta=a['initial_temperature_k']-self.plant['ambient_k'];self.x[0]=(old*self.x[0]+(new-old)*delta)/new;self.loaded_sensible+=(new-old)*delta;self.mass_loaded+=self._mass();self.volume_loaded+=self._volume();self._reference_id=a['reference_id'];self._source=json.dumps(record['source'],ensure_ascii=False,sort_keys=True);self._evidence='experimental_signed_Hall_and_resistivity_digitized_curves; scalar_directional_and_thermal_parameters_explicit_assumptions';out={'loaded':True} elif capability=='sample.remove': if not self.sample or self._moving('clamp') or self.axes['clamp']['position']<.011:raise ActionRejected('PRECONDITION_FAILED') self.mass_removed+=self._mass();self.volume_removed+=self._volume();self.removed_sensible+=self._mass()*self.sample['specific_heat_capacity_j_kg_k']*float(self.x[0]);self.sample=self.record=None;self._source=self._reference_id=None;self._evidence='no_sample';out={'loaded':False} elif capability in ('sample.set_clamp','ui.set_tilt'): if not self.plant:raise ActionRejected('PRECONDITION_FAILED') key='clamp' if capability=='sample.set_clamp' else 'ui';target=(0. if a['closed'] else .012) if key=='clamp' else a['angle_rad'];speed=self.plant['clamp_speed_m_s' if key=='clamp' else 'ui_tilt_speed_rad_s'];axis=self.axes[key];axis.update(target=target,start=axis['position'],start_ns=self.time_ns,arrival_ns=self.time_ns+round(abs(target-axis['position'])/speed*1e9));out={'target_m' if key=='clamp' else 'target_rad':target} elif capability=='power.set': if not a['enabled'] and self.phase=='running':self._finish('cancelled','POWER_OFF') if a['enabled']!=self.power:self._button_started_ns=self.time_ns;self._power_started_ns=self.time_ns if a['enabled'] else None self.power=a['enabled'];out={'enabled':self.power} elif capability=='thermal.set_temperature': if not self.thermal or not self.thermal['minimum_temperature_k']<=a['temperature_k']<=self.thermal['maximum_temperature_k']:raise ActionRejected('THERMAL_ENVELOPE') self.target=a['temperature_k'];self.thermal_enabled=True;out={'target_k':self.target} elif capability=='thermal.disable':self.thermal_enabled=False;out={'enabled':False} elif capability=='method.configure': if a['current_a']>a['current_range_a'] or abs(a['phase_duration_s']*1e9-round(a['phase_duration_s']*1e9))>1e-4:raise ActionRejected('CURRENT_OR_TIME_RANGE') quantum=a['current_range_a']*1e-5;programmed=float(round(a['current_a']/quantum)*quantum);self.method=copy.deepcopy(a);self.programmed_current=programmed;self.excitation_mode='current';out={'configured':True,'programmed_current_a':programmed} elif capability=='options.configure': if not a['high_resistance_firmware_enabled'] and self.excitation_mode=='voltage':raise ActionRejected('EXCITATION_MODE_ACTIVE') self.high_resistance_firmware_enabled=a['high_resistance_firmware_enabled'];out={'high_resistance_firmware_enabled':self.high_resistance_firmware_enabled} elif capability=='excitation.voltage.configure': if not self.high_resistance_firmware_enabled:raise ActionRejected('HIGH_RESISTANCE_FIRMWARE_REQUIRED') if a['voltage_v']>a['voltage_range_v']:raise ActionRejected('VOLTAGE_EXCITATION_RANGE') voltage_quantum=a['voltage_range_v']*1e-5;programmed=float(round(a['voltage_v']/voltage_quantum)*voltage_quantum);limit_full=next(fs for fs in CURRENT_RANGES if fs>=a['current_limit_a']);limit_quantum=limit_full*.001;limit=float(round(a['current_limit_a']/limit_quantum)*limit_quantum) self.voltage=copy.deepcopy(a);self.programmed_voltage=programmed;self.current_limit=limit;self.excitation_mode='voltage';out={'configured':True,'programmed_voltage_v':programmed,'current_limit_a':limit} elif capability=='sensor.calibrate':self.calibration=copy.deepcopy(a);out={'configured':True} elif capability=='acquisition.start': if not self.power or not self.plant or not self.geometry or not self.thermal or not self.field or not self.sample or not self._closed() or self._moving('clamp'):raise ActionRejected('PRECONDITION_FAILED') if self._warmup()<WARMUP_S:raise ActionRejected('WARMUP_REQUIRED') if (self.programmed_current if self.excitation_mode=='current' else self.programmed_voltage)<=0:raise ActionRejected('ZERO_EXCITATION') if self.excitation_mode=='voltage' and not self.high_resistance_firmware_enabled:raise ActionRejected('HIGH_RESISTANCE_FIRMWARE_REQUIRED') if abs(self.field_target-self.field_actual)>self.method['field_settling_tolerance_t']:raise ActionRejected('FIELD_NOT_SETTLED') if transport(self.record,self._temperature()) is None:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') self._counter+=1;self.operation_id=f'{self.instance_id}:acquisition:{self._counter}';self._operation_source=self._source;self._operation_evidence=self._evidence;self.phase='running';self.elapsed=0.;self.rows=[];self.error=None;self._start_ns=self.time_ns;self._phase_index=0;self.expected_duration=9*self.method['repeats']*round(self.method['phase_duration_s']*1e9)/1e9;out={'operation_id':self.operation_id,'expected_duration_s':self.expected_duration} elif capability=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled','USER_CANCEL');out={'phase':self.phase,'elapsed_s':self.elapsed} else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(out) def step(self,dt_s): validate(number('s',0,86400),dt_s);total=math.fsum((self._clock_remainder_ns,dt_s*1e9));ns=round(total);self._clock_remainder_ns=total-ns if not ns:return end=self.time_ns+ns while self.time_ns<end: boundary=end for key in self.axes: if self._moving(key):boundary=min(boundary,self.axes[key]['arrival_ns']) if self.phase=='running':boundary=min(boundary,self._start_ns+(self._phase_index+1)*round(self.method['phase_duration_s']*1e9)) self._propagate(boundary-self.time_ns);self.time_ns=boundary if self.plant: for key,axis in self.axes.items(): speed=self.plant['clamp_speed_m_s' if key=='clamp' else 'ui_tilt_speed_rad_s'];axis['position']=axis['target'] if self.time_ns>=axis['arrival_ns'] else axis['start']+math.copysign(speed*(self.time_ns-axis['start_ns'])/1e9,axis['target']-axis['start']) if self.phase=='running': self.elapsed=(self.time_ns-self._start_ns)/1e9 if self.time_ns==self._start_ns+(self._phase_index+1)*round(self.method['phase_duration_s']*1e9):self._record() self.revision+=1
class LakeShoreMeasurereadyM91Session: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_lakeshore_measurereadym91_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'observed_contact_voltages_current_and_external_field_with_explicit_scalar_Hall_vdP_assumptions; selected template details require evaluator provenance.read' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id=='acquisition.start' else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
EFFECTS={ 'plant.configure':['plant.configured','thermal.target_k','truth.sample_k'], 'geometry.configure':['geometry.configured'], 'thermal.configure':['thermal.configured','thermal.indicated_k'], 'field.configure':['field.configured','field.indicated_t','truth.field_t'], 'field.set_target':['field.target_t'], 'sample.load':['sample.present','truth.sample_mass_kg','truth.sample_k','thermal.indicated_k'], 'sample.remove':['sample.present','truth.sample_mass_kg'], 'sample.set_clamp':['clamp.target_m','clamp.moving'], 'ui.set_tilt':['ui.target_tilt_rad'], 'power.set':['power.enabled','power.position_m','warmup.ready','warmup.elapsed_s','acquisition.phase','measured.current_a','measured.voltage_v','acquisition.contact_configuration','acquisition.polarity','excitation.source_voltage_v'], 'thermal.set_temperature':['thermal.target_k','thermal.enabled'],'thermal.disable':['thermal.enabled'], 'method.configure':['excitation.programmed_current_a','excitation.mode','excitation.programmed_voltage_v','excitation.current_measurement_range_a'], 'options.configure':['options.high_resistance_firmware_enabled'], 'excitation.voltage.configure':['excitation.mode','excitation.programmed_voltage_v','excitation.current_measurement_range_a'], 'sensor.calibrate':['field.indicated_t','measured.voltage_v'], 'acquisition.start':['acquisition.phase','acquisition.elapsed_s','acquisition.points','acquisition.contact_configuration','acquisition.polarity','measured.current_a','measured.voltage_v','excitation.source_voltage_v'], 'acquisition.stop':['acquisition.phase','measured.current_a','measured.voltage_v','acquisition.contact_configuration','acquisition.polarity','excitation.source_voltage_v'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'POWER_OFF','USER_CANCEL','SOURCE_COMPLIANCE','CURRENT_MEASUREMENT_OVERFLOW','VOLTAGE_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','RESISTANCE_RANGE'})
def export_lakeshore_measurereadym91_contract_metadata(): slots={};caps={} for k,v in SLOTS.items(): slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI; four-corner thin uniform scalar sheet; external normal B; conventional current and external-field reversal.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'LakeShoreMeasurereadyM91Session.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Only explicit host step advances field, thermal, motion, detector response and 1800s warmup. Each zero/positive/negative excitation phase records its endpoint after declared dwell: current mode uses +/-I and voltage mode uses +/-V.'),source_ids=['simulation_assumption']) limits=[ '本体是M91 Hall控制器;磁体、样品夹具、场探头和温控边界由宿主明确组合,不虚构机内磁场或样品加热器。外部磁体供电/磁能不在本体电热账内。', '本模型实现M91实际支持的传统电流/外部磁场反转vdP子集。FastHall无需物理反磁私有算法、Hall bar及200GΩ全域高阻计量未实现;电压激励明确依赖宿主选择M9-ADD-HR固件;不把unsupported负例称实现验证。', '上电后只由真实宿主时间累计1800s预热,每次掉电清零;read/配置不推进时间,重复power.set(True)不重置已连续预热。', '电流源六量程1µA至100mA,每档编程步长1e-5×满量程;1µA档10pA是分辨率,1µA不是可编程电流下限。电压观测五量程1mV至10V是满量程,微伏信号不因小于1mV而拒绝。', '电压源四满量程10mV/100mV/1V/10V,编程步长1e-5×量程,10mV档可编程100nV而非最小输出10mV。仅M9-ADD-HR固件明确启用后可切换电压模式;method.configure切回电流模式。', '电压模式实际I=Vset/(Rdrive+Rcontact),源电流limit按0.1%满档量化,自动满档采用最小可容纳限值电流档的显式工程规则(厂家未公开该自动选档细节),SCPI保守范围100nA至100mA;概述0至100mA与SCPI下限不同已记录。限流后实际Vsource=Iactual*(Rdrive+Rcontact),并保留功率后标compliance失败。', '电压模式电流观测四满量程10nA/10µA/10mA/100mA依手册,官网不同分组未混用;current_resolution_fraction仅宿主工程量化模型,非OEM精度/噪声。测量档溢出不限制实际电流,观测current_a为null并失败,不允许null进入反演。', '基础电阻范围10mΩ至10MΩ。电流源宿主顺从电压1至10V;达到顺从时实际电流按样品与两电流接触总阻抗降额,保留真实焦耳热并将测量标失败,不能假称目标电流已达到。', '默认10×10mm、厚0.5mm四角薄片;geometry.configure只改变过程几何,静态示例mesh不自动缩放。装样时质量=ρside²d,载入后禁止改几何;卸样带走全部样品质量/体积及显热。', '真实库提供实验数字化带符号RH(T)和rho(T),不同温网格分别线性插值;有效域与原论文保守温区相交。未由Seebeck推Hall符号,无域外材料外推有效读数。', '密度、Cp、接触电阻、接触非对称、Hall几何因子、驱动几何因子和传感增益/偏置/τ/分辨率为宿主明确假设,不能当64种样品实测参数或OEM精度常数。', '薄片均匀、简单连通、四角小接触、标量方向代表是假设;不求解有限接触电流密度、张量各向异性、磁阻、非线性I-V或多载流子输运。vdP前向RA/RB满足指数恒等式但接触非对称不来自3D电流场求解。', '反演只使用外部观测I,V,B及时间,分别拟合电流奇项、I×B项、常偏置与线性漂移,再数值解vdP。两种B需方向相反且幅度满足显式容差,未宣称免反磁FastHall。', 'nH=1/(e|RH|)、muH=|RH|/rho是Hall派生量;额外n=rH*nH、mu=muH/rH依赖宿主显式单载流子Hall因子。ZrNiSn等来源可能多带,不把这些派生值冒充真实总载流子浓度。', '每个外场操作为vdP-A、vdP-B和Hall接点各零/正/负激励(电流模式±I、电压模式±V),按实际phase_duration等待并求一阶电压传感响应;有限响应或温漂会产生可见拟合偏差,非瞬时真值直抄。', '外部磁场满足有限slew和一阶响应,set_target只写目标;切换场时拒绝正在采样的操作。M91断电不关闭独立外部场/温控,取消仅停止测量激励并冻结已有相,已有热量继续交换。', '样品与固定0.1J/K夹具热容共一个工程集中节点。闭合夹具由外部热控制器调温,开夹转为环境热交换;显式加热/冷却功率上限与热导未知必须输入,不借用主机35W供电当加热功率。', '源电能分为样品I²R热和接触热导出环境,样品热与外部控制器/环境/装卸显热闭合;未计外部磁体功耗、Peltier/Thomson或磁化能,热账仅此明确电阻性子模型。', 'TiltView可手动倾斜,角范围/速度是工程代理;电源为100ms短按三角姿态不保持压下,低帧率可能看不到完整按键动作。显示覆盖为任意当前接点配置电压,并非每相都是Hall电压。', '所有Session公开result/poll即使evaluator转发也统一去除所选来源,privileged provenance.read单独返回当前样品溯源;操作结果保存采样时来源快照,Python/磁盘共享不是OS安全隔离。', '真实硬件校准、OEM精度/噪声、FastHall性能、机器人装样、完整电磁场/接触求解、外部温控与磁体硬件联调not_run。'] for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k=='acquisition.start';caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.lakeshore_measurereadym91.LakeShoreMeasurereadyM91Session.invoke',invocation=f'session.invoke(instance_id="m91_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='运行入口原子检查明确外场/热条件、夹持、真实1800s预热、参考温域、量程和异步所有权。',state_ids=['power.enabled','warmup.ready','sample.present','clamp.position_m','field.configured','acquisition.phase'],enforced_by='runtime',check='LakeShoreMeasurereadyM91Runtime.invoke guards before commit')],state_effects=[dict(state_id=s,timing='immediate',description_zh='命令实际即时状态变化') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='只输出可映射状态,实际场景验证单独登记。',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='各接点配置的零/正/负激励相按真实停留时间采样,全部完成或测量范围错误终止' if async_ else '原子命令;预热/外场/电热/机械/采样仅宿主step推进',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','external_magnet','four_contact_fixture','programmable_source','voltmeter'],partial_failure_zh='取消/断电停止电流并冻结已完成测量相;外部场和独立温控、已积显热继续。范围错误保留不可用相后停止激励。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('POWER_OFF','USER_CANCEL','SOURCE_COMPLIANCE','CURRENT_MEASUREMENT_OVERFLOW','VOLTAGE_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','RESISTANCE_RANGE') else 'none') for e in ERRORS],verification=[],limitations=limits,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('thermal.set_temperature','thermal.disable','sample.set_clamp','ui.set_tilt','field.set_target','acquisition.start','power.set'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='宿主时间推进外场、预热、电热、机械或实际测量相') for s in SLOTS if s not in v['effects'] and s not in ('plant.configured','geometry.configured','thermal.configured','field.configured','sample.present','power.enabled')] mechanism=dict(component_ids=['controller','contact_carriage','sample_sheet','thermal_port','field_reference'],state_ids=list(slots),meaning_zh='传统外部磁场与电流反转的四接点Hall及van der Pauw观测反演,真实预热、有限场响应与电热质量账',implementation='lumped',equations=[ 'Rs=rho(T)/d; RA=Rs*log(1+exp(u))/pi; RB=Rs*log(1+exp(-u))/pi. Therefore exp(-pi*RA/Rs)+exp(-pi*RB/Rs)=1. u is declared contact-asymmetry proxy.', 'Current step=range*1e-5; Current mode:Iactual=sign(Iset)*min(abs(Iset),Vcompliance/(Rs*drive_geometry_factor+Rcontact)),1<=Vcompliance<=10V. Voltage mode:Irequested=Vset/(Rdrive+Rcontact),Iactual=sign(Irequested)*min(abs(Irequested),Ilimit),Vactual=Iactual*(Rdrive+Rcontact);Ilimit100nA..100mA with0.1%FS programming and explicitly assumed smallest-containing-FS selection. Voltage ranges limit maximum magnitude, not minimum resolvable measured signal.', 'V_A=I*RA; V_B=I*RB; V_H=I*(RH(T)*B/d*hall_geometry_factor+misalignment*sqrt(RA*RB)). Gain/offset/linear drift feed explicit first-order detector dz/dt=(Vsignal-z)/tau.', 'dB/dt=clip((Btarget-B)/tau,-slew,+slew), integrated analytically through transition. Field and thermal source are external boundaries and continue independently of M91 logical power.', 'External inverse fits V=R*I+offset+drift*t for A/B and V=Rmisalign*I+(RH*g/d)*I*B+offset+drift*t for Hall. A bracketing root solves vdP sheet resistance using observed RA/RB only.', 'nH=1/(e*abs(RH)),muH=abs(RH)/rho; assumed single-carrier n=rH*nH,mu=muH/rH. Hall sign labels Hall response only; multiband true carrier populations are not inferred.', 'Psource=I*Vsource=I²*(Rdrive+Rcontact); Psample=I²*Rdrive; Pcontact_export=I²*Rcontact. Csample_total*dT/dt=Pcontroller+Psample-G*(T-Ta), Csample_total=0.1J/K+rho_mass*volume*Cp.', 'Pcontroller=clip((K+G)*(Ttarget-Ta)-K*(T-Ta),-cooling_limit,+heating_limit) when clamped and external controller enabled. Open clamp uses ambient Gopen and no active controller. Incoming/outgoing sample sensible heat is ledgered.', 'Idle linear thermal states use exact matrix exponential; active detector/temperature-dependent electrical model uses Radau integration with sampling-event boundaries; nanosecond residual carries fractional host timestep (e.g.60Hz). Warmup is1800 host seconds after last powerup.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=limits) spec=importlib.util.spec_from_file_location('_m91_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'hall_van_der_pauw':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'geometry.configure':(GEOMETRY,GEOMETRY_EXAMPLE),'thermal.configure':(THERMAL,THERMAL_EXAMPLE),'field.configure':(FIELD,FIELD_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE),'excitation.voltage.configure':(VOLTAGE,VOLTAGE_EXAMPLE)}) for key,value in SLOTS.items():slots[key]['meaning_zh']=value['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'hall_van_der_pauw':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431"""CHEM140 Alpha-T RevC with current converter: observed phasor spectroscopy.
Finite dwell,50ohm generator loading,external OSL inverse calibration and explicitthermal budgets. Static dielectric references never become claimed measured spectra."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npfrom scipy.integrate import solve_ivpPROTOCOL_VERSION='1.0.0';SLUG='novocontrol_alphat';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-140'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'dielectric_library.json'
class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
from scipy.linalg import expmEPS0=8.8541878128e-12SOURCE_RESISTANCE_OHM=50.CONVERTER_LIMIT_A=.04MIN_POINT_S=1/10.5
def library():return {x['id']:x for x in json.loads(LIBRARY_PATH.read_text())['templates']}def cx(unit):return obj({'real':number(unit),'imag':number(unit)})def pack(z):return dict(real=float(complex(z).real),imag=float(complex(z).imag))def unpack(v):return complex(v['real'],v['imag'])def vacuum_capacitance(diameter_m,thickness_m):return EPS0*math.pi*(diameter_m/2)**2/thickness_m
def dielectric_response(epsilon_static,epsilon_infinity,relaxation_time_s,dc_conductivity_s_m,frequency_hz): w=2*math.pi*frequency_hz;return epsilon_infinity+(epsilon_static-epsilon_infinity)/(1+1j*w*relaxation_time_s)-1j*dc_conductivity_s_m/(w*EPS0)
def infer_dielectric(frequency_hz,voltage_rms,current_rms,diameter_m,thickness_m): voltage=unpack(voltage_rms);current=unpack(current_rms) if abs(voltage)<1e-30 or abs(current)<1e-30:raise ActionRejected('ANALYSIS_ZERO_SIGNAL') z=voltage/current if not math.isfinite(z.real) or not math.isfinite(z.imag) or abs(z)<1e-300:raise ActionRejected('ANALYSIS_DATA') y=1/z;w=2*math.pi*frequency_hz;c0=vacuum_capacitance(diameter_m,thickness_m);eps=y/(1j*w*c0) if eps.real<=0 or -eps.imag < -1e-9*max(abs(eps),1.):raise ActionRejected('NONPASSIVE_OR_NONCAPACITIVE_RESULT') loss=max(0.,-eps.imag) return dict(impedance_ohm=pack(z),epsilon_real=float(eps.real),epsilon_loss=float(loss),tan_delta=float(loss/eps.real),parallel_capacitance_f=float(c0*eps.real),conductivity_real_s_m=float(w*EPS0*loss),conductivity_imag_s_m=float(w*EPS0*eps.real),evidence='inverse_of_supplied_RMS_complex_voltage_and_current; epsilon=Y/(j*omega*C0); sigma_real_includes_dielectric_loss_not_only_dc_conduction')
def solve_osl(frequency_hz,open_measured_ohm,short_measured_ohm,load_measured_ohm,load_resistance_ohm): zo,zs,zl=map(unpack,[open_measured_ohm,short_measured_ohm,load_measured_ohm]);scale=max(abs(zo),abs(zs),abs(zl),1e-30) if abs(zo)<1e-30 or abs(zl-zs)<1e-12*max(abs(zl),abs(zs),1e-30) or abs(zo-zs)<1e-12*scale:raise ActionRejected('CALIBRATION_DEGENERATE') a=load_resistance_ohm*(1-zl/zo)/(zl-zs);b=-a*zs;c=-1/zo if not all(math.isfinite(v) for z in (a,b,c) for v in (z.real,z.imag)):raise ActionRejected('CALIBRATION_DEGENERATE') return dict(frequency_hz=frequency_hz,a=pack(a),b_ohm=pack(b),c_s=pack(c),evidence='three_standard_Mobius_inverse_from_external_open_short_load_measurements; no_hidden_fixture_or_gain_access')
def correct_impedance(z,calibration): denominator=unpack(calibration['c_s'])*z+1 if abs(denominator)<1e-14:raise ActionRejected('CALIBRATION_SINGULAR') return (unpack(calibration['a'])*z+unpack(calibration['b_ohm']))/denominator
PLANT_EXAMPLE=dict(ambient_k=293.2,fixture_series_resistance_ohm=.2,fixture_series_inductance_h=1e-7,fixture_parallel_capacitance_f=2e-12,fixture_parallel_conductance_s=1e-10,voltage_gain_magnitude=1.,voltage_gain_phase_rad=0.,current_gain_magnitude=1.,current_gain_phase_rad=0.,voltage_resolution_v=1e-10,current_resolution_a=1e-18,detector_tau_s=.002,temperature_resolution_k=1e-4,clamp_speed_m_s=.025,accept_engineering=True)PLANT=obj({'ambient_k':number('K',283.15,313.15),'fixture_series_resistance_ohm':number('ohm',0,1e6),'fixture_series_inductance_h':number('H',0,1),'fixture_parallel_capacitance_f':number('F',1e-18,1e-3),'fixture_parallel_conductance_s':number('S',0,1),'voltage_gain_magnitude':number('1',.1,10),'voltage_gain_phase_rad':number('rad',-math.pi,math.pi),'current_gain_magnitude':number('1',.1,10),'current_gain_phase_rad':number('rad',-math.pi,math.pi),'voltage_resolution_v':number('V',1e-15,.1),'current_resolution_a':number('A',1e-24,.001),'detector_tau_s':number('s',1e-6,100),'temperature_resolution_k':number('K',1e-6,1),'clamp_speed_m_s':number('m/s',.0001,.1),'accept_engineering':BOOL})GEOMETRY_EXAMPLE=dict(diameter_m=.02,thickness_m=.001)GEOMETRY=obj({'diameter_m':number('m',.001,.1),'thickness_m':number('m',1e-6,.02)})THERMAL_EXAMPLE=dict(minimum_temperature_k=293.15,maximum_temperature_k=303.15,bath_capacity_j_k=5.,bath_ambient_conductance_w_k=.1,sample_bath_conductance_w_k=.5,open_sample_ambient_conductance_w_k=.05,controller_gain_w_k=5.,heating_limit_w=30.,cooling_limit_w=30.,accept_external_engineering_system=True)THERMAL=obj({'minimum_temperature_k':number('K',100,1000),'maximum_temperature_k':number('K',100,1000),'bath_capacity_j_k':number('J/K',.001,1e7),'bath_ambient_conductance_w_k':number('W/K',0,1000),'sample_bath_conductance_w_k':number('W/K',1e-6,1000),'open_sample_ambient_conductance_w_k':number('W/K',0,100),'controller_gain_w_k':number('W/K',1e-6,1e5),'heating_limit_w':number('W',.001,1e5),'cooling_limit_w':number('W',.001,1e5),'accept_external_engineering_system':BOOL})SAMPLE_EXAMPLE=dict(reference_id='water_crc_7732_18_5',epsilon_infinity=4.9,relaxation_time_s=1e-11,dc_conductivity_s_m=5e-6,density_kg_m3=1000.,specific_heat_capacity_j_kg_k=4180.,initial_temperature_k=293.2,temperature_tolerance_k=.5,accept_spectrum_assumption=True,accept_thermal_assumption=True)SAMPLE=obj({'reference_id':TEXT,'epsilon_infinity':number('1',1,1e5),'relaxation_time_s':number('s',1e-15,1e12),'dc_conductivity_s_m':number('S/m',0,1e8),'density_kg_m3':number('kg/m^3',1,30000),'specific_heat_capacity_j_kg_k':number('J/kg/K',1,10000),'initial_temperature_k':number('K',100,1000),'temperature_tolerance_k':number('K',.0001,2.),'accept_spectrum_assumption':BOOL,'accept_thermal_assumption':BOOL})METHOD_EXAMPLE=dict(frequencies_hz=[10.,100.,1000.,10000.,100000.],source_voltage_rms_v=.3,cycles_per_point=1,settling_s=.01,require_calibration=False)METHOD=obj({'frequencies_hz':array(number('Hz',3e-6,4e7),1,2001),'source_voltage_rms_v':number('V',0,3),'cycles_per_point':dict(type='integer',minimum=1,maximum=1000,**{'x-unit':'1'}),'settling_s':number('s',0,10000),'require_calibration':BOOL})MODE=enum(['sample','open','short','load'])OSL_INPUT=obj({'frequency_hz':number('Hz',3e-6,4e7),'open_measured_ohm':cx('ohm'),'short_measured_ohm':cx('ohm'),'load_measured_ohm':cx('ohm'),'load_resistance_ohm':number('ohm',.01,1e12)})OSL_RESULT=obj({'frequency_hz':number('Hz',3e-6,4e7),'a':cx('1'),'b_ohm':cx('ohm'),'c_s':cx('S'),'evidence':TEXT})OSL_EXAMPLE=dict(frequency_hz=1000.,open_measured_ohm=pack(100-1e6j),short_measured_ohm=pack(.2+.0006j),load_measured_ohm=pack(1000.199+.999j),load_resistance_ohm=1000.)ANALYSIS_INPUT=obj({'frequency_hz':number('Hz',3e-6,4e7),'voltage_rms':cx('V'),'current_rms':cx('A'),'diameter_m':number('m',.001,.1),'thickness_m':number('m',1e-6,.02)})ANALYSIS_EXAMPLE=dict(frequency_hz=1000.,voltage_rms=pack(1.),current_rms=pack(1e-8+1e-6j),diameter_m=.02,thickness_m=.001)INFERENCE=obj({'impedance_ohm':cx('ohm'),'epsilon_real':number('1',0),'epsilon_loss':number('1',0),'tan_delta':number('1',0),'parallel_capacitance_f':number('F',0),'conductivity_real_s_m':number('S/m',0),'conductivity_imag_s_m':number('S/m',0),'evidence':TEXT})ROW=obj({'time_s':number('s',0),'host_time_s':number('s',0),'frequency_hz':number('Hz'),'point_duration_s':number('s',0),'load_mode':MODE,'source_voltage_rms_v':number('V'),'voltage_rms':nullable(cx('V')),'current_rms':nullable(cx('A')),'raw_impedance_ohm':nullable(cx('ohm')),'impedance_ohm':nullable(cx('ohm')),'epsilon_real':nullable(number('1')),'epsilon_loss':nullable(number('1')),'tan_delta':nullable(number('1')),'parallel_capacitance_f':nullable(number('F')),'conductivity_real_s_m':nullable(number('S/m')),'conductivity_imag_s_m':nullable(number('S/m')),'sample_temperature_k':nullable(number('K')),'calibration_applied':BOOL,'quality':enum(['estimated','unavailable']),'error_code':nullable(TEXT)})RESULT=obj({'operation_id':nullable(TEXT),'phase':PHASE,'elapsed_s':number('s',0),'rows':array(ROW,0,2001),'template_source':nullable(TEXT),'evidence':TEXT,'error_code':nullable(TEXT)})CAPS={};SLOTS={}def cap(k,i,o,c,z,kind='device_command',visibility='agent',example=None):CAPS[k]=dict(input_schema=i,output_schema=o,component_ids=c,function_zh=z,kind=kind,visibility=visibility,example_arguments=copy.deepcopy(example or {}),effects=[])def slot(k,s,u,z,origin='derived',visibility='agent',component='controller'):SLOTS[k]=dict(schema=s,unit=u,meaning=z,origin=origin,visibility=visibility,component=component,write=None)cap('plant.configure',PLANT,obj({'configured':BOOL}),['controller','current_converter'],'宿主显式寄生/相位增益/探测响应参数,厂家50Ω源电阻固定','configuration','evaluator',PLANT_EXAMPLE)cap('geometry.configure',GEOMETRY,obj({'configured':BOOL}),['electrode_upper','electrode_lower','sample_disc'],'工程平板夹具几何与C0;装样后尺寸锁定守恒','configuration','evaluator',GEOMETRY_EXAMPLE)cap('thermal.configure',THERMAL,obj({'configured':BOOL}),['thermal_port','electrode_lower'],'明确选择外部工程集中热边界,不假造OEM温控附件额定温区','configuration','evaluator',THERMAL_EXAMPLE)cap('sample.load',SAMPLE,obj({'loaded':BOOL}),['sample_disc'],'真实静态介电参考加显式Debye/直流导电/热物性假设,不冒充实测宽频谱','configuration','evaluator',SAMPLE_EXAMPLE)cap('sample.remove',obj({}),obj({'loaded':BOOL}),['sample_disc'],'移出整片/定容液体样品及当前显热,不回滚已耗散热','configuration','evaluator')cap('sample.set_clamp',obj({'closed':BOOL}),obj({'target_m':number('m',0,.025)}),['electrode_upper'],'宿主手动上电极有限运动代理,开放时转为外界热交换','simulation','evaluator',{'closed':True})cap('power.set',obj({'enabled':BOOL}),obj({'enabled':BOOL}),['power_switch'],'关闭源电压/控制并取消采集,样品显热继续交换',example={'enabled':True})cap('thermal.set_temperature',obj({'temperature_k':number('K',100,1000)}),obj({'target_k':number('K')}),['thermal_port'],'只写已配置外部热边界范围内目标,实际温度仅step推进',example={'temperature_k':293.2})cap('thermal.disable',obj({}),obj({'enabled':BOOL}),['thermal_port'],'停止外部主动温控,热交换与介电耗散仍按实际供电继续')cap('fixture.select_load',obj({'mode':MODE,'load_resistance_ohm':number('ohm',.01,1e12)}),obj({'mode':MODE}),['electrode_upper','current_converter'],'宿主连接样品或外部open/short/已知纯电阻参考;非已验证自动校准切换硬件','simulation','evaluator',{'mode':'sample','load_resistance_ohm':1000.})cap('method.configure',METHOD,obj({'configured':BOOL}),['controller'],'每点实际等待cycles/f和无OptionF的10.5点/s下限,幅度按频界检查','configuration',example=METHOD_EXAMPLE)cap('calibration.solve',OSL_INPUT,OSL_RESULT,['controller'],'只用外部open/short/load复阻抗观测解三项Möbius校正','analysis',example=OSL_EXAMPLE)cap('calibration.apply',obj({'records':array(OSL_RESULT,1,2001)}),obj({'configured':BOOL}),['controller'],'应用外部逐频点校准系数;不外推/插值到未校准频率','configuration',example={'records':[solve_osl(**OSL_EXAMPLE)]})cap('calibration.clear',obj({}),obj({'configured':BOOL}),['controller'],'清除校准记录并明确返回未校准状态','configuration')cap('acquisition.start',obj({}),obj({'operation_id':TEXT,'expected_duration_s':number('s',0)}),['controller','current_converter'],'异步逐频率实际驻留并采集RMS复电压电流')cap('acquisition.stop',obj({}),obj({'phase':PHASE,'elapsed_s':number('s',0)}),['controller'],'停止源激励并冻结已完成频点,部分点不伪装完成')cap('acquisition.result',obj({}),RESULT,['controller'],'公开复VI观测和反演介电/损耗/阻抗;任意会话均隐藏选中物质来源','query')cap('analysis.dielectric',ANALYSIS_INPUT,INFERENCE,['controller'],'仅由外部复VI及平板几何反演,σ实部包括介电损耗与直流导电','analysis',example=ANALYSIS_EXAMPLE)cap('provenance.read',obj({}),obj({'reference_id':nullable(TEXT),'template_source':nullable(TEXT),'evidence':TEXT}),['controller'],'仅宿主读取当前样品真实静态参考及显式谱假设来源','query','evaluator')LEDGER_UNITS=dict(mass_loaded_kg='kg',mass_present_kg='kg',mass_removed_kg='kg',mass_error_kg='kg',volume_loaded_m3='m^3',volume_present_m3='m^3',volume_removed_m3='m^3',volume_error_m3='m^3',generator_active_input_j='J',source_resistor_heat_j='J',fixture_parasitic_heat_j='J',reference_load_heat_j='J',sample_dielectric_heat_j='J',electrical_error_j='J',controller_input_j='J',ambient_loss_j='J',loaded_sensible_j='J',removed_sensible_j='J',thermal_stored_j='J',thermal_energy_error_j='J')cap('ledger.read',obj({}),obj({k:number(u) for k,u in LEDGER_UNITS.items()}),['controller'],'周期平��源/50Ω/寄生/参考/样品耗散及热/质量/体积守恒账','query','evaluator')cap('sim.step',obj({'dt_s':number('s',0,86400)}),obj({'time_s':number('s',0)}),['controller'],'单一宿主时钟支持分数纳秒余数,超长低频点必须实际累计推进','simulation','evaluator',{'dt_s':.1})UNSUPPORTED=['hardware.connect','robot.load','measurement.dc_bias_option_b','measurement.fast_option_f','measurement.high_voltage','measurement.oem_thermal_attachment','noise.empirical','accuracy.certification','measurement.field_transients']for k in UNSUPPORTED:cap(k,obj({}),obj({}),['controller'],'未实现:'+k)for k,c in [('plant.configured','controller'),('geometry.configured','electrode_lower'),('thermal.configured','thermal_port'),('sample.present','sample_disc'),('power.enabled','power_switch'),('thermal.enabled','thermal_port'),('clamp.moving','electrode_upper'),('calibration.configured','controller')]:slot(k,BOOL,'1','实际配置或运行状态',component=c)for suffix in ['position_m','target_m']:slot('clamp.'+suffix,number('m',0,.025),'m','上电极开口相对测量位置位移;0闭合,.025开放','setpoint' if suffix=='target_m' else 'scene',component='electrode_upper')slot('power.angle_rad',number('rad',0,.28),'rad','电源开关工程姿态','scene',component='power_switch')slot('thermal.target_k',number('K'),'K','外部工程热边界温度目标,不代表OEM温控能力','setpoint',component='thermal_port')slot('thermal.indicated_k',nullable(number('K')),'K','样品与电极集中节点量化温度API观测,非厂家精度认证','sensor',component='sample_disc')slot('excitation.frequency_hz',nullable(number('Hz')),'Hz','当前真实驻留频点,未激励时null','derived',component='controller')slot('excitation.source_voltage_rms_v',number('V'),'V','当前50Ω前源RMS幅度,停止时0,不等于样品两端幅度','derived',component='controller')slot('fixture.load_mode',MODE,'1','宿主当前接入sample/open/short/load参考','setpoint',component='current_converter')slot('measured.voltage_rms_v',nullable(cx('V')),'V','含显式增益/相位/响应/量化的复RMS电压观测','sensor',component='current_converter')slot('measured.current_rms_a',nullable(cx('A')),'A','含显式增益/相位/响应/量化的复RMS电流;超过40mA时不可用','sensor',component='current_converter')slot('clock.time_s',number('s',0),'s','唯一宿主时钟')slot('acquisition.phase',PHASE,'1','异步频扫状态')slot('acquisition.elapsed_s',number('s',0),'s','本次实际源激励时长')slot('acquisition.expected_duration_s',number('s',0),'s','逐点频率周期及通信速率下限计算的所需总时长')slot('acquisition.points',{'type':'integer','minimum':0,'maximum':2001,'x-unit':'1'},'1','实际完成的频点数,不含尚未完成点')for k,u in [('truth.bath_k','K'),('truth.sample_k','K'),('truth.sample_mass_kg','kg'),('truth.dc_conductivity_s_m','S/m')]:slot(k,nullable(number(u)),u,'仅宿主真实热/样品参数状态','process_truth','evaluator')
class NovocontrolAlphatRuntime: def __init__(self,instance_id='alphat_01'): self.instance_id=instance_id;self.plant=None;self.geometry=None;self.thermal=None;self.sample=None;self.record=None;self.power=False;self.thermal_enabled=False;self.target=293.2;self.clamp=.025;self.clamp_target=.025;self._clamp_start=.025;self._clamp_start_ns=0;self._clamp_arrival_ns=0;self.x=np.zeros(4);self.detector=np.zeros(2,dtype=complex);self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0;self.mode='sample';self.load_resistance=1000.;self.method=copy.deepcopy(METHOD_EXAMPLE);self.calibration={};self.phase='idle';self.elapsed=0.;self.rows=[];self.error=None;self.operation_id=None;self._counter=0;self._start_ns=0;self._point_index=0;self._point_start_ns=0;self._point_end_ns=0;self.expected_duration=0.;self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={};self._source=None;self._reference_id=None;self._evidence='no_sample';self._operation_source=None;self._operation_evidence='no_measurement';self.mass_loaded=self.mass_removed=self.volume_loaded=self.volume_removed=self.loaded_sensible=self.removed_sensible=0.;self.electrical_energy=np.zeros(5) @property def time_s(self):return self.time_ns/1e9 def register_principal(self,principal_id,visibility='agent'): if not isinstance(principal_id,str) or not principal_id or principal_id in self._principals or visibility not in ('agent','debug','evaluator'):raise ActionRejected('REQUEST_CONFLICT') self._principals[principal_id]=visibility def session(self,principal_id): if principal_id not in self._principals:raise ActionRejected('ACCESS_DENIED') return NovocontrolAlphatSession(self,principal_id) def describe(self):return export_novocontrol_alphat_contract_metadata() def _moving(self):return self.time_ns<self._clamp_arrival_ns def _closed(self):return self.clamp<=1e-12 and self.clamp_target==0. def _volume(self):return math.pi*(self.geometry['diameter_m']/2)**2*self.geometry['thickness_m'] if self.sample else 0. def _mass(self):return self._volume()*self.sample['density_kg_m3'] if self.sample else 0. def _capacities(self):return np.array([self.thermal['bath_capacity_j_k'],.1+(self._mass()*self.sample['specific_heat_capacity_j_kg_k'] if self.sample else 0.)]) def _temperature(self,i):return self.plant['ambient_k']+float(self.x[i]) if self.plant and self.thermal else None def _frequency(self):return self.method['frequencies_hz'][self._point_index] if self.phase=='running' else None def _point_duration_ns(self,f):return math.ceil((self.method['settling_s']+max(self.method['cycles_per_point']/f,MIN_POINT_S))*1e9) def _circuit(self,f=None,vrms=None,mode=None): f=self._frequency() if f is None else f;vrms=self.method['source_voltage_rms_v'] if vrms is None else vrms;mode=self.mode if mode is None else mode if f is None or not self.plant:return dict(voltage=0j,current=0j,source_voltage=0.,power=np.zeros(5),sample_admittance=0j) p=self.plant;w=2*math.pi*f;zp=complex(p['fixture_series_resistance_ohm'],w*p['fixture_series_inductance_h']);yp=complex(p['fixture_parallel_conductance_s'],w*p['fixture_parallel_capacitance_f']);ys=0j if mode=='sample' and self.sample: s=self.sample;eps=dielectric_response(s['epsilon_static'],s['epsilon_infinity'],s['relaxation_time_s'],s['dc_conductivity_s_m'],f);ys=1j*w*vacuum_capacitance(**self.geometry)*eps elif mode=='load':ys=1/self.load_resistance parallel_z=0j if mode=='short' else 1/(ys+yp);fixture_z=zp+parallel_z;current=complex(vrms)/(SOURCE_RESISTANCE_OHM+fixture_z);voltage=current*fixture_z;parallel_voltage=current*parallel_z;sample_power=abs(parallel_voltage)**2*ys.real if mode=='sample' else 0.;reference_power=abs(parallel_voltage)**2*ys.real if mode=='load' else 0.;parasitic=abs(current)**2*zp.real+abs(parallel_voltage)**2*yp.real;source_heat=abs(current)**2*SOURCE_RESISTANCE_OHM;input_power=float((complex(vrms)*current.conjugate()).real);return dict(voltage=voltage,current=current,source_voltage=vrms,power=np.array([input_power,source_heat,parasitic,reference_power,sample_power]),sample_admittance=ys) def _measurement_error(self,circuit): if abs(circuit['current'])>CONVERTER_LIMIT_A*(1+1e-12):return 'CURRENT_CONVERTER_OVERFLOW' if self.mode=='sample' and self.sample and abs(self._temperature(1)-self.sample['reference_k'])>self.sample['temperature_tolerance_k']:return 'REFERENCE_TEMPERATURE_RANGE' return None def _observed(self): if not self.power or not self.plant or self.phase!='running':return None,None circuit=self._circuit() if self._measurement_error(circuit):return None,None p=self.plant;quant=lambda z,q:complex(round(z.real/q)*q,round(z.imag/q)*q);return pack(quant(self.detector[0],p['voltage_resolution_v'])),pack(quant(self.detector[1],p['current_resolution_a'])) def read(self,role='evaluator'): if role not in ('agent','debug','evaluator'):raise ActionRejected('ACCESS_DENIED') voltage,current=self._observed();d={'plant.configured':self.plant is not None,'geometry.configured':self.geometry is not None,'thermal.configured':self.thermal is not None,'sample.present':self.sample is not None,'power.enabled':self.power,'thermal.enabled':self.thermal_enabled,'clamp.moving':self._moving(),'calibration.configured':bool(self.calibration),'clamp.position_m':self.clamp,'clamp.target_m':self.clamp_target,'power.angle_rad':.28 if self.power else 0.,'thermal.target_k':self.target,'thermal.indicated_k':float(round(self._temperature(1)/self.plant['temperature_resolution_k'])*self.plant['temperature_resolution_k']) if self.power and self.thermal else None,'excitation.frequency_hz':self._frequency(),'excitation.source_voltage_rms_v':self.method['source_voltage_rms_v'] if self.phase=='running' and self.power else 0.,'fixture.load_mode':self.mode,'measured.voltage_rms_v':voltage,'measured.current_rms_a':current,'clock.time_s':self.time_s,'acquisition.phase':self.phase,'acquisition.elapsed_s':self.elapsed,'acquisition.expected_duration_s':self.expected_duration,'acquisition.points':len(self.rows),'truth.bath_k':self._temperature(0),'truth.sample_k':self._temperature(1),'truth.sample_mass_kg':self._mass() if self.sample else None,'truth.dc_conductivity_s_m':self.sample['dc_conductivity_s_m'] if self.sample else None} return {k:v for k,v in d.items() if role!='agent' or SLOTS[k]['visibility']=='agent'} def _propagate(self,ns): if not ns:return dt=ns/1e9;circuit=self._circuit() if self.power and self.phase=='running' else dict(voltage=0j,current=0j,power=np.zeros(5));self.electrical_energy+=circuit['power']*dt if self.plant: p=self.plant;gv=p['voltage_gain_magnitude']*complex(math.cos(p['voltage_gain_phase_rad']),math.sin(p['voltage_gain_phase_rad']));gi=p['current_gain_magnitude']*complex(math.cos(p['current_gain_phase_rad']),math.sin(p['current_gain_phase_rad']));target=np.array([circuit['voltage']*gv,circuit['current']*gi]);self.detector=target+(self.detector-target)*math.exp(-dt/p['detector_tau_s']) if not self.thermal:return t=self.thermal;C=self._capacities();gb=t['sample_bath_conductance_w_k'] if self._closed() else 0.;gs=0. if self._closed() else t['open_sample_ambient_conductance_w_k'];ga=t['bath_ambient_conductance_w_k'];K=t['controller_gain_w_k'] if self.power and self.thermal_enabled else 0.;target=self.target-self.plant['ambient_k'];P=float(circuit['power'][4]);low=min(float(min(self.x[:2])),0.,target);high=max(float(max(self.x[:2])),0.,target)+P*dt/min(C);saturated=K and ((K+ga)*target-K*low>t['heating_limit_w'] or (K+ga)*target-K*high < -t['cooling_limit_w']) if saturated: def rhs(_time,y): b,s=y[:2];raw=(K+ga)*target-K*b;control=min(t['heating_limit_w'],max(-t['cooling_limit_w'],raw));ambient=ga*b+gs*s;return [(control-gb*(b-s)-ga*b)/C[0],(gb*(b-s)-gs*s+P)/C[1],control,ambient] sol=solve_ivp(rhs,(0.,dt),self.x,method='Radau',rtol=1e-10,atol=[1e-11,1e-11,1e-10,1e-10]) if not sol.success:raise RuntimeError('THERMAL_INTEGRATION_FAILED') self.x=sol.y[:,-1] else: A=np.zeros((5,5));A[0,0]=-(gb+ga+K)/C[0];A[0,1]=gb/C[0];A[0,4]=(K+ga)*target/C[0] if K else 0.;A[1,0]=gb/C[1];A[1,1]=-(gb+gs)/C[1];A[1,4]=P/C[1];A[2,0]=-K;A[2,4]=(K+ga)*target if K else 0.;A[3,0]=ga;A[3,1]=gs;self.x=(expm(A*dt)@np.r_[self.x,1.])[:4] def _ledger(self): generator,source,parasitic,reference,sample=self.electrical_energy;stored=float(self._capacities()@self.x[:2]) if self.thermal else 0.;control,ambient=self.x[2:];return dict(mass_loaded_kg=self.mass_loaded,mass_present_kg=self._mass(),mass_removed_kg=self.mass_removed,mass_error_kg=self.mass_loaded-self._mass()-self.mass_removed,volume_loaded_m3=self.volume_loaded,volume_present_m3=self._volume(),volume_removed_m3=self.volume_removed,volume_error_m3=self.volume_loaded-self._volume()-self.volume_removed,generator_active_input_j=float(generator),source_resistor_heat_j=float(source),fixture_parasitic_heat_j=float(parasitic),reference_load_heat_j=float(reference),sample_dielectric_heat_j=float(sample),electrical_error_j=float(generator-source-parasitic-reference-sample),controller_input_j=float(control),ambient_loss_j=float(ambient),loaded_sensible_j=self.loaded_sensible,removed_sensible_j=self.removed_sensible,thermal_stored_j=stored,thermal_energy_error_j=float(control+sample-ambient+self.loaded_sensible-self.removed_sensible-stored)) def _result(self):return dict(operation_id=self.operation_id,phase=self.phase,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),template_source=self._operation_source,evidence=self._operation_evidence,error_code=self.error) def _finish(self,phase,error=None): self.phase=phase;self.error=error if self.operation_id:self.records[self.operation_id]=self._result() def _record(self): frequency=self._frequency();circuit=self._circuit();error=self._measurement_error(circuit);voltage,current=self._observed();raw=None;corrected=None;inferred=None;calibration=self.calibration.get(frequency) if self.mode=='sample' else None if not error: try: if voltage is None or current is None or abs(unpack(current))<1e-30:raise ActionRejected('ANALYSIS_ZERO_SIGNAL') raw=unpack(voltage)/unpack(current);corrected=correct_impedance(raw,calibration) if calibration else raw if self.mode=='sample': inferred=infer_dielectric(frequency,pack(corrected*unpack(current)),current,**self.geometry) if not .01<=abs(corrected)<=2e14 or not 1e-15<=inferred['parallel_capacitance_f']<=10.:raise ActionRejected('MEASUREMENT_RANGE') except ActionRejected as exc:error=str(exc) row=dict(time_s=self.elapsed,host_time_s=self.time_s,frequency_hz=frequency,point_duration_s=(self.time_ns-self._point_start_ns)/1e9,load_mode=self.mode,source_voltage_rms_v=self.method['source_voltage_rms_v'],voltage_rms=voltage,current_rms=current,raw_impedance_ohm=pack(raw) if raw is not None else None,impedance_ohm=pack(corrected) if corrected is not None else None,**{k:inferred[k] if inferred and not error else None for k in ['epsilon_real','epsilon_loss','tan_delta','parallel_capacitance_f','conductivity_real_s_m','conductivity_imag_s_m']},sample_temperature_k=self.read()['thermal.indicated_k'],calibration_applied=calibration is not None,quality='unavailable' if error else 'estimated',error_code=error);self.rows.append(row) if error:self._finish('failed',error);return self._point_index+=1 if self._point_index>=len(self.method['frequencies_hz']):self._finish('succeeded') else:self._point_start_ns=self.time_ns;self._point_end_ns=self.time_ns+self._point_duration_ns(self._frequency()) def invoke(self,capability,**a): if capability not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability]['input_schema'],a) if capability in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if capability=='analysis.dielectric':return infer_dielectric(**a) if capability=='calibration.solve':return solve_osl(**a) if capability=='acquisition.result':return self._result() if capability=='provenance.read':return dict(reference_id=self._reference_id,template_source=self._source,evidence=self._evidence) if capability=='ledger.read':return self._ledger() if capability=='sim.step':self.step(a['dt_s']);return {'time_s':self.time_s} if self.phase=='running' and capability not in ('acquisition.stop','power.set'):raise ActionRejected('BUSY') if capability=='plant.configure': if self.plant or not a['accept_engineering']:raise ActionRejected('PRECONDITION_FAILED') self.plant=copy.deepcopy(a);self.target=a['ambient_k'];out={'configured':True} elif capability=='geometry.configure': if self.sample:raise ActionRejected('PRECONDITION_FAILED') self.geometry=copy.deepcopy(a);out={'configured':True} elif capability=='thermal.configure': if not self.plant or self.thermal or not a['accept_external_engineering_system'] or not a['minimum_temperature_k']<=self.plant['ambient_k']<=a['maximum_temperature_k'] or a['minimum_temperature_k']>=a['maximum_temperature_k']:raise ActionRejected('PRECONDITION_FAILED') self.thermal=copy.deepcopy(a);out={'configured':True} elif capability=='sample.load': if not self.plant or not self.geometry or not self.thermal or self.sample or self._moving() or self.clamp<.024 or not a['accept_spectrum_assumption'] or not a['accept_thermal_assumption']:raise ActionRejected('PRECONDITION_FAILED') record=library().get(a['reference_id']) if record is None:raise ActionRejected('UNKNOWN_REFERENCE') epsilon=record.get('relative_permittivity_static');temperature=record.get('reference_temperature_K') if not isinstance(epsilon,(int,float)) or not math.isfinite(epsilon) or epsilon<a['epsilon_infinity']:raise ActionRejected('REFERENCE_DATA') if not isinstance(temperature,(int,float)) or not math.isfinite(temperature):raise ActionRejected('REFERENCE_TEMPERATURE_UNKNOWN') if abs(a['initial_temperature_k']-temperature)>a['temperature_tolerance_k']:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if not self.thermal['minimum_temperature_k']<=a['initial_temperature_k']<=self.thermal['maximum_temperature_k']:raise ActionRejected('THERMAL_ENVELOPE') old=self._capacities()[1];self.sample=copy.deepcopy(a);self.sample.update(epsilon_static=epsilon,reference_k=temperature);self.record=copy.deepcopy(record);new=self._capacities()[1];delta=a['initial_temperature_k']-self.plant['ambient_k'];self.x[1]=(old*self.x[1]+(new-old)*delta)/new;self.loaded_sensible+=(new-old)*delta;self.mass_loaded+=self._mass();self.volume_loaded+=self._volume();self._reference_id=a['reference_id'];self._source=json.dumps(record['source'],ensure_ascii=False,sort_keys=True);self._evidence='real_static_permittivity_reference; synthetic_Debye_spectrum_and_dc_conductivity_explicit_host_assumptions';out={'loaded':True} elif capability=='sample.remove': if not self.sample or self._moving() or self.clamp<.024:raise ActionRejected('PRECONDITION_FAILED') self.mass_removed+=self._mass();self.volume_removed+=self._volume();self.removed_sensible+=self._mass()*self.sample['specific_heat_capacity_j_kg_k']*float(self.x[1]);self.sample=self.record=None;self._source=self._reference_id=None;self._evidence='no_sample';out={'loaded':False} elif capability=='sample.set_clamp': if not self.plant:raise ActionRejected('PRECONDITION_FAILED') self.clamp_target=0. if a['closed'] else .025;self._clamp_start=self.clamp;self._clamp_start_ns=self.time_ns;self._clamp_arrival_ns=self.time_ns+round(abs(self.clamp_target-self.clamp)/self.plant['clamp_speed_m_s']*1e9);out={'target_m':self.clamp_target} elif capability=='power.set': if not a['enabled'] and self.phase=='running':self._finish('cancelled','POWER_OFF') self.power=a['enabled'] if not self.power:self.thermal_enabled=False out={'enabled':self.power} elif capability=='thermal.set_temperature': if not self.power or not self.thermal or not self.thermal['minimum_temperature_k']<=a['temperature_k']<=self.thermal['maximum_temperature_k']:raise ActionRejected('THERMAL_ENVELOPE') self.target=a['temperature_k'];self.thermal_enabled=True;out={'target_k':self.target} elif capability=='thermal.disable':self.thermal_enabled=False;out={'enabled':False} elif capability=='fixture.select_load':self.mode=a['mode'];self.load_resistance=a['load_resistance_ohm'];out={'mode':self.mode} elif capability=='method.configure': frequencies=a['frequencies_hz'] if len(set(frequencies))!=len(frequencies) or any(f>=1e7 and a['source_voltage_rms_v']>1. for f in frequencies):raise ActionRejected('FREQUENCY_VOLTAGE_ENVELOPE') self.method=copy.deepcopy(a);out={'configured':True} elif capability=='calibration.apply': if len({x['frequency_hz'] for x in a['records']})!=len(a['records']) or any(abs(unpack(x['a'])-unpack(x['b_ohm'])*unpack(x['c_s']))<1e-20 for x in a['records']):raise ActionRejected('CALIBRATION_DEGENERATE') self.calibration={x['frequency_hz']:copy.deepcopy(x) for x in a['records']};out={'configured':True} elif capability=='calibration.clear':self.calibration={};out={'configured':False} elif capability=='acquisition.start': if not self.power or not self.plant or not self.geometry or not self.thermal or not self._closed() or self._moving() or self.mode=='sample' and not self.sample:raise ActionRejected('PRECONDITION_FAILED') if self.method['source_voltage_rms_v']==0:raise ActionRejected('ZERO_EXCITATION') if self.mode=='sample' and abs(self._temperature(1)-self.sample['reference_k'])>self.sample['temperature_tolerance_k']:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if self.mode=='sample' and self.method['require_calibration'] and any(f not in self.calibration for f in self.method['frequencies_hz']):raise ActionRejected('CALIBRATION_MISSING') self._counter+=1;self.operation_id=f'{self.instance_id}:acquisition:{self._counter}';self._operation_source=self._source if self.mode=='sample' else None;self._operation_evidence=self._evidence if self.mode=='sample' else 'actual_simulated_external_reference_observation';self.phase='running';self.elapsed=0.;self.rows=[];self.error=None;self._start_ns=self.time_ns;self._point_index=0;self._point_start_ns=self.time_ns;self._point_end_ns=self.time_ns+self._point_duration_ns(self._frequency());self.expected_duration=sum(self._point_duration_ns(f) for f in self.method['frequencies_hz'])/1e9;out={'operation_id':self.operation_id,'expected_duration_s':self.expected_duration} elif capability=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled','USER_CANCEL');out={'phase':self.phase,'elapsed_s':self.elapsed} else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(out) def step(self,dt_s): validate(number('s',0,86400),dt_s);total=math.fsum((self._clock_remainder_ns,dt_s*1e9));ns=round(total);self._clock_remainder_ns=total-ns if not ns:return end=self.time_ns+ns while self.time_ns<end: boundary=end if self._moving():boundary=min(boundary,self._clamp_arrival_ns) if self.phase=='running':boundary=min(boundary,self._point_end_ns) self._propagate(boundary-self.time_ns);self.time_ns=boundary if self.plant:self.clamp=self.clamp_target if self.time_ns>=self._clamp_arrival_ns else self._clamp_start+math.copysign(self.plant['clamp_speed_m_s']*(self.time_ns-self._clamp_start_ns)/1e9,self.clamp_target-self._clamp_start) if self.phase=='running': self.elapsed=(self.time_ns-self._start_ns)/1e9 if self.time_ns==self._point_end_ns:self._record() self.revision+=1
class NovocontrolAlphatSession: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_novocontrol_alphat_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'observed_complex_VI_with_explicit_synthetic_spectrum_and_fixture_assumptions; selected template details require evaluator provenance.read' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id=='acquisition.start' else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
EFFECTS={ 'plant.configure':['plant.configured','thermal.target_k'], 'geometry.configure':['geometry.configured'], 'thermal.configure':['thermal.configured','truth.bath_k','truth.sample_k','thermal.indicated_k'], 'sample.load':['sample.present','truth.sample_mass_kg','truth.dc_conductivity_s_m','truth.sample_k','thermal.indicated_k'], 'sample.remove':['sample.present','truth.sample_mass_kg','truth.dc_conductivity_s_m'], 'sample.set_clamp':['clamp.target_m','clamp.moving'], 'power.set':['power.enabled','power.angle_rad','thermal.enabled','thermal.indicated_k','excitation.frequency_hz','excitation.source_voltage_rms_v','measured.voltage_rms_v','measured.current_rms_a','acquisition.phase'], 'thermal.set_temperature':['thermal.target_k','thermal.enabled'],'thermal.disable':['thermal.enabled'], 'fixture.select_load':['fixture.load_mode'], 'calibration.apply':['calibration.configured'],'calibration.clear':['calibration.configured'], 'acquisition.start':['acquisition.phase','acquisition.elapsed_s','acquisition.expected_duration_s','acquisition.points','excitation.frequency_hz','excitation.source_voltage_rms_v','measured.voltage_rms_v','measured.current_rms_a'], 'acquisition.stop':['acquisition.phase','excitation.frequency_hz','excitation.source_voltage_rms_v','measured.voltage_rms_v','measured.current_rms_a'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'POWER_OFF','USER_CANCEL','CURRENT_CONVERTER_OVERFLOW','REFERENCE_TEMPERATURE_RANGE'})
def export_novocontrol_alphat_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI; RMS phasors with exp(+j*omega*t),epsilon*=epsilon_real-j*epsilon_loss,Y=j*omega*C0*epsilon. Alpha-T RevC,current converter40mA;50ohmsource.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'NovocontrolAlphatSession.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Host clock only; displayed phasor is an explicitly assumed first-order demodulator endpoint estimate after actual frequency dwell, not an instantaneous AC waveform sample.'),source_ids=['simulation_assumption']) limits=[ 'Alpha-T RevC含电流转换接口;范围3µHz至40MHz。10MHz以下0至3Vrms,原表below/above边界未明,恰好10MHz本模型保守限制1Vrms并与高频同处理。源输出阻抗固定50Ω。', '未选OptionF时每点等待settling+max(cycles/f,1/10.5)s;3µHz一周期至少333333.333s,不能瞬时出谱。600点/s、OptionB直流偏置和高压选件unsupported。', '电流转换器物理电流超过40mA即观测不可用、完成当前点时采集失败切断源;不把测量量程伪装成源电流限流。样品端RMS电压由50Ω分压与寄生网络决定,并非始终等于源幅度。', '模板提供真实文献编纂静态介电常数/温度,curves为空。Debye高频极限、松弛τ、σdc均由宿主显式假设,生成曲线为synthetic,不冒充67种真实宽频实测谱。', '默认water静态ε80.1@293.2K;ε∞4.9、τ1e-11s、σdc5e-6S/m、ρ1000kg/m³和Cp4180J/kg/K仅工程水近似,库内未知字段仍null。改变τ用于教学弛豫峰不能写成物质实验结果。', 'Debye关系epsilon*=epsilon_inf+(epsilon_s-epsilon_inf)/(1+j*omega*tau)-j*sigma_dc/(omega*eps0);C0=eps0*A/d。复电导定义sigma*=j*omega*eps0*epsilon,实部包含介电损耗与直流导电;不能与宿主sigma_dc混称。', '工程平板D20mm厚1mm的绝缘液池/固体垫片实例,电极下方为generator高电位、上方为current-converter虚地。geometry.configure影响过程几何,静态3D示例不自动缩放。装样后禁止改几何以免质量体积生灭。', '本批工程夹具用串联R/L、并联C/G寄生网络;已知BDS1200上限10MHz、ZGS只适配Alpha-A,不把两者拼成Alpha-T原厂40MHz夹具。Analyzer BNC端范围不能自动等同样品端精度。', '外部open/short/已知纯电阻load经实际相同网络和两个复增益通道测量,solve由三个外部观测解Möbius逆,再apply逐频点记录;不读隐藏寄生/增益,不跨未校准频率插值。fixture.select_load只是宿主接线代理,不声称自动校准机械。', '所有电压电流为RMS复相量,P=Re(V*conj(I))不含1/2。样品耗散进入样品热节点,50Ω源/寄生/参考负载耗散导出外部环境,分别留账。', '采用稳态周期平均有功功率及工程一阶解调估计,未求解交流逐周期波形、电磁起停暂态或电场/极化储能。能量验证限于周期平均有功与热账,不宣称瞬态总电磁能量认证。', '明确选择宿主外部工程有限热容边界;温区、功率、热导由thermal.configure输入,未指定Novotherm/Quatro等原厂温控系统。温度超静态参考容差时测量失败,但现有显热仍继续交换。', '样品温度在宿主参考容差内时epsilon_s/epsilon_inf/tau/sigma_dc作为常系数近似,不宣称温度谱插值。样品热节点包含固定0.1J/K夹具/电极工程热容,非OEM参数。', '整片/定容样品几何确定体积,密度/Cp为宿主显式假设,载入/移出显热完整记账。开夹时样品脱离热台转与环境换热,未求解深度接触、压力或溶剂挥发。', '厂家误差强依赖频率/阻抗/校准和环境,不能把条件精度套全域;这里的增益/相位/分辨率/τ是输入假设,真实噪声和准确度认证not_run。', '主机有蓝色双行字符LCD,几何只保留静态外观/身份文字;动态LCD未实现,READOUTS为空不等于没有显示屏。', '所有session公开result/poll统一脱敏,包括内部evaluator桥接;选中静态参考来源只在evaluator provenance.read。共享Python与磁盘不等于OS级真值隔离。', '真实硬件、机器人装样、OEM夹具/温控校准、直流偏置、高压、安全联锁与电磁暂态not_run。'] for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k=='acquisition.start';caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.novocontrol_alphat.NovocontrolAlphatSession.invoke',invocation=f'session.invoke(instance_id="alphat_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='明确夹具/热边界、夹持、静态参考温域、频率/电压/校准网格由运行入口原子检查。',state_ids=['power.enabled','sample.present','clamp.position_m','thermal.configured','acquisition.phase'],enforced_by='runtime',check='NovocontrolAlphatRuntime.invoke guards before commit')],state_effects=[dict(state_id=s,timing='immediate',description_zh='命令实际即时状态变化') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='只输出可映射状态,实际模型求值由独立场景报告登记。',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='每个频点累计指定真实周期和通信时间后采样,所有频点完成或实际范围错误终止' if async_ else '原子命令;电热/运动/频扫驻留仅宿主step推进',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','parallel_plate_fixture','source','current_converter'],partial_failure_zh='取消/断电切断源并冻结已完成频点,未完成点不输出;已积耗散热和显热不回滚。范围错误完成当前频点时记不可用并停止。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('POWER_OFF','USER_CANCEL','CURRENT_CONVERTER_OVERFLOW','MEASUREMENT_RANGE') else 'none') for e in ERRORS],verification=[],limitations=limits,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('thermal.set_temperature','thermal.disable','sample.set_clamp','acquisition.start','power.set'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='宿主推进热过程、夹持或实际频扫') for s in SLOTS if s not in v['effects'] and s not in ('plant.configured','geometry.configured','thermal.configured','sample.present','power.enabled')] mechanism=dict(component_ids=['controller','current_converter','electrode_upper','electrode_lower','sample_disc','thermal_port'],state_ids=list(slots),meaning_zh='带50Ω源和夹具寄生的复介电相量网络,有限扫频时间、外部OSL校准、有限热容与有功热守恒',implementation='lumped',equations=[ 'epsilon*=epsilon_inf+(epsilon_s-epsilon_inf)/(1+j*omega*tau)-j*sigma_dc/(omega*eps0); Ysample=j*omega*C0*epsilon*,C0=eps0*pi*(D/2)^2/d. Static epsilon_s is source data; all dynamic parameters are explicit assumptions.', 'Yparallel=Ysample+Gparasitic+j*omega*Cparasitic; Zfixture=Rseries+j*omega*Lseries+1/Yparallel; I=Vs/(50ohm+Zfixture),Vfixture=I*Zfixture. External open/short/load changes the sample admittance branch only.', 'Measured RMS channels follow explicit complex gains and first-order demodulator response, with independently declared engineering quantization. Physical converter current>40mA returns unavailable, not clipped current.', 'OSL inverse Zcorrected=(a*Zmeasured+b)/(c*Zmeasured+1), c=-1/Zopen, a=Rload*(1-Zload/Zopen)/(Zload-Zshort),b=-a*Zshort; coefficients are computed solely from supplied external observed standards.', 'Z=V/I; epsilon=1/(Z*j*omega*C0); tan_delta=epsilon_loss/epsilon_real; sigma_real=omega*eps0*epsilon_loss and sigma_imag=omega*eps0*epsilon_real. Sample observation limits enforce C1e-15..10F and |Z|.01..2e14ohm.', 'Each point dwell=settling+max(cycles/f,1/10.5)s, rounded upward to nanosecond. A fractional-nanosecond residual retains normal60Hz host clock accuracy. Filter and circuit clocks never advance on read/invoke configuration.', 'Pgenerator=Re(Vs*conj(I)); Psource=|I|²*50; Pseries=|I|²*Rseries; Pshunt=|Vparallel|²*Gparasitic; Psample=|Vparallel|²*Re(Ysample). Pgenerator=Psource+Pseries+Pshunt+Psample+Preference with RMS convention.', 'Cb*dTb=Pcontroller-Gb*(Tb-Ts)-Ga*(Tb-Ta); Cs*dTs=Gb*(Tb-Ts)-Gopen*(Ts-Ta)+Psample. Closed fixture:Gb>0,Gopen=0;open:Gb=0,Gopen>0. External controller has explicit heating/cooling limits.', 'Matrix exponential propagates linear thermal/energy states; Radau solves the same equations if power saturation is possible. Complex demodulator state has exact exp(-dt/tau) propagation. Sample loading capacity-weights incoming sensible heat; removing exports actual sensible heat.', 'Electrical ledger is steady cycle-averaged active energy, excluding unmodeled turn-on/off electromagnetic stored energy and transients.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=limits) spec=importlib.util.spec_from_file_location('_alpha_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'dielectric_spectroscopy':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'geometry.configure':(GEOMETRY,GEOMETRY_EXAMPLE),'thermal.configure':(THERMAL,THERMAL_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE)}) for key,value in SLOTS.items():slots[key]['meaning_zh']=value['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'dielectric_spectroscopy':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494"""AGS-10kNXD / high-precision10kNcell / real5kNSCG / TRAPEZIUM X.One-dimensional tensile elastoplastic proxy with separate frame compliance,clip-extensometer observations, fixed-rate sampling/control and irreversibleplastic/fracture energy. No universal-test-mode or OEM accuracy certification."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npPROTOCOL_VERSION='1.0.0';SLUG='shimadzu_ags10knxd';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-144'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'mechanical_library.json'LOAD_CELL_MAX_N=10000.;FIXTURE_MAX_N=5000.;MIN_SPEED_M_S=.001e-3/60;MAX_SPEED_M_S=1000e-3/60;POSITION_RESOLUTION_M=1e-6;CONTROL_PERIOD_NS=10_000_000class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
def library():return {x['id']:x for x in json.loads(LIBRARY_PATH.read_text())['templates']}def quant(x,res):return float(round(x/res)*res)PLANT_EXAMPLE=dict(ambient_k=292.65,frame_stiffness_n_m=1e8,force_gain=1.002,force_offset_n=.02,force_response_tau_s=.002,force_resolution_n=.01,extensometer_gain=1.,extensometer_offset_m=0.,extensometer_resolution_m=1e-7,local_thermal_capacity_j_k=.01,sample_conductance_w_k=.1,plastic_heat_fraction=.9,fracture_heat_fraction=.5,grip_speed_m_s=.01,force_control_gain_m_per_n_s=5e-7,strain_control_gain_m_s=.01,accept_engineering=True)PLANT=obj(dict(ambient_k=number('K',278.15,313.15),frame_stiffness_n_m=number('N/m',1e7,1e12),force_gain=number('1',.01,100),force_offset_n=number('N',-100,100),force_response_tau_s=number('s',1e-6,10),force_resolution_n=number('N',1e-9,100),extensometer_gain=number('1',.01,100),extensometer_offset_m=number('m',-.001,.001),extensometer_resolution_m=number('m',1e-12,.001),local_thermal_capacity_j_k=number('J/K',1e-6,1e5),sample_conductance_w_k=number('W/K',1e-9,1e5),plastic_heat_fraction=number('1',0,1),fracture_heat_fraction=number('1',0,1),grip_speed_m_s=number('m/s',1e-6,.1),force_control_gain_m_per_n_s=number('m/(N*s)',1e-12,1),strain_control_gain_m_s=number('m/s',1e-9,1),accept_engineering=BOOL))FIXTURE_EXAMPLE=dict(rated_force_n=5000.,software_trapezium_x=True,extensometer_enabled=True,extensometer_gauge_m=.025,accept_engineering_extensometer=True)FIXTURE=obj(dict(rated_force_n={'type':'number','const':5000.,'enum':[5000.],'x-unit':'N'},software_trapezium_x=BOOL,extensometer_enabled=BOOL,extensometer_gauge_m=number('m',.001,.25),accept_engineering_extensometer=BOOL))SAMPLE_EXAMPLE=dict(reference_id='epfl_s355_j2m_hem320_web',gauge_length_m=.025,initial_area_m2=2e-6,volume_m3=1.1e-7,density_kg_m3=7850.,specific_heat_capacity_j_kg_k=470.,initial_temperature_k=292.65,temperature_tolerance_k=10.,host_elastic_modulus_pa=None,host_yield_strength_pa=None,hardening_modulus_pa=1e9,engineering_strain_at_break=.05,accept_bilinear_geometry_temperature_fracture_assumptions=True)SAMPLE=obj(dict(reference_id=TEXT,gauge_length_m=number('m',.001,.2),initial_area_m2=number('m^2',1e-10,1e-3),volume_m3=number('m^3',1e-12,.01),density_kg_m3=number('kg/m^3',1,5e4),specific_heat_capacity_j_kg_k=number('J/(kg*K)',1,1e5),initial_temperature_k=number('K',200,500),temperature_tolerance_k=number('K',0,100),host_elastic_modulus_pa=nullable(number('Pa',1e3,1e13)),host_yield_strength_pa=nullable(number('Pa',1,1e11)),hardening_modulus_pa=number('Pa',0,1e12),engineering_strain_at_break=number('1',1e-6,.5),accept_bilinear_geometry_temperature_fracture_assumptions=BOOL))METHOD_EXAMPLE=dict(mode='speed',speed_m_s=.0005,target_crosshead_m=.003,target_force_n=400.,target_strain=.01,sample_rate_hz=1000,duration_s=10.,force_stop_n=5000.,stop_on_break=True)METHOD=obj(dict(mode=enum(['speed','force','strain']),speed_m_s=number('m/s',MIN_SPEED_M_S,MAX_SPEED_M_S),target_crosshead_m=number('m',0,.3),target_force_n=number('N',0,10000),target_strain=number('1',0,.5),sample_rate_hz={'type':'integer','enum':[1,10,50,100,200,500,1000],'x-unit':'Hz'},duration_s=number('s',.001,3600),force_stop_n=number('N',1,10000),stop_on_break=BOOL))ROW=obj(dict(point_index={'type':'integer','x-unit':'1'},time_s=number('s'),kind=enum(['sample','fracture_pre','fracture_post']),force_n=nullable(number('N')),crosshead_m=number('m'),extensometer_extension_m=nullable(number('m')),broken=BOOL,quality=enum(['estimated','below_documented_accuracy_range','overload','temperature_invalid'])))ANALYSIS=obj(dict(rows=array(ROW,3),area_prior_m2=nullable(number('m^2',1e-12,1)),gauge_prior_m=nullable(number('m',1e-9,1)),frame_compliance_prior_m_n=nullable(number('m/N',0,1)),elastic_fit_min_strain=number('1',0,.5),elastic_fit_max_strain=number('1',0,.5)))ANALYSIS_OUTPUT=obj(dict(points=array(obj(dict(time_s=number('s'),stress_pa=nullable(number('Pa')),strain=nullable(number('1'))))),elastic_modulus_pa=nullable(number('Pa')),ultimate_observed_stress_pa=nullable(number('Pa')),maximum_observed_force_n=number('N'),observed_break_strain=nullable(number('1')),observed_break_extension_m=nullable(number('m')),evidence=TEXT))RESULT=obj(dict(operation_id=nullable(TEXT),phase=PHASE,mode=TEXT,elapsed_s=number('s'),rows=array(ROW),terminal_reason=nullable(TEXT),template_source=nullable(TEXT),evidence=TEXT))LEDGER_KEYS=['loaded_mass_kg','removed_mass_kg','mass_kg','mass_residual_kg','loaded_volume_m3','removed_volume_m3','volume_m3','volume_residual_m3','actuator_work_j','plastic_work_j','plastic_heat_j','plastic_defect_stored_j','frame_elastic_j','sample_elastic_j','hardening_stored_j','fracture_surface_j','fracture_heat_j','machine_damping_export_j','sensible_loaded_j','sensible_removed_j','internal_removed_j','sample_thermal_j','heat_export_j','energy_residual_j']LEDGER=obj({k:number('kg' if k.endswith('_kg') else 'm^3' if k.endswith('_m3') else 'J') for k in LEDGER_KEYS})CAPS={}def cap(k,s,o,example,component,meaning,visibility='agent',kind='device_command'):CAPS[k]=dict(input_schema=s,output_schema=o,example_arguments=example,component_ids=[component],function_zh=meaning,visibility=visibility,kind=kind,effects=[])for k,s,e,component in [('plant.configure',PLANT,PLANT_EXAMPLE,'crosshead'),('fixture.configure',FIXTURE,FIXTURE_EXAMPLE,'upper_grip'),('method.configure',METHOD,METHOD_EXAMPLE,'controller')]:cap(k,s,obj(dict(configured=BOOL)),e,component,'配置过程/夹具/软件或试验程序;不推进时间','evaluator' if k in ('plant.configure','fixture.configure') else 'agent','configuration')cap('sample.load',SAMPLE,obj(dict(present=BOOL)),SAMPLE_EXAMPLE,'specimen_lower','载入真实材料参考与显式均匀拉伸/断裂/热参数','evaluator')cap('sample.remove',obj({}),obj(dict(removed_mass_kg=number('kg'),removed_volume_m3=number('m^3'))),{},'specimen_lower','取出全部试样/碎片与塑性库存、当前显热','evaluator')cap('power.set',obj(dict(enabled=BOOL)),obj(dict(enabled=BOOL)),dict(enabled=True),'power_switch','启停控制器;停止驱动不清除塑性、断裂或储能')cap('grip.set_closed',obj(dict(which=enum(['upper','lower']),closed=BOOL)),obj(dict(target_opening_m=number('m'))),dict(which='upper',closed=True),'upper_jaw','手工SCG夹紧/松开有限运动代理,非夹压力实测','evaluator')CAPS['grip.set_closed']['component_ids'].append('lower_jaw')cap('crosshead.move_to',obj(dict(position_m=number('m',0,.3),speed_m_s=number('m/s',MIN_SPEED_M_S,MAX_SPEED_M_S))),obj(dict(target_m=number('m'))),dict(position_m=.001,speed_m_s=.0005),'crosshead','设置有限速横梁目标;带样会真实加载,含独立5kN夹具限值')cap('emergency.engage',obj({}),obj(dict(engaged=BOOL)),{},'emergency_stop','停止有限驱动并保留机械/热状态,不宣称硬件安全认证')cap('emergency.reset',obj({}),obj(dict(engaged=BOOL)),{},'emergency_stop','宿主手动释放急停;不自动继续试验','evaluator')cap('force.zero',obj({}),obj(dict(zero_n=number('N'))),{},'load_cell','卸载条件下以当前实际传感器观测置零')cap('force.calibrate',obj(dict(reference_force_n=number('N',20,10000))),obj(dict(gain=number('1'))),dict(reference_force_n=100.),'load_cell','由外部已知载荷与实际观测拟合增益,不读取隐藏gain')cap('acquisition.start',obj({}),obj(dict(operation_id=TEXT)),{},'controller','按独立采样/控制时钟运行有限拉伸,记录实际力��移与引伸计')cap('acquisition.stop',obj({}),obj(dict(phase=PHASE,elapsed_s=number('s'))),{},'controller','停止横梁与采样,保留塑性应变、破断和已产生热量')cap('acquisition.result',obj({}),RESULT,{},'controller','冻结完成记录,公开结果所有角色隐藏选中材料身份','agent','query')cap('analysis.tensile',ANALYSIS,ANALYSIS_OUTPUT,dict(rows=[],area_prior_m2=2e-6,gauge_prior_m=.025,frame_compliance_prior_m_n=None,elastic_fit_min_strain=.0002,elastic_fit_max_strain=.0015),'controller','由外部观测及独立面积/标距先验分析应力应变与模量','agent','analysis')cap('provenance.read',obj({}),obj(dict(current_sample=nullable(TEXT),operation_source=nullable(TEXT))),{},'controller','独立受限当前/记录来源','evaluator','query')cap('ledger.read',obj({}),LEDGER,{},'controller','受限质量体积、弹性/塑性/破断与热能账','evaluator','query')cap('sim.step',obj(dict(dt_s=number('s',0,86400))),obj(dict(time_s=number('s'))),dict(dt_s=.02),'controller','唯一宿主时钟','evaluator','simulation')UNSUPPORTED={'hardware.connect':'没有真实仪器驱动','robot.load':'没有机器人装样','measurement.compression':'本SCG平条一维拉伸子集不实现压缩','measurement.bending':'未配弯曲夹具','measurement.peel':'未配剥离夹具','thermal.set_temperature':'未选温控附件,样品仅被动换热和耗散发热','noise.empirical':'没有实测noise模型,±0.5%不是随机分布','accuracy.certification':'没有OEM/ISO/ASTM计量认证','analysis.strain_without_prior_or_extensometer':'横梁位移不能无条件替代试样应变'}for k,v in UNSUPPORTED.items():cap(k,obj({}),obj({}),{},'controller',v)SLOTS={}def slot(k,s,u,o,c,meaning,vis='agent'):SLOTS[k]=dict(schema=s,unit=u,origin=o,component=c,meaning=meaning,visibility=vis,write=None)slot('fixture.extensometer_enabled',BOOL,'1','setpoint','extensometer','已配置工程引伸计硬件存在标志,不随断电隐去')slot('clock.time_s',number('s'),'s','derived','controller','统一宿主时间,只由step推进')for k in ['plant.configured','fixture.configured','method.configured','sample.present','sample.broken','power.enabled','emergency.engaged']:slot(k,BOOL,'1','derived' if k=='sample.broken' else 'setpoint','controller','配置/存在/不可逆破断/启用状态,不等于全部硬件验证')for k in ['crosshead.position_m','crosshead.target_m']:slot(k,number('m'),'m','scene' if 'position' in k else 'setpoint','crosshead','横梁绝对参考增量,+Z拉伸;不是试样单独伸长')slot('crosshead.indicated_m',nullable(number('m')),'m','sensor','controller','横梁光编码器显示代理,1µm分辨,不声称±.01mm位置准确度已验证')slot('frame.deflection_m',number('m'),'m','scene','compliance_carriage','串联机架/夹具工程顺应位移F/K,upper夹持点位移=横梁−该值')for side in ['upper','lower']: slot('grip.'+side+'_opening_m',number('m'),'m','scene',side+'_jaw','单侧jaw开口增量,0夹紧/.006m打开;手工有限运动代理') slot('grip.target_'+side+'_opening_m',number('m'),'m','setpoint',side+'_jaw','夹具单侧开口目标,只在step运动')slot('sample.visual_extension_m',number('m'),'m','scene','specimen_lower','未断样品实体伸长;断后两片残余塑性总长度增量,非连续体有限元网格')slot('sample.fracture_gap_m',number('m'),'m','scene','specimen_upper','断后夹点分离扣除残余材料长度的裂口,断前0')slot('power.angle_rad',number('rad'),'rad','scene','power_switch','电源开关显示姿态代理')slot('emergency.position_m',number('m'),'m','scene','emergency_stop','急停手动闩锁显示位置,0或.004m,不冒安全认证')slot('force.indicated_n',nullable(number('N')),'N','sensor','load_cell','含工程传感器响应/量化/校准的拉力读数,20N以下不承诺厂家高精度')slot('extensometer.extension_m',nullable(number('m')),'m','sensor','extensometer','独立工程夹持引伸计观测伸长;未配则null,非横梁改名')slot('extensometer.strain',nullable(number('1')),'1','derived','extensometer','独立引伸计伸长除其明确配置标距')slot('thermal.sample_k',nullable(number('K')),'K','sensor','specimen_lower','试样和宿主局部节点被动温度,85kg整机不代入热容')for k in ['calibration.force_gain','calibration.force_zero_n']:slot(k,number('N' if k.endswith('_n') else '1'),'N' if k.endswith('_n') else '1','derived','load_cell','从当前外部观测与已知载荷获得的校正')slot('acquisition.phase',PHASE,'1','derived','controller','异步采集状态')slot('acquisition.elapsed_s',number('s'),'s','derived','controller','试验实际耗时')slot('acquisition.points',{'type':'integer','x-unit':'1'},'1','derived','controller','实际采样与明确破断事件行数')for k,u in [('truth.force_n','N'),('truth.plastic_strain','1'),('truth.total_strain','1'),('truth.mass_kg','kg'),('truth.sample_k','K')]:slot(k,number(u),u,'process_truth','specimen_lower','受限一维本构���程真值','evaluator')
# Exact constitutive / scene drive coordinates are host-only. Public strain# must come from the configured observable extensometer or independent priors.for _private_drive in ['frame.deflection_m','sample.visual_extension_m','sample.fracture_gap_m']: SLOTS[_private_drive]['visibility']='evaluator'
def analyze_tensile(rows,area_prior_m2,gauge_prior_m,frame_compliance_prior_m_n,elastic_fit_min_strain,elastic_fit_max_strain): if len(rows)<3 or any(x['force_n'] is None for x in rows) or elastic_fit_max_strain<=elastic_fit_min_strain:raise ActionRejected('INVALID_OBSERVATIONS') points=[];fit=[];break_e=None;break_x=None for row in rows: F=row['force_n'];stress=None if area_prior_m2 is None else F/area_prior_m2;extension=row['extensometer_extension_m'] if extension is None and frame_compliance_prior_m_n is not None and not row['broken']:extension=row['crosshead_m']-F*frame_compliance_prior_m_n strain=None if gauge_prior_m is None or extension is None else extension/gauge_prior_m points.append(dict(time_s=row['time_s'],stress_pa=stress,strain=strain)) if stress is not None and strain is not None and elastic_fit_min_strain<=strain<=elastic_fit_max_strain and not row['broken']:fit.append((strain,stress)) if row['kind']=='fracture_pre':break_e=strain;break_x=extension modulus=None if len(fit)>=3 and np.ptp(np.array(fit)[:,0])>1e-12:modulus=float(np.polyfit(np.array(fit)[:,0],np.array(fit)[:,1],1)[0]) return dict(points=points,elastic_modulus_pa=modulus,ultimate_observed_stress_pa=None if area_prior_m2 is None else max(x['force_n'] for x in rows)/area_prior_m2,maximum_observed_force_n=max(x['force_n'] for x in rows),observed_break_strain=break_e,observed_break_extension_m=break_x,evidence='external_force_and_extensometer_or_explicit_frame_compliance_correction; independent_area_gauge_priors; maximum_observed_stress_is_not_certified_material_UTS; fracture_pre_is_event_observation_not_hidden_breakstrain')
class ShimadzuAgs10knxdRuntime: def __init__(self,instance_id='ags_01'): self.instance_id=instance_id;self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0;self.power=False;self.emergency=False;self.plant=None;self.fixture=None;self.method=None;self.sample=None;self.reference=None;self.source=None self.axes={k:dict(position=v,target=v,start=v,start_ns=0,arrival_ns=0) for k,v in [('crosshead',0.),('upper',.006),('lower',.006)]};self.drive_speed=MIN_SPEED_M_S;self.force=0.;self.plastic=0.;self.broken=False;self.defect_stored=0.;self.fracture_surface=0.;self.temperature=292.65;self.sensor_force=0.;self.force_gain=1.;self.force_zero=0.;self.last_stop_reason=None self.phase='idle';self.operation_id=None;self.mode='none';self.elapsed=0.;self.rows=[];self.terminal_reason=None;self._counter=0;self._operation_source=None;self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={};self._sample_ns=None;self._control_ns=None self.book={k:0. for k in ['loaded_mass_kg','removed_mass_kg','loaded_volume_m3','removed_volume_m3','actuator_work_j','plastic_work_j','plastic_heat_j','fracture_heat_j','machine_damping_export_j','sensible_loaded_j','sensible_removed_j','internal_removed_j','heat_export_j']} @property def time_s(self):return self.time_ns/1e9 def register_principal(self,name,visibility): if not isinstance(name,str) or not name or visibility not in ('agent','evaluator','debug') or name in self._principals:raise ActionRejected('INVALID_ARGUMENT') self._principals[name]=visibility def session(self,name): if name not in self._principals:raise ActionRejected('ACCESS_DENIED') return ShimadzuAgs10knxdSession(self,name) def _pos(self,k):return self.axes[k]['position'] def _moving(self,k):return self.time_ns<self.axes[k]['arrival_ns'] def _target(self,k,value,speed=None): v=speed if k=='crosshead' else self.plant['grip_speed_m_s'];a=self.axes[k];a.update(start=a['position'],target=float(value),start_ns=self.time_ns,arrival_ns=self.time_ns+int(math.ceil(abs(value-a['position'])/v*1e9))) def _rate(self): a=self.axes['crosshead'];return (a['target']-a['start'])/((a['arrival_ns']-a['start_ns'])/1e9) if self._moving('crosshead') else 0. def _positions(self): for a in self.axes.values():a['position']=a['target'] if self.time_ns>=a['arrival_ns'] else a['start']+(a['target']-a['start'])*(self.time_ns-a['start_ns'])/(a['arrival_ns']-a['start_ns']) def _held(self):return self.sample is not None and all(self._pos(k)<1e-12 and not self._moving(k) for k in ['upper','lower']) def _mass(self):return self.sample['volume_m3']*self.sample['density_kg_m3'] if self.sample else 0. def _capacity(self):return self.plant['local_thermal_capacity_j_k']+(self._mass()*self.sample['specific_heat_capacity_j_kg_k'] if self.sample else 0.) def _free_extension(self):return self.sample['gauge_length_m']*self.plastic if self.sample else 0. def _strain(self):return self.plastic+(self.force/self.sample['initial_area_m2']/self.E if self.sample and not self.broken else 0.) def _compliance(self):return self.sample['gauge_length_m']/(self.sample['initial_area_m2']*self.E)+1/self.plant['frame_stiffness_n_m'] def _solve(self,x): if not self._held() or self.broken:return 0.,self.plastic L=self.sample['gauge_length_m'];A=self.sample['initial_area_m2'];H=self.sample['hardening_modulus_pa'];C=self._compliance();trial=max(0.,(x-L*self.plastic)/C);yield_force=A*(self.Y+H*self.plastic) plastic=self.plastic if trial<=yield_force else max(self.plastic,(x-C*A*self.Y)/(L+C*A*H));return max(0.,(x-L*plastic)/C),plastic def _stored(self,F=None,plastic=None): F=self.force if F is None else F;plastic=self.plastic if plastic is None else plastic frame=.5*F*F/self.plant['frame_stiffness_n_m'] if self.plant else 0.;elastic=hardening=0. if self.sample: V=self.sample['initial_area_m2']*self.sample['gauge_length_m'];elastic=.5*(F/self.sample['initial_area_m2'])**2/self.E*V;hardening=.5*self.sample['hardening_modulus_pa']*plastic*plastic*V return frame,elastic,hardening def _temperature_valid(self): if not self.sample:return True nominal=self.reference.get('reference_temperature_K');domain=self.reference.get('valid_temperature_range_K');tol=self.sample['temperature_tolerance_k'] if nominal is not None and abs(self.temperature-nominal)>tol+1e-9:return False if domain and domain[1]-domain[0]>1e-9 and not domain[0]-1e-9<=self.temperature<=domain[1]+1e-9:return False return abs(self.temperature-self.sample['initial_temperature_k'])<=tol+1e-9 def _observed_force(self): if not self.power:return None result=quant((self.sensor_force-self.force_zero)*self.force_gain,self.plant['force_resolution_n']) return result if abs(result)<=LOAD_CELL_MAX_N and self._temperature_valid() else None def _observed_extension(self): if not self.power or not self.fixture or not self.fixture['extensometer_enabled'] or not self.sample or self.broken:return None p=self.plant;return quant(self._strain()*self.fixture['extensometer_gauge_m']*p['extensometer_gain']+p['extensometer_offset_m'],p['extensometer_resolution_m']) def ledger(self): d=copy.deepcopy(self.book);mass=self._mass();volume=self.sample['volume_m3'] if self.sample else 0.;frame,elastic,hardening=self._stored();thermal=self._capacity()*(self.temperature-self.plant['ambient_k']) if self.plant else 0.;d.update(mass_kg=mass,mass_residual_kg=d['loaded_mass_kg']-d['removed_mass_kg']-mass,volume_m3=volume,volume_residual_m3=d['loaded_volume_m3']-d['removed_volume_m3']-volume,plastic_defect_stored_j=self.defect_stored,frame_elastic_j=frame,sample_elastic_j=elastic,hardening_stored_j=hardening,fracture_surface_j=self.fracture_surface,sample_thermal_j=thermal) d['energy_residual_j']=d['actuator_work_j']+d['sensible_loaded_j']-d['sensible_removed_j']-d['internal_removed_j']-d['heat_export_j']-d['machine_damping_export_j']-sum(d[k] for k in ['plastic_defect_stored_j','frame_elastic_j','sample_elastic_j','hardening_stored_j','fracture_surface_j','sample_thermal_j']);return d def read(self,visibility='agent'): extension=self._free_extension() if self.broken else self._strain()*self.sample['gauge_length_m'] if self.sample else 0.;frame=self.force/self.plant['frame_stiffness_n_m'] if self.plant else 0.;gap=max(0.,self._pos('crosshead')-extension) if self.sample and self.broken else 0.;ext=self._observed_extension() d={'clock.time_s':self.time_s,'plant.configured':self.plant is not None,'fixture.configured':self.fixture is not None,'fixture.extensometer_enabled':bool(self.fixture and self.fixture['extensometer_enabled']),'method.configured':self.method is not None,'sample.present':self.sample is not None,'sample.broken':self.broken,'power.enabled':self.power,'emergency.engaged':self.emergency,'crosshead.position_m':self._pos('crosshead'),'crosshead.target_m':self.axes['crosshead']['target'],'crosshead.indicated_m':quant(self._pos('crosshead'),POSITION_RESOLUTION_M) if self.power else None,'frame.deflection_m':frame,'sample.visual_extension_m':extension,'sample.fracture_gap_m':gap,'power.angle_rad':.28 if self.power else 0.,'emergency.position_m':.004 if self.emergency else 0.,'force.indicated_n':self._observed_force(),'extensometer.extension_m':ext,'extensometer.strain':None if ext is None else ext/self.fixture['extensometer_gauge_m'],'thermal.sample_k':self.temperature if self.plant else None,'calibration.force_gain':self.force_gain,'calibration.force_zero_n':self.force_zero,'acquisition.phase':self.phase,'acquisition.elapsed_s':self.elapsed,'acquisition.points':len(self.rows),'truth.force_n':self.force,'truth.plastic_strain':self.plastic,'truth.total_strain':self._strain(),'truth.mass_kg':self._mass(),'truth.sample_k':self.temperature} for side in ['upper','lower']:d['grip.'+side+'_opening_m']=self._pos(side);d['grip.target_'+side+'_opening_m']=self.axes[side]['target'] return {k:copy.deepcopy(v) for k,v in d.items() if visibility!='agent' or SLOTS[k]['visibility']=='agent'} def _propagate(self,ns): dt=ns/1e9 if dt<=0 or not self.plant:return x1=self._pos('crosshead')+self._rate()*dt;F0=self.force;p0=self.plastic;F1,p1=self._solve(x1);before=sum(self._stored(F0,p0));after=sum(self._stored(F1,p1));plasticwork=0. if self.sample:plasticwork=self.Y*(p1-p0)*self.sample['initial_area_m2']*self.sample['gauge_length_m'] heat=plasticwork*self.plant['plastic_heat_fraction'];self.book['actuator_work_j']+=after-before+plasticwork;self.book['plastic_work_j']+=plasticwork;self.book['plastic_heat_j']+=heat;self.defect_stored+=plasticwork-heat;self.force=F1;self.plastic=p1 C=self._capacity();G=self.plant['sample_conductance_w_k'];u0=C*(self.temperature-self.plant['ambient_k']);decay=math.exp(-G*dt/C);u1=u0*decay+(heat/dt)*C/G*(-math.expm1(-G*dt/C));self.temperature=self.plant['ambient_k']+u1/C;self.book['heat_export_j']+=heat-(u1-u0) gain=self.plant['force_gain'] if self.power else 0.;f0=gain*F0+(self.plant['force_offset_n'] if self.power else 0.);slope=gain*(F1-F0)/dt;tau=self.plant['force_response_tau_s'];self.sensor_force=f0+slope*(dt-tau)+(self.sensor_force-f0+slope*tau)*math.exp(-dt/tau) def _fracture_position(self): ep=self.sample['engineering_strain_at_break'];A=self.sample['initial_area_m2'];L=self.sample['gauge_length_m'];H=self.sample['hardening_modulus_pa'];sigma=self.E*(ep-self.plastic) if sigma>self.Y+H*self.plastic:sigma=self.E*(self.Y+H*ep)/(self.E+H) return L*ep+A*max(0,sigma)/self.plant['frame_stiffness_n_m'] def _force_position(self,load): L=self.sample['gauge_length_m'];A=self.sample['initial_area_m2'];H=self.sample['hardening_modulus_pa'];plastic=self.plastic if load>A*(self.Y+H*plastic): if H<=0:return math.inf plastic=(load/A-self.Y)/H return self._compliance()*load+L*plastic def _next_material_event(self): rate=self._rate();x=self._pos('crosshead') if rate<=0 or not self._held() or self.broken:return None A=self.sample['initial_area_m2'];yield_x=self._compliance()*A*(self.Y+self.sample['hardening_modulus_pa']*self.plastic)+self._free_extension();limit=min(FIXTURE_MAX_N,self.method['force_stop_n'] if self.phase=='running' else FIXTURE_MAX_N);positions=[(self._fracture_position(),'fracture'),(self._force_position(limit),'force_limit')] if yield_x>x+1e-12:positions.append((yield_x,'yield')) candidates=[] for target,kind in positions: if math.isfinite(target) and target>=x-1e-12:candidates.append((self.time_ns+max(1,int(math.ceil((target-x)/rate*1e9-1e-7))),kind)) return min(candidates) if candidates else None def _record(self,kind='sample'): F=self._observed_force();quality='estimated' if not self._temperature_valid():quality='temperature_invalid' elif F is None:quality='overload' elif abs(F)<20:quality='below_documented_accuracy_range' self.rows.append(dict(point_index=len(self.rows),time_s=self.time_s,kind=kind,force_n=F,crosshead_m=quant(self._pos('crosshead'),POSITION_RESOLUTION_M),extensometer_extension_m=self._observed_extension(),broken=self.broken,quality=quality)) return F is not None def _break(self): if self.broken:return valid_pre=self._record('fracture_pre') if self.phase=='running' else True frame,elastic,_=self._stored();heat=elastic*self.plant['fracture_heat_fraction'];self.fracture_surface+=elastic-heat;self.book['fracture_heat_j']+=heat;self.book['machine_damping_export_j']+=frame;self.temperature+=heat/self._capacity();self.force=0.;self.broken=True if self.phase=='running': valid_post=self._record('fracture_post') if not valid_pre or not valid_post:self._finish('failed','REFERENCE_TEMPERATURE_RANGE' if not self._temperature_valid() else 'LOAD_CELL_OVERFLOW') elif self.method['stop_on_break'] or self.mode!='speed':self._finish('succeeded','fracture') def _stop_drive(self):self._target('crosshead',self._pos('crosshead'),MIN_SPEED_M_S) def _finish(self,phase,reason): self._stop_drive();self.phase=phase;self.terminal_reason=reason;self.last_stop_reason=reason;self._sample_ns=self._control_ns=None if self.operation_id:self.records[self.operation_id]=dict(operation_id=self.operation_id,phase=phase,mode=self.mode,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),terminal_reason=reason,template_source=self._operation_source,evidence='synthetic_forward_model; literature_E_yield_reference_and_explicit_bilinear_hardening_fracture_geometry_thermal_assumptions; actual_external_observations') def _result(self): if self.phase!='running' and self.operation_id in self.records:return copy.deepcopy(self.records[self.operation_id]) return dict(operation_id=self.operation_id,phase=self.phase,mode=self.mode,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),terminal_reason=self.terminal_reason,template_source=self._operation_source,evidence='synthetic_forward_model; actual_time_samples_and_explicit_fracture_events; not_original_material_test') def _control(self): if self.mode=='speed':return if self.mode=='force': observed=self._observed_force() if observed is None:self._finish('failed','REFERENCE_TEMPERATURE_RANGE' if not self._temperature_valid() else 'LOAD_CELL_OVERFLOW');return error=self.method['target_force_n']-observed;v=self.plant['force_control_gain_m_per_n_s']*error else: ext=self._observed_extension() if ext is None:self._finish('failed','EXTENSOMETER_UNAVAILABLE');return error=self.method['target_strain']-ext/self.fixture['extensometer_gauge_m'];v=self.plant['strain_control_gain_m_s']*error speed=min(abs(v),self.method['speed_m_s']);target=self.method['target_crosshead_m'] if v>0 else self._free_extension() if speed<MIN_SPEED_M_S:self._stop_drive() else:self._target('crosshead',target,speed) def invoke(self,capability_id,**arguments): if capability_id not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability_id]['input_schema'],arguments);k=capability_id;a=copy.deepcopy(arguments) if k in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if k=='acquisition.result':return self._result() if k=='provenance.read':return dict(current_sample=self.source,operation_source=self._operation_source) if k=='ledger.read':return self.ledger() if k=='analysis.tensile':return analyze_tensile(**a) if k=='sim.step':self.step(a['dt_s']);return dict(time_s=self.time_s) if self.phase=='running' and k not in ('acquisition.stop','emergency.engage','power.set'):raise ActionRejected('BUSY') if k=='plant.configure': if self.plant is not None or self.sample or self.power:raise ActionRejected('PLANT_ALREADY_CONFIGURED') if not a['accept_engineering']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') self.plant=a;self.temperature=a['ambient_k'];result=dict(configured=True) elif k=='fixture.configure': if self.sample or any(self._moving(x) for x in self.axes):raise ActionRejected('SAMPLE_PRESENT_OR_MOVING') if a['extensometer_enabled'] and not a['accept_engineering_extensometer']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') self.fixture=a;self.method=None;result=dict(configured=True) elif k=='method.configure': if not self.fixture:raise ActionRejected('FIXTURE_REQUIRED') if a['mode']!='speed' and a['sample_rate_hz']>100:raise ActionRejected('AUTOMATIC_CONTROL_MAX_100HZ') if not self.fixture['software_trapezium_x'] and (a['sample_rate_hz']>10 or a['mode']!='speed'):raise ActionRejected('SOFTWARE_OPTION_REQUIRED') if a['mode']=='strain' and not self.fixture['extensometer_enabled']:raise ActionRejected('EXTENSOMETER_REQUIRED') if a['force_stop_n']>FIXTURE_MAX_N or a['target_force_n']>FIXTURE_MAX_N:raise ActionRejected('FIXTURE_FORCE_LIMIT') self.method=a;result=dict(configured=True) elif k=='sample.load': if not self.plant or not self.fixture:raise ActionRejected('CONFIGURATION_REQUIRED') if self.sample:raise ActionRejected('SAMPLE_PRESENT') if any(self._moving(x) for x in self.axes) or self._pos('crosshead')>1e-12 or any(self._pos(x)<.006-1e-12 for x in ['upper','lower']):raise ActionRejected('LOADING_GEOMETRY') if not a['accept_bilinear_geometry_temperature_fracture_assumptions']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') ref=library().get(a['reference_id']) if ref is None:raise ActionRejected('UNKNOWN_REFERENCE') E=a['host_elastic_modulus_pa'] if a['host_elastic_modulus_pa'] is not None else ref.get('elastic_modulus_Pa');Y=a['host_yield_strength_pa'] if a['host_yield_strength_pa'] is not None else ref.get('yield_strength_Pa') if E is None or Y is None or E<=0 or Y<=0:raise ActionRejected('MISSING_CONSTITUTIVE_PRIOR') if a['volume_m3']<a['gauge_length_m']*a['initial_area_m2']:raise ActionRejected('VOLUME_BELOW_GAUGE') if self.fixture['extensometer_enabled'] and self.fixture['extensometer_gauge_m']>a['gauge_length_m']+1e-12:raise ActionRejected('EXTENSOMETER_GAUGE_OUTSIDE_SAMPLE') T=a['initial_temperature_k'];domain=ref.get('valid_temperature_range_K');nominal=ref.get('reference_temperature_K');tol=a['temperature_tolerance_k'] if nominal is not None and abs(T-nominal)>tol+1e-9 or domain and domain[1]-domain[0]>1e-9 and not domain[0]<=T<=domain[1]:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') incoming=a['volume_m3']*a['density_kg_m3']*a['specific_heat_capacity_j_kg_k']*(T-self.plant['ambient_k']);old=self._capacity()*(self.temperature-self.plant['ambient_k']);self.sample=a;self.reference=ref;self.E=float(E);self.Y=float(Y);self.source=json.dumps(dict(reference_id=a['reference_id'],source=ref.get('source'),evidence=ref.get('evidence')),sort_keys=True);self.plastic=0.;self.force=0.;self.broken=False;self.defect_stored=0.;self.fracture_surface=0.;self.temperature=self.plant['ambient_k']+(old+incoming)/self._capacity();self.book['loaded_mass_kg']+=self._mass();self.book['loaded_volume_m3']+=a['volume_m3'];self.book['sensible_loaded_j']+=incoming;result=dict(present=True) elif k=='sample.remove': if not self.sample:raise ActionRejected('NO_SAMPLE') if any(self._moving(x) for x in self.axes) or any(self._pos(x)<.006-1e-12 for x in ['upper','lower']) or abs(self.force)>1e-6:raise ActionRejected('UNLOAD_REQUIRED') mass=self._mass();volume=self.sample['volume_m3'];self.book['removed_mass_kg']+=mass;self.book['removed_volume_m3']+=volume;self.book['sensible_removed_j']+=mass*self.sample['specific_heat_capacity_j_kg_k']*(self.temperature-self.plant['ambient_k']);self.book['internal_removed_j']+=sum(self._stored())+self.defect_stored+self.fracture_surface;self.sample=self.reference=self.source=None;self.plastic=0.;self.broken=False;self.force=0.;self.defect_stored=self.fracture_surface=0.;result=dict(removed_mass_kg=mass,removed_volume_m3=volume) elif k=='power.set': if not self.plant:raise ActionRejected('PLANT_REQUIRED') if not a['enabled']: if self.phase=='running':self._finish('cancelled','POWER_OFF') for axis in self.axes:self._target(axis,self._pos(axis),MIN_SPEED_M_S if axis=='crosshead' else None) self.power=a['enabled'];result=dict(enabled=self.power) elif k=='grip.set_closed': if not self.plant:raise ActionRejected('PLANT_REQUIRED') if self._moving('crosshead') or abs(self.force)>1e-6:raise ActionRejected('UNLOAD_REQUIRED') if self.sample and a['closed'] and abs(self._pos('crosshead')-self._free_extension())>1e-10:raise ActionRejected('GRIP_PRESTRAIN_UNSUPPORTED') target=0. if a['closed'] else .006;self._target(a['which'],target);result=dict(target_opening_m=target) elif k=='crosshead.move_to': if not self.power:raise ActionRejected('POWER_OFF') if self.emergency:raise ActionRejected('EMERGENCY_ENGAGED') if self.sample and not self._held():raise ActionRejected('GRIPS_NOT_CLOSED') if self.sample and a['position_m']<self._free_extension()-1e-12:raise ActionRejected('COMPRESSION_OR_SLACK_UNSUPPORTED') self._target('crosshead',a['position_m'],a['speed_m_s']);result=dict(target_m=a['position_m']) elif k=='emergency.engage': if self.phase=='running':self._finish('cancelled','EMERGENCY_STOP') if self.plant: for axis in self.axes:self._target(axis,self._pos(axis),MIN_SPEED_M_S if axis=='crosshead' else None) self.emergency=True;result=dict(engaged=True) elif k=='emergency.reset':self.emergency=False;result=dict(engaged=False) elif k=='force.zero': if not self.power:raise ActionRejected('POWER_OFF') if abs(self.force)>1e-6 or any(self._moving(x) for x in self.axes):raise ActionRejected('UNLOAD_REQUIRED') self.force_zero=self.sensor_force;result=dict(zero_n=self.force_zero) elif k=='force.calibrate': if not self.power:raise ActionRejected('POWER_OFF') if any(self._moving(x) for x in self.axes):raise ActionRejected('MOVING') if self.sample and a['reference_force_n']>FIXTURE_MAX_N:raise ActionRejected('FIXTURE_FORCE_LIMIT') observation=self.sensor_force-self.force_zero if observation<=0:raise ActionRejected('ZERO_CALIBRATION_SIGNAL') gain=a['reference_force_n']/observation if not math.isfinite(gain) or not .001<=gain<=1000:raise ActionRejected('INVALID_CALIBRATION') self.force_gain=gain;result=dict(gain=gain) elif k=='acquisition.start': if not self.power:raise ActionRejected('POWER_OFF') if self.emergency:raise ActionRejected('EMERGENCY_ENGAGED') if not self.method or not self.fixture or not self.plant:raise ActionRejected('CONFIGURATION_REQUIRED') if not self.sample:raise ActionRejected('NO_SAMPLE') if self.broken:raise ActionRejected('SAMPLE_BROKEN') if not self._held():raise ActionRejected('GRIPS_NOT_CLOSED') if any(self._moving(x) for x in self.axes):raise ActionRejected('MOVING') if not self._temperature_valid():raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if self.force>=self.method['force_stop_n']:raise ActionRejected('METHOD_FORCE_STOP') if self._observed_force() is None:raise ActionRejected('LOAD_CELL_OVERFLOW') if self.method['target_crosshead_m']<self._free_extension()-1e-12:raise ActionRejected('COMPRESSION_OR_SLACK_UNSUPPORTED') self._counter+=1;self.operation_id=f'{self.instance_id}:test:{self._counter}';self.phase='running';self.mode=self.method['mode'];self.elapsed=0.;self.rows=[];self.terminal_reason=None;self._operation_source=self.source;self._start_ns=self.time_ns;self._end_ns=self.time_ns+round(self.method['duration_s']*1e9);self._period_ns=1_000_000_000//self.method['sample_rate_hz'];self._sample_ns=self.time_ns+self._period_ns;self._control_ns=self.time_ns+CONTROL_PERIOD_NS if self.mode!='speed' else None self._record() if self.mode=='speed':self._target('crosshead',self.method['target_crosshead_m'],self.method['speed_m_s']) else:self._control() result=dict(operation_id=self.operation_id) elif k=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled','USER_CANCEL');result=dict(phase=self.phase,elapsed_s=self.elapsed) else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(result) def step(self,dt_s): validate(number('s',0,86400),dt_s) raw=float(dt_s)*1e9+self._clock_remainder_ns;nanos=round(raw);self._clock_remainder_ns=raw-nanos if not nanos:return end=self.time_ns+nanos while self.time_ns<end: candidates=[end]+[a['arrival_ns'] for a in self.axes.values() if a['arrival_ns']>self.time_ns];event=self._next_material_event() if event:candidates.append(event[0]) if self.phase=='running':candidates.extend(x for x in [self._sample_ns,self._control_ns,self._end_ns] if x is not None and x>self.time_ns) nxt=min(candidates);self._propagate(nxt-self.time_ns);self.time_ns=nxt;self._positions() if self.phase=='running':self.elapsed=(self.time_ns-self._start_ns)/1e9 if event and event[0]==self.time_ns: if event[1]=='fracture':self._break() elif event[1]=='force_limit': self.last_stop_reason='FIXTURE_FORCE_LIMIT' if self.force>=FIXTURE_MAX_N-1e-4 else 'METHOD_FORCE_STOP' if self.phase=='running':self._record();self._finish('failed',self.last_stop_reason) else:self._stop_drive() if self.phase=='running' and self._sample_ns==self.time_ns: valid=self._record();self._sample_ns+=self._period_ns if not valid:self._finish('failed','REFERENCE_TEMPERATURE_RANGE' if not self._temperature_valid() else 'LOAD_CELL_OVERFLOW') if self.phase=='running' and self._control_ns==self.time_ns:self._control();self._control_ns=self.time_ns+CONTROL_PERIOD_NS if self.phase=='running' else None if self.phase=='running' and (self.time_ns>=self._end_ns or self.mode=='speed' and not self._moving('crosshead')): valid=self._record() if not self.rows or self.rows[-1]['time_s']!=self.time_s else self.rows[-1]['force_n'] is not None if not valid:self._finish('failed','REFERENCE_TEMPERATURE_RANGE' if not self._temperature_valid() else 'LOAD_CELL_OVERFLOW') else:self._finish('succeeded','duration_limit' if self.time_ns>=self._end_ns else 'target_reached') self.revision+=1
class ShimadzuAgs10knxdSession: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_shimadzu_ags10knxd_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'synthetic_forward_model; actual_force_crosshead_extensometer_observations; literature_reference_and_explicit_bilinear_geometry_thermal_fracture_assumptions; selected record restricted' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id in ('acquisition.start',) else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
for i,strain in enumerate([.0002,.0005,.001]): CAPS['analysis.tensile']['example_arguments']['rows'].append(dict(point_index=i,time_s=i*.1,kind='sample',force_n=2e11*strain*2e-6,crosshead_m=strain*.025+(2e11*strain*2e-6)/1e8,extensometer_extension_m=strain*.025,broken=False,quality='estimated'))EFFECTS={ 'plant.configure':['plant.configured','thermal.sample_k','truth.sample_k'], 'fixture.configure':['fixture.configured','fixture.extensometer_enabled','method.configured'], 'method.configure':['method.configured'], 'sample.load':['sample.present','sample.broken','thermal.sample_k','truth.sample_k','truth.mass_kg','extensometer.extension_m','extensometer.strain'], 'sample.remove':['sample.present','sample.broken','truth.mass_kg','truth.plastic_strain','truth.total_strain','sample.visual_extension_m','sample.fracture_gap_m','extensometer.extension_m','extensometer.strain'], 'power.set':['power.enabled','power.angle_rad','force.indicated_n','crosshead.indicated_m','extensometer.extension_m','extensometer.strain','crosshead.target_m','grip.target_upper_opening_m','grip.target_lower_opening_m','acquisition.phase'], 'grip.set_closed':['grip.target_upper_opening_m','grip.target_lower_opening_m'], 'crosshead.move_to':['crosshead.target_m'], 'emergency.engage':['emergency.engaged','emergency.position_m','crosshead.target_m','grip.target_upper_opening_m','grip.target_lower_opening_m','acquisition.phase'], 'emergency.reset':['emergency.engaged','emergency.position_m'], 'force.zero':['calibration.force_zero_n','force.indicated_n'], 'force.calibrate':['calibration.force_gain','force.indicated_n'], 'acquisition.start':['acquisition.phase','acquisition.elapsed_s','acquisition.points','crosshead.target_m'], 'acquisition.stop':['acquisition.phase','crosshead.target_m'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'USER_CANCEL','EMERGENCY_STOP','LOAD_CELL_OVERFLOW','METHOD_FORCE_STOP'})LIMITATIONS=[ '配置AGS-10kNXD高精度10kN传感器、真实SCG5kN手动拉伸夹具、TRAPEZIUM X软件;5000N夹具限值独立于10000N传感器量程,不实现弯曲/剥离/压缩和温控附件。', '试验速度0.001..1000mm/min;最大1500mm/min回程不是本试验速度范围。1µm是位移显示分辨,不是定位准确度;±0.5% indicated仅20..10000N厂家条件,不自动变模拟噪声或已测精度。', '有选定TRAPEZIUM软件时速度模式最多1000Hz真实采样;厂家自动force/stress或strain控制10ms,因此力/应变控制最多100Hz,工程反馈也严格每10ms更新。无软件选项仅保守10Hz速度模式,不声称OEM所有无软件模式。', '材料库真实金属processed true/log曲线及E/0.2%yield和独立聚合物汇总标量是参考,不是本机器原生输出。真实E/Y驱动显式一维双线性代理;硬化H、工程断裂ε、温域常数近似、尺寸迁移和热参数须宿主接受。真实局部断口true strain不冒充engineering break elongation,截断曲线末点不是UTS或断裂。', '均匀有效标距采用engineering strain、固定initial area的小变形一维代理,不解颈缩、面积演变、局部损伤或全场应变;源true-stress标量迁移到该代理是工程假设。rate-independent plasticity不是真实全速率材料响应。', '横梁q=L*(elastic_strain+plastic_strain)+F/K;K包含机架/夹具串联顺应,不能把q/L直接当试样应变。工程夹持引伸计独立输出标距伸长,可显式不配;面积和标距均需独立先验才分析stress/strain。', 'H使用储能硬化变量:Uhard=.5*H*ep²*A*L;不可逆plasticwork=Y*d(ep)*A*L,β变热其余保留缺陷能。显式断裂阈值释放sampleelastic至热/新表面,frameelastic导出至机架阻尼;残余塑性及硬化/缺陷能随碎片保留。', '准静态一维力平衡不解横梁惯性或真实破断应力波。理想瞬时断裂时F物理突降,传感器仍有一阶响应;断裂pre/post是额外明确事件记录,不能冒充1000Hz时间网格中的额外独立采样。', '被动热节点=宿主输入完整样品质量*Cp+局部接触热容,不使用85kg整机质量。塑性只对有效AL积分,完整体积/密度是独立先验并包含未变形tabs;视觉tabs形状不作为精确体积计量。没有主动温控器。', '取消/急停/断电停止位移并按自锁丝杆假设保留静载弹性能,之后仍被动换热;不会重置塑性或断裂。带样不允许横梁进入低于残余自由长度的压缩/松弛区域,开夹须F≈0。夹具动作是有限时间手工代理,不声称真实电动SCG。', '校准从当前实际传感器观测和外部已知力先验求zero/gain;不存在未接加载标准的自动已知真值,外部力先验没有证书即非计量认证。仅输出校准参数,不声称闭环准确度达标。', '固定3D示例自由标距25mm、2mm×1mm,两个15mm夹持tabs。过程可配置其它尺寸但当前视觉仍是固定示例,不声称自动匹配任意试样。sample.present=false须隐藏试样,卸样后q可非零。', '所有普通Session acquisition.result/poll跨角色��一隐藏选中材料身份,独立provenance.read仅evaluator;共享磁盘/Python不是操作系统隔离。实机驱动、机器人、经验噪声与OEM/ASTM/ISO认证均not_run。']
def export_shimadzu_ags10knxd_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI; 10kN high-precision load cell / 5kN SCG tensile fixture / configured software and engineering extensometer.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'ShimadzuAgs10knxdSession.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Pure read; sampling at configured fixed time grid with separately labelled fracture event observations.'),source_ids=['simulation_assumption']) for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k=='acquisition.start';caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.shimadzu_ags10knxd.ShimadzuAgs10knxdSession.invoke',invocation=f'session.invoke(instance_id="ags_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='入口原子核对夹具/软件、载荷、夹持和独立材料/热/断裂先验;采样与控制必须显式step。',state_ids=['power.enabled','sample.present','fixture.configured','emergency.engaged','acquisition.phase'],enforced_by='runtime',check='ShimadzuAgs10knxdRuntime.invoke')],state_effects=[dict(state_id=s,timing='on_step' if k=='sim.step' else 'immediate',description_zh='声明设置或观测变化,真实驱动/热/传感器过程由step推进') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='运行层输出绑定状态,实际几何、双片变形和读数联动由独立scene验证。',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='实际有限位移/时限/明确破断条件完成;力/应变控制为限时反馈,完成不等于误差为零' if async_ else '原子命令,step为唯一物理时钟',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','crosshead','tensile_fixture','load_cell','extensometer'],partial_failure_zh='保留已采样点、真实位移/力、塑性、断裂和全部热/弹性/缺陷能账。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('USER_CANCEL','EMERGENCY_STOP','LOAD_CELL_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','FIXTURE_FORCE_LIMIT','METHOD_FORCE_STOP') else 'none') for e in ERRORS],verification=[],limitations=LIMITATIONS,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('acquisition.start','crosshead.move_to','grip.set_closed','power.set','emergency.engage'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='由统一宿主时钟推进准静态本构、被动热和实际传感器响应') for s in SLOTS if s not in v['effects'] and SLOTS[s]['origin'] in ('sensor','derived','scene','process_truth')] mechanism=dict(component_ids=['crosshead','compliance_carriage','load_cell','upper_grip','lower_grip','specimen_lower','specimen_upper','extensometer','controller'],state_ids=list(slots),meaning_zh='串联顺应的拉伸双线性塑性、明确破断与可核算热/储能;独立传感器、固定采样和10ms反馈时钟',implementation='lumped',equations=['q=L*(ep+F/(A*E))+F/K; engineering strain=ep+F/(A*E).','yield stress=Y+H*ep; tensile return mapping enforces irreversible ep and quasi-static series equilibrium.','Uelastic=F²/(2K)+0.5*(F/A)²/E*A*L; Uhardening=0.5*H*ep²*A*L.','dWactuator=d(Uelastic+Uhardening)+Y*A*L*d(ep); Qplastic=beta*Y*A*L*d(ep), remaining work stored as defect energy.','At host-assumed fracture strain, sample elastic energy partitions into heat/surface; frame elastic energy exports as damping. ep and hardening/defect/surface energy remain with fragments.','C*dT/dt=-G*(T-Tambient)+Pplastic; sample load/remove transfers physical mass, volume, sensible heat and internal inventory.','tau*dFdet/dt=gain*F+offset-Fdet; Fobs=round((Fdet-zero)*cal_gain/res)*res.','Calibration cal_gain=external_known_force/(actual_detector_observation-zero); no hidden truth is used.','External analysis: sigma=Fobs/Aprior; strain=extension_observed/Lprior or (qobs-Fobs*Cframe_prior)/Lprior; no joint inversion of unknown geometry.','Sampling grid up to1000Hz with selected software; automatic force/strain feedback and associated sampling max100Hz. Fractional-nanosecond carry and yield/fracture/axis events maintain partition invariance.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=LIMITATIONS) spec=importlib.util.spec_from_file_location('_ags_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'uniaxial_tension':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'fixture.configure':(FIXTURE,FIXTURE_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE)}) for k,v in SLOTS.items():slots[k]['meaning_zh']=v['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'uniaxial_tension':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543"""QuadPro2-DAC0 with Keithley2450: timed four-contact thin-film wafer mapping."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npfrom scipy.integrate import solve_ivpPROTOCOL_VERSION='1.0.0';SLUG='signatone_quadpro2';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-142'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'sheet_resistance_library.json'
class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
from scipy.linalg import expmCURRENT_RANGES=[10.**p for p in range(-8,1)]VOLTAGE_RANGES=[.02,.2,2.,20.,200.]PROBE_SPACINGS=[.001016,.00127,.0015875]CONFIGURATIONS={'a_14_23':(0,3,1,2),'b_13_24':(0,2,1,3)}WARMUP_S=3600.;CALIBRATION_S=180.;PROBE_RAISED_M=.01
def library():return {v['id']:v for v in json.loads(LIBRARY_PATH.read_text())['templates']}def reference_rho(record,T,allow_invalid=False): rows=record['curves']['resistivity'];lo=max(rows[0]['temperature_K'],record['valid_temperature_range_K'][0]);hi=min(rows[-1]['temperature_K'],record['valid_temperature_range_K'][1]);valid=lo-1e-6<=T<=hi+1e-6 if not valid and not allow_invalid:return None return float(np.interp(T,[p['temperature_K'] for p in rows],[p['value_ohm_m'] for p in rows])),valid
def probe_points(x_m,y_m,spacing_m,orientation_rad=0.): direction=complex(math.cos(orientation_rad),math.sin(orientation_rad));center=complex(x_m,y_m) return [center+v*spacing_m*direction for v in [-1.5,-.5,.5,1.5]]def disk_kernel(z,a,radius_m,contact_radius_m=None): # Neumann disk source kernel, modulo constants which cancel for source/sink. distance=abs(z-a) if contact_radius_m is None else max(abs(z-a),contact_radius_m) return math.log(distance/radius_m)+math.log(abs(1-z*a.conjugate()/radius_m**2))def disk_transfer_coefficient(diameter_m,spacing_m,x_m,y_m,configuration='a_14_23',orientation_rad=0.,contact_radius_m=0.): R=diameter_m/2;pts=probe_points(x_m,y_m,spacing_m,orientation_rad) if any(abs(p)+max(contact_radius_m,1e-10)>=R for p in pts):raise ActionRejected('PROBE_OUTSIDE_WAFER') a,b,c,d=CONFIGURATIONS[configuration] potential=lambda z:-(disk_kernel(z,pts[a],R)-disk_kernel(z,pts[b],R))/(2*math.pi) value=potential(pts[c])-potential(pts[d]) if not value>0:raise ActionRejected('GEOMETRY_UNRESOLVED') return float(value)def disk_drive_coefficient(diameter_m,spacing_m,x_m,y_m,configuration,contact_radius_m): R=diameter_m/2;pts=probe_points(x_m,y_m,spacing_m);a,b,_,_=CONFIGURATIONS[configuration] potential=lambda z:-(disk_kernel(z,pts[a],R,contact_radius_m)-disk_kernel(z,pts[b],R,contact_radius_m))/(2*math.pi) return float(potential(pts[a])-potential(pts[b]))
def infer_sheet_resistance(diameter_m,spacing_m,x_m,y_m,observations,calibration_gain,thickness_prior_m): estimates=[] for configuration in CONFIGURATIONS: rows=[p for p in observations if p['configuration']==configuration] if len(rows)!=2 or rows[0]['current_a']*rows[1]['current_a']>=0:raise ActionRejected('CURRENT_REVERSAL_REQUIRED') dI=rows[0]['current_a']-rows[1]['current_a'];dV=rows[0]['voltage_v']-rows[1]['voltage_v'] if abs(dI)<1e-20:raise ActionRejected('CURRENT_UNRESOLVED') coefficient=disk_transfer_coefficient(diameter_m,spacing_m,x_m,y_m,configuration);value=calibration_gain*dV/dI/coefficient if not math.isfinite(value) or value<=0:raise ActionRejected('NONPOSITIVE_SHEET_RESISTANCE') estimates.append(value) mean=float(np.mean(estimates));spread=abs(estimates[0]-estimates[1])/mean return dict(sheet_resistance_ohm_sq=mean,resistivity_ohm_m=None if thickness_prior_m is None else mean*thickness_prior_m,configuration_a_ohm_sq=estimates[0],configuration_b_ohm_sq=estimates[1],configuration_disagreement_fraction=spread,evidence='external_reversed_VI_and_finite_disk_Neumann_correction; rho_only_with_explicit_thickness_prior; not_OEM_ASTM_certification')
PLANT_EXAMPLE=dict(ambient_k=300.,voltage_gain=1.03,voltage_offset_v=2e-6,voltage_response_tau_s=.01,current_gain=1.,electrical_contact_radius_m=10e-6,current_contact_resistance_ohm=20.,thermal_conductance_w_k=.05,local_thermal_capacity_j_k=.1,xy_speed_m_s=.04,z_speed_m_s=.005,hood_speed_rad_s=.5,temperature_resolution_k=.001,rear_triax_connected=True,accept_engineering=True)PLANT=obj({'ambient_k':number('K',283.15,313.15),'voltage_gain':number('1',.1,10),'voltage_offset_v':number('V',-.1,.1),'voltage_response_tau_s':number('s',1e-5,10),'current_gain':number('1',.1,10),'electrical_contact_radius_m':number('m',1e-7,4e-5),'current_contact_resistance_ohm':number('ohm',0,1e9),'thermal_conductance_w_k':number('W/K',0,1000),'local_thermal_capacity_j_k':number('J/K',.001,100),'xy_speed_m_s':number('m/s',1e-5,.3),'z_speed_m_s':number('m/s',1e-5,.03),'hood_speed_rad_s':number('rad/s',.001,2),'temperature_resolution_k':number('K',1e-5,1),'rear_triax_connected':BOOL,'accept_engineering':BOOL})WAFER_EXAMPLE=dict(diameter_m=.1,substrate_thickness_m=.0005)WAFER=obj({'diameter_m':number('m',.01,.3),'substrate_thickness_m':number('m',1e-5,.01)})PROBE_EXAMPLE=dict(spacing_m=.00127,force_per_pin_n=.83356525,tip_radius_m=40.64e-6,tip_material='tungsten_carbide')PROBE=obj({'spacing_m':dict(type='number',enum=PROBE_SPACINGS,**{'x-unit':'m'}),'force_per_pin_n':dict(type='number',enum=[.44129925,.83356525,1.765197],**{'x-unit':'N'}),'tip_radius_m':dict(type='number',enum=[40.64e-6,127e-6,254e-6],**{'x-unit':'m'}),'tip_material':enum(['tungsten_carbide','osmium'])})THERMAL_SAMPLE=dict(conducting_thickness_m=1e-6,film_density_kg_m3=6000.,film_cp_j_kg_k=300.,substrate_density_kg_m3=2330.,substrate_cp_j_kg_k=700.,initial_temperature_k=300.,accept_thin_layer_and_thermal_assumptions=True)THERMAL_PROPERTIES={'conducting_thickness_m':number('m',1e-9,5e-5),'film_density_kg_m3':number('kg/m^3',1,30000),'film_cp_j_kg_k':number('J/kg/K',1,10000),'substrate_density_kg_m3':number('kg/m^3',1,30000),'substrate_cp_j_kg_k':number('J/kg/K',1,10000),'initial_temperature_k':number('K',1,363.14),'accept_thin_layer_and_thermal_assumptions':BOOL}SAMPLE_EXAMPLE=dict(THERMAL_SAMPLE,reference_id='starry_40927',gradient_x_fraction=.1,gradient_y_fraction=-.05,radial_fraction=.03,accept_synthetic_map_and_bulk_reference=True)SAMPLE=obj(dict(THERMAL_PROPERTIES,reference_id=TEXT,gradient_x_fraction=number('1',-.2,.2),gradient_y_fraction=number('1',-.2,.2),radial_fraction=number('1',-.2,.2),accept_synthetic_map_and_bulk_reference=BOOL))STANDARD_EXAMPLE=dict(THERMAL_SAMPLE,actual_sheet_resistance_ohm_sq=100.,accept_host_standard_not_certified=True)STANDARD=obj(dict(THERMAL_PROPERTIES,actual_sheet_resistance_ohm_sq=number('ohm/sq',1e-12,1e15),accept_host_standard_not_certified=BOOL))POINT=obj({'x_m':number('m',-.15,.15),'y_m':number('m',-.15,.15)})MAP_EXAMPLE=dict(points=[dict(x_m=x,y_m=y) for x,y in [(0,0),(.02,0),(0,.02),(-.02,0),(0,-.02),(.049,0)]],edge_exclusion_m=.003,thickness_prior_m=1e-6)MAP=obj({'points':array(POINT,1,14000),'edge_exclusion_m':number('m',0,.15),'thickness_prior_m':nullable(number('m',1e-9,5e-5))})METHOD_EXAMPLE=dict(auto_current=True,current_min_a=1e-8,current_max_a=.001,fixed_current_a=.0001,voltage_range_v=.2,voltage_compliance_v=20.,target_voltage_min_v=.005,target_voltage_max_v=.08,phase_duration_s=.3,settling_s=.2,require_calibration=True,require_warmup=False)METHOD=obj({'auto_current':BOOL,'current_min_a':dict(type='number',enum=CURRENT_RANGES,**{'x-unit':'A'}),'current_max_a':dict(type='number',enum=CURRENT_RANGES,**{'x-unit':'A'}),'fixed_current_a':number('A',0,1),'voltage_range_v':dict(type='number',enum=VOLTAGE_RANGES,**{'x-unit':'V'}),'voltage_compliance_v':number('V',.002,200),'target_voltage_min_v':number('V',1e-8,100),'target_voltage_max_v':number('V',1e-7,200),'phase_duration_s':number('s',.3,30),'settling_s':number('s',0,60),'require_calibration':BOOL,'require_warmup':BOOL})OBSERVATION=obj({'configuration':enum(list(CONFIGURATIONS)),'current_a':number('A'),'voltage_v':number('V'),'host_time_s':number('s',0)})OBS_INPUT=obj({'configuration':enum(list(CONFIGURATIONS)),'current_a':number('A'),'voltage_v':number('V')})INFERENCE=obj({'sheet_resistance_ohm_sq':number('ohm/sq',0),'resistivity_ohm_m':nullable(number('ohm*m',0)),'configuration_a_ohm_sq':number('ohm/sq',0),'configuration_b_ohm_sq':number('ohm/sq',0),'configuration_disagreement_fraction':number('1',0),'evidence':TEXT})ANALYSIS_INPUT=obj({'diameter_m':number('m',.01,.3),'spacing_m':dict(type='number',enum=PROBE_SPACINGS,**{'x-unit':'m'}),'x_m':number('m',-.15,.15),'y_m':number('m',-.15,.15),'observations':array(OBS_INPUT,4,4),'calibration_gain':number('1',.1,10),'thickness_prior_m':nullable(number('m',1e-9,5e-5))})ANALYSIS_EXAMPLE=dict(diameter_m=.1,spacing_m=.00127,x_m=0.,y_m=0.,observations=[dict(configuration=c,current_a=I,voltage_v=I*100*disk_transfer_coefficient(.1,.00127,0,0,c)+2e-6) for c in CONFIGURATIONS for I in [.0001,-.0001]],calibration_gain=1.,thickness_prior_m=None)MAP_ROW=obj({'point_index':dict(type='integer',minimum=0,maximum=13999,**{'x-unit':'1'}),'x_m':number('m'),'y_m':number('m'),'time_s':number('s',0),'host_time_s':number('s',0),'observations':array(OBSERVATION,0,4),'sheet_resistance_ohm_sq':nullable(number('ohm/sq')),'resistivity_ohm_m':nullable(number('ohm*m')),'configuration_disagreement_fraction':nullable(number('1')),'quality':enum(['estimated','unavailable']),'error_code':nullable(TEXT)})STATS=obj({'count':dict(type='integer',minimum=0,maximum=14000,**{'x-unit':'1'}),'mean_ohm_sq':nullable(number('ohm/sq')),'std_ohm_sq':nullable(number('ohm/sq')),'minimum_ohm_sq':nullable(number('ohm/sq')),'maximum_ohm_sq':nullable(number('ohm/sq')),'relative_std_percent':nullable(number('%'))})AUTO_ROW=obj({'requested_current_a':number('A'),'measured_current_positive_a':number('A'),'measured_current_negative_a':number('A'),'voltage_positive_v':nullable(number('V')),'voltage_negative_v':nullable(number('V')),'reversal_signal_v':nullable(number('V')),'time_s':number('s',0),'source_compliance':BOOL})EXCLUDED=obj({'point_index':dict(type='integer',minimum=0,maximum=13999,**{'x-unit':'1'}),'x_m':number('m'),'y_m':number('m'),'reason':TEXT})RESULT=obj({'operation_id':nullable(TEXT),'operation_kind':nullable(enum(['mapping','calibration'])),'phase':PHASE,'elapsed_s':number('s',0),'rows':array(MAP_ROW,0,14000),'excluded_points':array(EXCLUDED,0,14000),'auto_trials':array(AUTO_ROW,0,9),'selected_current_a':number('A',0,1),'statistics':STATS,'calibration_gain':nullable(number('1')),'template_source':nullable(TEXT),'evidence':TEXT,'error_code':nullable(TEXT)})CAPS={};SLOTS={}def cap(k,i,o,c,z,kind='device_command',visibility='agent',example=None):CAPS[k]=dict(input_schema=i,output_schema=o,component_ids=c,function_zh=z,kind=kind,visibility=visibility,example_arguments=copy.deepcopy(example or {}),effects=[])def slot(k,s,u,z,origin='derived',visibility='agent',component='controller'):SLOTS[k]=dict(schema=s,unit=u,meaning=z,origin=origin,visibility=visibility,component=component,write=None)cap('plant.configure',PLANT,obj({'configured':BOOL}),['controller','source_meter','sample_stage'],'宿主明确误差、运动速度、被动热参数及2450 rear triax连接,不注入厂家准确度','configuration','evaluator',PLANT_EXAMPLE)cap('wafer.configure',WAFER,obj({'configured':BOOL}),['sample_wafer'],'10至300mm圆片和绝缘支承基底厚度,载入后锁定几何','configuration','evaluator',WAFER_EXAMPLE)cap('probe.configure',PROBE,obj({'configured':BOOL}),['probe_head'],'选择SP4间距、tip/载荷并使既有校准失效;不伪装Pa压力或动态重建3D探针','configuration',example=PROBE_EXAMPLE)cap('sample.load',SAMPLE,obj({'loaded':BOOL}),['sample_wafer'],'装载真实rho文献参考驱动的薄膜+基底;地图/膜厚/热参数明确宿主假设','configuration','evaluator',SAMPLE_EXAMPLE)cap('standard.load',STANDARD,obj({'loaded':BOOL}),['sample_wafer'],'宿主装入独立给定实际Rs的薄膜标样代理,证书/NIST真实性未验证','configuration','evaluator',STANDARD_EXAMPLE)cap('sample.remove',obj({}),obj({'loaded':BOOL}),['sample_wafer'],'卸除全部膜/基底质量和显热,既有测量与耗散账不回滚','configuration','evaluator')cap('power.set',obj({'enabled':BOOL}),obj({'enabled':BOOL}),['power_switch','source_meter'],'整系统源与自动运动电源,2450额定精度预热状态随真实时间累计',example={'enabled':True})cap('stage.move',POINT,obj({'target_x_m':number('m'),'target_y_m':number('m')}),['stage_x','sample_stage'],'安全抬针后移动真实XY机械坐标,测点坐标与样品台位移取反',example={'x_m':.01,'y_m':-.01})cap('probe.set_contact',obj({'contact':BOOL}),obj({'target_m':number('m',0,PROBE_RAISED_M)}),['probe_head'],'有限速度下降接触或抬针,不跳跃针尖姿态',example={'contact':True})cap('enclosure.set_open',obj({'opened':BOOL}),obj({'target_rad':number('rad',0,1.1)}),['hood'],'宿主手动暗箱翻盖有限速度代理,打开装样、关闭测量','simulation','evaluator',{'opened':False})cap('map.configure',MAP,obj({'configured':BOOL,'accepted_points':dict(type='integer',minimum=0,maximum=14000,**{'x-unit':'1'}),'excluded_points':dict(type='integer',minimum=0,maximum=14000,**{'x-unit':'1'})}),['sample_stage','controller'],'最多14000自定义点及边缘排除;无导电厚度先验时仅报告Rs','configuration',example=MAP_EXAMPLE)cap('method.configure',METHOD,obj({'configured':BOOL}),['source_meter','controller'],'AutoRange只首点逐档真试测,后续地图固定该电流;每点双接线正反四相≥1.2s','configuration',example=METHOD_EXAMPLE)cap('calibration.start',obj({'reference_sheet_resistance_ohm_sq':number('ohm/sq',1e-12,1e15)}),obj({'operation_id':TEXT,'minimum_duration_s':number('s',180)}),['source_meter','probe_head','controller'],'外部给定标样值与真实4相观测决定校正;实际累计至少180s,换针后重做',example={'reference_sheet_resistance_ohm_sq':100.})cap('calibration.clear',obj({}),obj({'calibrated':BOOL}),['controller'],'显式清除既有校正','configuration')cap('acquisition.start',obj({}),obj({'operation_id':TEXT,'accepted_points':dict(type='integer',minimum=1,maximum=14000,**{'x-unit':'1'})}),['source_meter','stage_x','sample_stage','probe_head','controller'],'自动抬针/XY移动/下针/等待/首点量程/双接线正反四相,逐点建立实际地图')cap('acquisition.stop',obj({}),obj({'phase':PHASE,'elapsed_s':number('s',0)}),['controller','source_meter','probe_head'],'切断激励、停止当前运动并保留完成点及已生热;不瞬移回零')cap('acquisition.result',obj({}),RESULT,['controller'],'公开地图/统计/量程试测/原始VI,所有角色统一去除所选参考身份','query')cap('analysis.sheet_resistance',ANALYSIS_INPUT,INFERENCE,['controller'],'仅外部VI/几何/校正反演Rs,rho必须有独立导电膜厚先验','analysis',example=ANALYSIS_EXAMPLE)cap('provenance.read',obj({}),obj({'reference_id':nullable(TEXT),'template_source':nullable(TEXT),'evidence':TEXT}),['controller'],'仅宿主读取当前参考曲线或输入标样来源','query','evaluator')LEDGER_UNITS=dict(mass_loaded_kg='kg',mass_present_kg='kg',mass_removed_kg='kg',mass_error_kg='kg',volume_loaded_m3='m^3',volume_present_m3='m^3',volume_removed_m3='m^3',volume_error_m3='m^3',source_input_j='J',sample_joule_j='J',contact_heat_export_j='J',electrical_error_j='J',ambient_heat_export_j='J',loaded_sensible_j='J',removed_sensible_j='J',thermal_stored_j='J',thermal_energy_error_j='J')cap('ledger.read',obj({}),obj({k:number(u) for k,u in LEDGER_UNITS.items()}),['controller'],'薄膜/基底质量体积、被动温度、样品焦耳热/接触热外流账','query','evaluator')cap('sim.step',obj({'dt_s':number('s',0,86400)}),obj({'time_s':number('s',0)}),['controller'],'唯一宿主时钟,有限自动运动、首点量程、180s校准、预热/采样/被动热','simulation','evaluator',{'dt_s':10.})UNSUPPORTED=['hardware.connect','robot.load','temperature.tcr_control','measurement.thick_bulk_wafer','analysis.joint_unknown_thickness_and_resistivity','measurement.astm_certification','noise.empirical','accuracy.certification']for k in UNSUPPORTED:cap(k,obj({}),obj({}),['controller'],'本配置未实现:'+k)for k,c in [('plant.configured','controller'),('wafer.configured','sample_wafer'),('probe.configured','probe_head'),('sample.present','sample_wafer'),('power.enabled','power_switch'),('source.warmup_ready','source_meter'),('calibration.valid','controller'),('stage.moving','sample_stage')]:slot(k,BOOL,'1','当前配置/运行状态',component=c)for k,u,z,c in [('stage.x_m','m','真实X台位置','stage_x'),('stage.y_m','m','真实Y台位置','sample_stage'),('stage.target_x_m','m','X台目标','stage_x'),('stage.target_y_m','m','Y台目标','sample_stage'),('probe.position_m','m','探针当前上提量;0接触','probe_head'),('probe.target_m','m','探针目标上提量;0接触','probe_head')]:slot(k,number(u,-.15,.15),u,z+';运动只随step改变','setpoint' if 'target' in k else 'scene',component=c)slot('hood.angle_rad',number('rad',0,1.1),'rad','暗箱翻盖当前角,0闭合/1.1打开','scene',component='hood')slot('hood.target_angle_rad',number('rad',0,1.1),'rad','暗箱翻盖目标角','setpoint',component='hood')slot('power.angle_rad',number('rad',0,.28),'rad','电源开关姿态代理','scene',component='power_switch')slot('source.warmup_elapsed_s',number('s',0,3600),'s','2450当前连续上电预热,3600s封顶;不构成额定准确度认证',component='source_meter')slot('thermal.indicated_k',nullable(number('K')),'K','薄膜/基底及局部显式热容节点的量化温度,仅被动环境热交换','sensor',component='sample_wafer')slot('measurement.selected_current_a',number('A',0,1),'A','本图首点AutoRange选定后固定的电流幅度','derived',component='source_meter')slot('measured.current_a',nullable(number('A')),'A','2450实际电流经显式增益及厂家测量分辨率量化后的观测','sensor',component='source_meter')slot('measured.voltage_v',nullable(number('V')),'V','四针输入电压增益/偏置/一阶响应及2450测量分辨率量化观测','sensor',component='source_meter')slot('measurement.last_sheet_resistance_ohm_sq',nullable(number('ohm/sq')),'ohm/sq','最后实际完成点的几何修正Rs,未完���点不输出')slot('display.sheet_resistance_ohm_sq',nullable(number('ohm/sq')),'ohm/sq','通电时PC显示最后已测点Rs;断电返回不可用,历史测量值仍保留')slot('measurement.mean_sheet_resistance_ohm_sq',nullable(number('ohm/sq')),'ohm/sq','已完成地图点的算术平均Rs,非隐藏全图真值')slot('calibration.gain',nullable(number('1')),'1','由外部参考Rs与实际观测比值形成的校正,换针失效')slot('acquisition.phase',PHASE,'1','异步地图/校准运行状态')slot('acquisition.stage',TEXT,'1','真实自动序列阶段:运动、接触、量程、四相、抬针')slot('acquisition.points',{'type':'integer','minimum':0,'maximum':14000,'x-unit':'1'},'1','实际完成有效或失败测点行数')slot('acquisition.elapsed_s',number('s',0),'s','当前作业实际宿主历时')slot('clock.time_s',number('s',0),'s','唯一宿主时间')for k,u,z in [('truth.sample_k','K','薄膜/基底集中节点真温'),('truth.sample_mass_kg','kg','薄膜及基底总质量'),('truth.conducting_thickness_m','m','隐藏导电膜厚,不等于基底厚度')]:slot(k,nullable(number(u)),u,z,'process_truth','evaluator','sample_wafer')
class SignatoneQuadpro2Runtime: def __init__(self,instance_id='quadpro2_01'): self.instance_id=instance_id;self.plant=self.wafer=self.probe=self.sample=self.record=None;self.sample_kind=None;self.map=None;self.accepted=[];self.excluded=[];self.method=copy.deepcopy(METHOD_EXAMPLE);self.power=False;self.power_started_ns=None;self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0 self.axes={k:dict(position=v,target=v,start=v,start_ns=0,arrival_ns=0) for k,v in [('x',0.),('y',0.),('z',PROBE_RAISED_M),('hood',1.1)]};self.x=np.zeros(6) # theta,voltage detector,sourceJ,sampleJ,contactJ,ambientJ self.calibration_gain=None;self.phase='idle';self.stage='idle';self.operation_kind=None;self.operation_id=None;self.elapsed=0.;self.rows=[];self.auto_trials=[];self.selected_current=0.;self.error=None;self._counter=0;self._start_ns=0;self._event_ns=None;self._job_points=[];self._job_excluded=[];self._site=0;self._measure_phase=0;self._partial=[];self._auto_candidates=[];self._auto_index=0;self._auto_positive=None;self._calibration_reference=None;self._last_sheet=None self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={};self._source=self._reference_id=None;self._evidence='no_sample';self._operation_source=None;self._operation_evidence='no_measurement';self.mass_loaded=self.mass_removed=self.volume_loaded=self.volume_removed=self.loaded_sensible=self.removed_sensible=0. @property def time_s(self):return self.time_ns/1e9 def register_principal(self,principal_id,visibility='agent'): if not isinstance(principal_id,str) or not principal_id or principal_id in self._principals or visibility not in ('agent','debug','evaluator'):raise ActionRejected('REQUEST_CONFLICT') self._principals[principal_id]=visibility def session(self,principal_id): if principal_id not in self._principals:raise ActionRejected('ACCESS_DENIED') return SignatoneQuadpro2Session(self,principal_id) def describe(self):return export_signatone_quadpro2_contract_metadata() def _warmup(self):return min(WARMUP_S,(self.time_ns-self.power_started_ns)/1e9) if self.power and self.power_started_ns is not None else 0. def _moving(self,key=None):return any(self.time_ns<self.axes[k]['arrival_ns'] for k in ([key] if key else ['x','y','z'])) def _raised(self):return self.axes['z']['position']>=PROBE_RAISED_M-1e-12 and not self._moving('z') def _closed(self):return self.axes['hood']['position']<=1e-12 and self.axes['hood']['target']==0 and not self._moving('hood') def _volume(self):return math.pi*(self.wafer['diameter_m']/2)**2*(self.wafer['substrate_thickness_m']+self.sample['conducting_thickness_m']) if self.sample else 0. def _masses(self): if not self.sample:return 0.,0. A=math.pi*(self.wafer['diameter_m']/2)**2;return A*self.wafer['substrate_thickness_m']*self.sample['substrate_density_kg_m3'],A*self.sample['conducting_thickness_m']*self.sample['film_density_kg_m3'] def _mass(self):return sum(self._masses()) def _sample_capacity(self): if not self.sample:return 0. ms,mf=self._masses();return ms*self.sample['substrate_cp_j_kg_k']+mf*self.sample['film_cp_j_kg_k'] def _capacity(self):return (self.plant['local_thermal_capacity_j_k'] if self.plant else .1)+self._sample_capacity() def _temperature(self):return self.plant['ambient_k']+float(self.x[0]) if self.plant else None def _axis_speed(self,k):return self.plant['hood_speed_rad_s' if k=='hood' else 'z_speed_m_s' if k=='z' else 'xy_speed_m_s'] def _move(self,**targets): for k,target in targets.items(): a=self.axes[k];a.update(target=target,start=a['position'],start_ns=self.time_ns,arrival_ns=self.time_ns+round(abs(target-a['position'])/self._axis_speed(k)*1e9)) def _stop_motion(self): for k in ['x','y','z']: a=self.axes[k];a.update(target=a['position'],start=a['position'],start_ns=self.time_ns,arrival_ns=self.time_ns) def _set_stage(self,stage,wait_s=None):self.stage=stage;self._event_ns=self.time_ns+round(wait_s*1e9) if wait_s is not None else max(self.axes[k]['arrival_ns'] for k in ['x','y','z']) def _point(self):return self._job_points[self._site] if self._job_points else dict(point_index=0,x_m=-self.axes['x']['position'],y_m=-self.axes['y']['position']) def _electrically_active(self):return self.power and self.phase=='running' and self.stage in ('auto_positive','auto_negative','measure') and self.axes['z']['position']<=1e-12 and self._closed() def _configuration(self):return 'a_14_23' if self.stage.startswith('auto') or self._measure_phase<2 else 'b_13_24' def _requested_current(self): if not self._electrically_active():return 0. if self.stage.startswith('auto'):return self._auto_candidates[self._auto_index]*(1 if self.stage=='auto_positive' else -1) return self.selected_current*(1 if self._measure_phase%2==0 else -1) def _current_range(self,I=None): value=abs(self._requested_current() if I is None else I);return next((v for v in CURRENT_RANGES if v>=value*(1-1e-12)),1.) def _local_sheet(self,T): if self.sample_kind=='standard':return self.sample['actual_sheet_resistance_ohm_sq'],T<363.15 raw=reference_rho(self.record,T,allow_invalid=True);p=self._point();R=self.wafer['diameter_m']/2;xx=p['x_m']/R;yy=p['y_m']/R;factor=1+self.sample['gradient_x_fraction']*xx+self.sample['gradient_y_fraction']*yy+self.sample['radial_fraction']*(xx*xx+yy*yy) return raw[0]/self.sample['conducting_thickness_m']*factor,raw[1] and T<363.15 def _electrical(self,T=None): if not self._electrically_active():return dict(current=0.,voltage=0.,source_voltage=0.,sample_power=0.,contact_power=0.,compliance=False,valid=True) T=self._temperature() if T is None else T;Rs,valid=self._local_sheet(T);p=self._point();c=self._configuration();geo=(self.wafer['diameter_m'],self.probe['spacing_m'],p['x_m'],p['y_m']);K=disk_transfer_coefficient(*geo,c);drive=Rs*disk_drive_coefficient(*geo,c,self.plant['electrical_contact_radius_m']);contact=self.plant['current_contact_resistance_ohm'];total=drive+contact;requested=self._requested_current();I=math.copysign(min(abs(requested),self.method['voltage_compliance_v']/total,math.sqrt(20./total),.1 if self.method['voltage_compliance_v']>20 else 1.),requested) return dict(current=I,voltage=I*Rs*K,source_voltage=I*total,sample_power=I*I*drive,contact_power=I*I*contact,compliance=abs(I-requested)>max(abs(requested)*1e-10,1e-18),valid=bool(valid)) def _observed(self,e=None): if not self._electrically_active():return None,None e=self._electrical() if e is None else e;v=float(self.x[1]);full=self.method['voltage_range_v'];qv=full*5e-7;qi=self._current_range()*1e-6;return float(round(e['current']*self.plant['current_gain']/qi)*qi),None if abs(v)>full else float(round(v/qv)*qv) def _stats(self): values=[x['sheet_resistance_ohm_sq'] for x in self.rows if x['sheet_resistance_ohm_sq'] is not None] if not values:return dict(count=0,mean_ohm_sq=None,std_ohm_sq=None,minimum_ohm_sq=None,maximum_ohm_sq=None,relative_std_percent=None) mean=float(np.mean(values));std=float(np.std(values));return dict(count=len(values),mean_ohm_sq=mean,std_ohm_sq=std,minimum_ohm_sq=min(values),maximum_ohm_sq=max(values),relative_std_percent=100*std/mean) def read(self,role='evaluator'): if role not in ('agent','debug','evaluator'):raise ActionRejected('ACCESS_DENIED') current,voltage=self._observed();d={'plant.configured':self.plant is not None,'wafer.configured':self.wafer is not None,'probe.configured':self.probe is not None,'sample.present':self.sample is not None,'power.enabled':self.power,'source.warmup_ready':self._warmup()>=WARMUP_S,'calibration.valid':self.calibration_gain is not None,'stage.moving':self._moving(),'stage.x_m':self.axes['x']['position'],'stage.y_m':self.axes['y']['position'],'stage.target_x_m':self.axes['x']['target'],'stage.target_y_m':self.axes['y']['target'],'probe.position_m':self.axes['z']['position'],'probe.target_m':self.axes['z']['target'],'hood.angle_rad':self.axes['hood']['position'],'hood.target_angle_rad':self.axes['hood']['target'],'power.angle_rad':.28 if self.power else 0.,'source.warmup_elapsed_s':self._warmup(),'thermal.indicated_k':float(round(self._temperature()/self.plant['temperature_resolution_k'])*self.plant['temperature_resolution_k']) if self.plant else None,'measurement.selected_current_a':self.selected_current,'measured.current_a':current,'measured.voltage_v':voltage,'measurement.last_sheet_resistance_ohm_sq':self._last_sheet,'display.sheet_resistance_ohm_sq':self._last_sheet if self.power else None,'measurement.mean_sheet_resistance_ohm_sq':self._stats()['mean_ohm_sq'],'calibration.gain':self.calibration_gain,'acquisition.phase':self.phase,'acquisition.stage':self.stage,'acquisition.points':len(self.rows),'acquisition.elapsed_s':self.elapsed,'clock.time_s':self.time_s,'truth.sample_k':self._temperature(),'truth.sample_mass_kg':self._mass() if self.sample else None,'truth.conducting_thickness_m':self.sample['conducting_thickness_m'] if self.sample else None} return {k:v for k,v in d.items() if role!='agent' or SLOTS[k]['visibility']=='agent'} def _propagate(self,ns): if not ns or not self.plant:return dt=ns/1e9;p=self.plant;C=self._capacity();G=p['thermal_conductance_w_k'] if self._electrically_active(): def rhs(_t,y): e=self._electrical(p['ambient_k']+y[0]);loss=G*y[0];return [(e['sample_power']-loss)/C,(p['voltage_gain']*e['voltage']+p['voltage_offset_v']-y[1])/p['voltage_response_tau_s'],e['current']*e['source_voltage'],e['sample_power'],e['contact_power'],loss] sol=solve_ivp(rhs,(0.,dt),self.x,method='Radau',rtol=1e-10,atol=[1e-11,1e-13,1e-13,1e-13,1e-13,1e-12]) if not sol.success:raise RuntimeError('ELECTROTHERMAL_INTEGRATION_FAILED') self.x=sol.y[:,-1] else: initial=self.x[0];self.x[0]*=math.exp(-G*dt/C);self.x[5]+=C*(initial-self.x[0]);self.x[1]*=math.exp(-dt/p['voltage_response_tau_s']) def _ledger(self): source,sample,contact,ambient=self.x[2:];stored=self._capacity()*float(self.x[0]);return dict(mass_loaded_kg=self.mass_loaded,mass_present_kg=self._mass(),mass_removed_kg=self.mass_removed,mass_error_kg=self.mass_loaded-self._mass()-self.mass_removed,volume_loaded_m3=self.volume_loaded,volume_present_m3=self._volume(),volume_removed_m3=self.volume_removed,volume_error_m3=self.volume_loaded-self._volume()-self.volume_removed,source_input_j=float(source),sample_joule_j=float(sample),contact_heat_export_j=float(contact),electrical_error_j=float(source-sample-contact),ambient_heat_export_j=float(ambient),loaded_sensible_j=self.loaded_sensible,removed_sensible_j=self.removed_sensible,thermal_stored_j=stored,thermal_energy_error_j=float(sample-ambient+self.loaded_sensible-self.removed_sensible-stored)) def _result(self): if self.phase!='running' and self.operation_id in self.records:return copy.deepcopy(self.records[self.operation_id]) return dict(operation_id=self.operation_id,operation_kind=self.operation_kind,phase=self.phase,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),excluded_points=copy.deepcopy(self._job_excluded),auto_trials=copy.deepcopy(self.auto_trials),selected_current_a=self.selected_current,statistics=self._stats(),calibration_gain=self.calibration_gain,template_source=self._operation_source,evidence=self._operation_evidence,error_code=self.error) def _finish(self,phase,error=None): self.phase=phase;self.stage='idle';self.error=error;self._event_ns=None;self._stop_motion() if self.operation_id:self.records[self.operation_id]=self._result() def _capture(self): e=self._electrical();I,V=self._observed(e);error='REFERENCE_TEMPERATURE_RANGE' if not e['valid'] else 'SOURCE_COMPLIANCE' if e['compliance'] else 'VOLTAGE_OVERFLOW' if V is None else None return I,V,error,e def _failure_row(self,error): p=self._point();self.rows.append(dict(point_index=p['point_index'],x_m=p['x_m'],y_m=p['y_m'],time_s=self.elapsed,host_time_s=self.time_s,observations=copy.deepcopy(self._partial),sheet_resistance_ohm_sq=None,resistivity_ohm_m=None,configuration_disagreement_fraction=None,quality='unavailable',error_code=error));self._finish('failed',error) def _begin_measure(self): self._measure_phase=0;self._partial=[];dwell=max(self.method['phase_duration_s'],CALIBRATION_S/4) if self.operation_kind=='calibration' else self.method['phase_duration_s'];self._set_stage('measure',dwell) def _begin_point(self): self._partial=[];self._move(z=PROBE_RAISED_M);self._set_stage('raise') def _advance_event(self): if self.stage=='raise': p=self._point();self._move(x=-p['x_m'],y=-p['y_m']);self._set_stage('move') elif self.stage=='move':self._move(z=0.);self._set_stage('lower') elif self.stage=='lower':self._set_stage('settle',self.method['settling_s']) elif self.stage=='settle': if self._site==0 and self.method['auto_current']: self._auto_index=0;self._set_stage('auto_positive',.6) else:self._begin_measure() elif self.stage=='auto_positive': self._auto_positive=self._capture();self._set_stage('auto_negative',.6) elif self.stage=='auto_negative': Ip,Vp,ep,physical_p=self._auto_positive;In,Vn,en,physical_n=self._capture();signal=None if Vp is None or Vn is None else abs(Vp-Vn)/2;current=self._auto_candidates[self._auto_index];self.auto_trials.append(dict(requested_current_a=current,measured_current_positive_a=Ip,measured_current_negative_a=In,voltage_positive_v=Vp,voltage_negative_v=Vn,reversal_signal_v=signal,time_s=self.elapsed,source_compliance=physical_p['compliance'] or physical_n['compliance'])) if ep or en: previous=self.auto_trials[-2] if len(self.auto_trials)>1 else None if (ep or en)=='REFERENCE_TEMPERATURE_RANGE' or previous is None or previous['reversal_signal_v'] is None or previous['reversal_signal_v']<=10*self.method['voltage_range_v']*5e-7:self._failure_row(ep or en);return self.selected_current=previous['requested_current_a'];self._begin_measure() elif signal<self.method['target_voltage_min_v'] and self._auto_index+1<len(self._auto_candidates):self._auto_index+=1;self._set_stage('auto_positive',.6) else: if signal is None or signal<=10*self.method['voltage_range_v']*5e-7:self._failure_row('AUTORANGE_UNRESOLVED');return self.selected_current=self.auto_trials[-2]['requested_current_a'] if signal>self.method['target_voltage_max_v'] and len(self.auto_trials)>1 else current;self._begin_measure() elif self.stage=='measure': I,V,error,_e=self._capture() if error:self._failure_row(error);return self._partial.append(dict(configuration=self._configuration(),current_a=I,voltage_v=V,host_time_s=self.time_s));self._measure_phase+=1 if self._measure_phase<4: self._set_stage('measure',max(self.method['phase_duration_s'],CALIBRATION_S/4) if self.operation_kind=='calibration' else self.method['phase_duration_s']);return p=self._point();prior=None if self.operation_kind=='calibration' else self.map['thickness_prior_m'];args=dict(diameter_m=self.wafer['diameter_m'],spacing_m=self.probe['spacing_m'],x_m=p['x_m'],y_m=p['y_m'],observations=[{k:x[k] for k in OBS_INPUT['properties']} for x in self._partial],calibration_gain=1. if self.operation_kind=='calibration' else self.calibration_gain or 1.,thickness_prior_m=prior) try:inferred=infer_sheet_resistance(**args) except ActionRejected as exc:self._failure_row(str(exc));return self.rows.append(dict(point_index=p['point_index'],x_m=p['x_m'],y_m=p['y_m'],time_s=self.elapsed,host_time_s=self.time_s,observations=copy.deepcopy(self._partial),sheet_resistance_ohm_sq=inferred['sheet_resistance_ohm_sq'],resistivity_ohm_m=inferred['resistivity_ohm_m'],configuration_disagreement_fraction=inferred['configuration_disagreement_fraction'],quality='estimated',error_code=None));self._last_sheet=inferred['sheet_resistance_ohm_sq'] if self.operation_kind=='calibration': gain=self._calibration_reference/inferred['sheet_resistance_ohm_sq'] if not .1<=gain<=10:self._finish('failed','CALIBRATION_RANGE');return self.calibration_gain=gain self._move(z=PROBE_RAISED_M);self._set_stage('raise_after') elif self.stage=='raise_after': self._site+=1 if self._site>=len(self._job_points):self._finish('succeeded') else:self._begin_point() else:raise RuntimeError('UNKNOWN_SEQUENCE_STAGE') def _filter_points(self,a): accepted=[];excluded=[];R=self.wafer['diameter_m']/2 for i,p in enumerate(a['points']): reason=None if math.hypot(p['x_m'],p['y_m'])>R-a['edge_exclusion_m']+1e-12:reason='EDGE_EXCLUSION' elif max(abs(p['x_m']),abs(p['y_m']))>.13:reason='STAGE_TRAVEL' else: try:disk_transfer_coefficient(self.wafer['diameter_m'],self.probe['spacing_m'],p['x_m'],p['y_m'],contact_radius_m=self.plant['electrical_contact_radius_m']) except ActionRejected:reason='PROBE_FOOTPRINT_OUTSIDE_WAFER' row=dict(point_index=i,**p) if reason:excluded.append(dict(row,reason=reason)) else:accepted.append(row) return accepted,excluded def _load(self,a,standard): if not self.plant or not self.wafer or not self.probe or self.sample or not self._raised() or self._moving() or self.axes['hood']['position']<1.0 or self._moving('hood') or max(abs(self.axes['x']['position']),abs(self.axes['y']['position']))>1e-12 or not a['accept_thin_layer_and_thermal_assumptions']:raise ActionRejected('PRECONDITION_FAILED') if a['conducting_thickness_m']/self.probe['spacing_m']>.05:raise ActionRejected('THIN_LAYER_DOMAIN') if standard: if not a['accept_host_standard_not_certified']:raise ActionRejected('ASSUMPTION_NOT_ACCEPTED') record=None else: if not a['accept_synthetic_map_and_bulk_reference']:raise ActionRejected('ASSUMPTION_NOT_ACCEPTED') record=library().get(a['reference_id']) if record is None:raise ActionRejected('UNKNOWN_REFERENCE') if reference_rho(record,a['initial_temperature_k']) is None:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') old=self._capacity();self.sample=copy.deepcopy(a);self.sample_kind='standard' if standard else 'material';self.record=copy.deepcopy(record);new=self._capacity();delta=a['initial_temperature_k']-self.plant['ambient_k'];self.x[0]=(old*self.x[0]+(new-old)*delta)/new;self.loaded_sensible+=(new-old)*delta;self.mass_loaded+=self._mass();self.volume_loaded+=self._volume();self._reference_id=None if standard else a['reference_id'];self._source='host_input_thin_film_standard_no_certificate' if standard else json.dumps(record['source'],ensure_ascii=False,sort_keys=True);self._evidence='explicit_host_standard_and_thermal_assumptions' if standard else 'measured_literature_rho; assumed_bulk_to_thin_film_and_synthetic_spatial_map';return {'loaded':True} def invoke(self,capability,**a): if capability not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability]['input_schema'],a) if capability in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if capability=='analysis.sheet_resistance':return infer_sheet_resistance(**a) if capability=='acquisition.result':return self._result() if capability=='provenance.read':return dict(reference_id=self._reference_id,template_source=self._source,evidence=self._evidence) if capability=='ledger.read':return self._ledger() if capability=='sim.step':self.step(a['dt_s']);return {'time_s':self.time_s} if self.phase=='running' and capability not in ('acquisition.stop','power.set'):raise ActionRejected('BUSY') if capability=='plant.configure': if self.plant or not a['accept_engineering']:raise ActionRejected('PRECONDITION_FAILED') self.plant=copy.deepcopy(a);out={'configured':True} elif capability=='wafer.configure': if self.sample:raise ActionRejected('PRECONDITION_FAILED') self.wafer=copy.deepcopy(a);self.map=None;self.accepted=[];self.excluded=[];out={'configured':True} elif capability=='probe.configure': if not self.plant or not self._raised() or self._moving() or self.axes['hood']['position']<1.0 or self._moving('hood'):raise ActionRejected('PRECONDITION_FAILED') if self.sample and self.sample['conducting_thickness_m']/a['spacing_m']>.05:raise ActionRejected('THIN_LAYER_DOMAIN') self.probe=copy.deepcopy(a);self.calibration_gain=None;self.map=None;self.accepted=[];self.excluded=[];out={'configured':True} elif capability in ('sample.load','standard.load'):out=self._load(a,capability=='standard.load') elif capability=='sample.remove': if not self.sample or not self._raised() or self._moving() or self.axes['hood']['position']<1.0 or self._moving('hood') or max(abs(self.axes['x']['position']),abs(self.axes['y']['position']))>1e-12:raise ActionRejected('PRECONDITION_FAILED') self.mass_removed+=self._mass();self.volume_removed+=self._volume();self.removed_sensible+=self._sample_capacity()*float(self.x[0]);self.sample=self.record=self.sample_kind=None;self._source=self._reference_id=None;self._evidence='no_sample';out={'loaded':False} elif capability=='power.set': if not a['enabled']: if self.phase=='running':self._finish('cancelled','POWER_OFF') else:self._stop_motion() if self.power!=a['enabled']:self.power_started_ns=self.time_ns if a['enabled'] else None self.power=a['enabled'];out={'enabled':self.power} elif capability=='enclosure.set_open': if not self.plant or self._moving() or not self._raised():raise ActionRejected('PRECONDITION_FAILED') target=1.1 if a['opened'] else 0.;self._move(hood=target);out={'target_rad':target} elif capability=='stage.move': if not self.power or not self.plant or not self._raised() or self._moving('hood') or max(abs(a['x_m']),abs(a['y_m']))>.13:raise ActionRejected('STAGE_TRAVEL_OR_CLEARANCE') self._move(x=a['x_m'],y=a['y_m']);out={'target_x_m':a['x_m'],'target_y_m':a['y_m']} elif capability=='probe.set_contact': if not self.power or not self.plant or self._moving('x') or self._moving('y') or self._moving('hood') or a['contact'] and (not self.sample or not self.probe or not self._closed()):raise ActionRejected('PRECONDITION_FAILED') if a['contact']:disk_transfer_coefficient(self.wafer['diameter_m'],self.probe['spacing_m'],-self.axes['x']['position'],-self.axes['y']['position'],contact_radius_m=self.plant['electrical_contact_radius_m']) target=0. if a['contact'] else PROBE_RAISED_M;self._move(z=target);out={'target_m':target} elif capability=='map.configure': if not self.wafer or not self.probe or not self.plant:raise ActionRejected('PRECONDITION_FAILED') if a['edge_exclusion_m']>=self.wafer['diameter_m']/2:raise ActionRejected('EDGE_EXCLUSION_RANGE') if a['edge_exclusion_m']+1e-12<max(0.,self.wafer['diameter_m']/2-.13):raise ActionRejected('STAGE_TRAVEL_ENVELOPE') accepted,excluded=self._filter_points(a);self.map=copy.deepcopy(a);self.accepted=accepted;self.excluded=excluded;out={'configured':True,'accepted_points':len(accepted),'excluded_points':len(excluded)} elif capability=='method.configure': if a['voltage_compliance_v']>20 and a['current_max_a']>.1:raise ActionRejected('SOURCE_RANGE_ENVELOPE') if a['current_min_a']>a['current_max_a'] or a['fixed_current_a']>a['current_max_a'] or a['target_voltage_min_v']>=a['target_voltage_max_v'] or a['target_voltage_max_v']>a['voltage_range_v']:raise ActionRejected('METHOD_RANGE') if any(abs(a[k]*1e9-round(a[k]*1e9))>1e-4 for k in ['phase_duration_s','settling_s']):raise ActionRejected('TIME_GRID') self.method=copy.deepcopy(a);out={'configured':True} elif capability=='calibration.clear':self.calibration_gain=None;out={'calibrated':False} elif capability in ('acquisition.start','calibration.start'): if not self.power or not self.plant or not self.wafer or not self.probe or not self.sample or not self._closed() or self._moving():raise ActionRejected('PRECONDITION_FAILED') if self.method['require_warmup'] and self._warmup()<WARMUP_S:raise ActionRejected('WARMUP_REQUIRED') if self.sample_kind=='material' and reference_rho(self.record,self._temperature()) is None:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') if self._temperature()>=363.15:raise ActionRejected('PROBE_TEMPERATURE_RANGE') if not self.plant['rear_triax_connected'] and (self.method['current_min_a']<1e-6 if self.method['auto_current'] else self._current_range(self.method['fixed_current_a'])<1e-6):raise ActionRejected('REAR_TRIAX_REQUIRED') iscal=capability=='calibration.start' if iscal and self.sample_kind!='standard':raise ActionRejected('STANDARD_REQUIRED') if not iscal and (not self.map or not self.accepted):raise ActionRejected('MAP_REQUIRED') if not iscal and self.method['require_calibration'] and self.calibration_gain is None:raise ActionRejected('CALIBRATION_REQUIRED') if not self.method['auto_current'] and self.method['fixed_current_a']<=0:raise ActionRejected('ZERO_EXCITATION') points=[dict(point_index=0,x_m=0.,y_m=0.)] if iscal else self.accepted for p in points:disk_transfer_coefficient(self.wafer['diameter_m'],self.probe['spacing_m'],p['x_m'],p['y_m'],contact_radius_m=self.plant['electrical_contact_radius_m']) self._counter+=1;self.operation_id=f'{self.instance_id}:acquisition:{self._counter}';self.operation_kind='calibration' if iscal else 'mapping';self._operation_source=self._source;self._operation_evidence=self._evidence;self.phase='running';self.elapsed=0.;self.rows=[];self.auto_trials=[];self.error=None;self._start_ns=self.time_ns;self._site=0;self._job_points=copy.deepcopy(points);self._job_excluded=[] if iscal else copy.deepcopy(self.excluded);self._calibration_reference=a['reference_sheet_resistance_ohm_sq'] if iscal else None;self._auto_candidates=[v for v in CURRENT_RANGES if self.method['current_min_a']<=v<=self.method['current_max_a']];q=self._current_range(self.method['fixed_current_a'])*5e-5;self.selected_current=0. if self.method['auto_current'] else float(round(self.method['fixed_current_a']/q)*q);self._begin_point();out={'operation_id':self.operation_id,'minimum_duration_s':CALIBRATION_S} if iscal else {'operation_id':self.operation_id,'accepted_points':len(points)} elif capability=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled','USER_CANCEL');out={'phase':self.phase,'elapsed_s':self.elapsed} else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(out) def step(self,dt_s): validate(number('s',0,86400),dt_s);total=math.fsum((self._clock_remainder_ns,dt_s*1e9));ns=round(total);self._clock_remainder_ns=total-ns if not ns:return end=self.time_ns+ns while self.time_ns<end: boundary=end for k in self.axes: if self._moving(k):boundary=min(boundary,self.axes[k]['arrival_ns']) if self.phase=='running':boundary=min(boundary,self._event_ns) self._propagate(boundary-self.time_ns);self.time_ns=boundary if self.plant: for k,a in self.axes.items():a['position']=a['target'] if self.time_ns>=a['arrival_ns'] else a['start']+math.copysign(self._axis_speed(k)*(self.time_ns-a['start_ns'])/1e9,a['target']-a['start']) if self.phase=='running': self.elapsed=(self.time_ns-self._start_ns)/1e9 if self.time_ns==self._event_ns:self._advance_event() self.revision+=1
class SignatoneQuadpro2Session: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_signatone_quadpro2_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'observed_four_probe_VI_with_finite_disk_thin_layer_and_explicit_synthetic_map_assumptions; selected template details require evaluator provenance.read' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id in ('acquisition.start','calibration.start') else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
EFFECTS={ 'plant.configure':['plant.configured','thermal.indicated_k','truth.sample_k'], 'wafer.configure':['wafer.configured'], 'probe.configure':['probe.configured','calibration.valid','calibration.gain'], 'sample.load':['sample.present','thermal.indicated_k','truth.sample_k','truth.sample_mass_kg','truth.conducting_thickness_m'], 'standard.load':['sample.present','thermal.indicated_k','truth.sample_k','truth.sample_mass_kg','truth.conducting_thickness_m'], 'sample.remove':['sample.present','truth.sample_mass_kg','truth.conducting_thickness_m'], 'power.set':['display.sheet_resistance_ohm_sq','power.enabled','power.angle_rad','source.warmup_ready','source.warmup_elapsed_s','stage.moving','stage.target_x_m','stage.target_y_m','probe.target_m','acquisition.phase','acquisition.stage','measured.current_a','measured.voltage_v'], 'stage.move':['stage.target_x_m','stage.target_y_m','stage.moving'], 'probe.set_contact':['probe.target_m','stage.moving'], 'enclosure.set_open':['hood.target_angle_rad'], 'calibration.clear':['calibration.valid','calibration.gain'], 'acquisition.start':['acquisition.phase','acquisition.stage','acquisition.elapsed_s','acquisition.points','measurement.mean_sheet_resistance_ohm_sq','measurement.selected_current_a','probe.target_m','stage.moving','measured.current_a','measured.voltage_v'], 'calibration.start':['acquisition.phase','acquisition.stage','acquisition.elapsed_s','acquisition.points','measurement.mean_sheet_resistance_ohm_sq','measurement.selected_current_a','probe.target_m','stage.moving','measured.current_a','measured.voltage_v'], 'acquisition.stop':['acquisition.phase','acquisition.stage','stage.moving','stage.target_x_m','stage.target_y_m','probe.target_m','measured.current_a','measured.voltage_v'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'POWER_OFF','USER_CANCEL','SOURCE_COMPLIANCE','VOLTAGE_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','CALIBRATION_RANGE','AUTORANGE_UNRESOLVED'})
def export_signatone_quadpro2_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI; QuadPro2-DAC0/Keithley2450/SP4; thin conducting film on insulating circular substrate, passive thermal boundary.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'SignatoneQuadpro2Session.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Motion/electrothermal/warmup/sample clocks advance only with host step. Measurements record endpoint after explicit settled positive/negative current dwell.'),source_ids=['simulation_assumption']) limits=[ '固定QuadPro2-DAC0:D为Keithley2450,A自动型,C300mm晶片,0无TCR;不是用其它源表参数替代,基础配置没有主动温控。SP4几何默认50085TRQ(1.27mm、85gf/针、WC、40.64µm tip radius、Q适配)。', 'wafer直径10至300mm。默认100mm直径、0.5mm绝缘基底上1µm导电膜;导电厚度/密度/Cp/空间分布是宿主假设。geometry.configure式变形未实现,wafer.configure/probe.configure改变过程几何不自动重建静态3D示例。', '导电层厚度必须不超过针距5%,采用二维薄片模型;0.5mm基底厚度不能被当成导电厚度。厚块晶片、体硅有限厚度、有限接触电流场、各向异性张量未实现。', '电气接触半径是独立宿主工程输入,不等于厂家针尖球面曲率半径。点源Green用于电压探针;驱动电阻在实际电流接触处按声明接触半径截断对数奇点,附加接触阻抗导热至外界。', '有限圆片绝缘边界采用Neumann Green同号镜像:g(z,a)=ln(|z-a|/R)+ln|1-z*conj(a)/R²|;源汇差的法向导数在圆周为零。中心大圆极限Rs=(π/ln2)V/I;用Smits1958表及独立边界/互易性检查,不宣称复刻ASTM或厂商内部算法。', '每点两接线A=I14/V23、B=I13/V24,各正负电流共4次端点观测。这里明确实现这两种接线与圆片校正,不假称已验证OEM Dual Configuration具体私有处理。', '库提供64种真实实验数字化rho(T),独立插值且限制原论文有效温域;无真实二维map、薄膜厚度或薄膜尺寸效应数据。rho由bulk方向参考转换为薄膜是明确假设。', '空间梯度/径向项仅局部均匀近似:以测点附近Rs标量缩放均匀圆盘Green,不是解非均匀电导全域PDE,输出地图标synthetic spatial assumption。', '反演仅使用观察到的±I/±V及几何/外部校正,先得到每配置Rs再平均;提供额外厚度先验才计算rho=Rs*t_prior。不同时从同一VI反演未知rho和未知厚度。', 'AutoRange只在每幅图的第一个接受测点按实际正反试测逐档寻找电流;全部后续site固定同一选定电流,不每点重新量程。自定义地图最多14000点,不采用另一页5至1400摘要限制;冲突在source_evidence。', '4相每相至少0.3s,总电测驻留至少1.2s/点,外加真实抬针、XY、下针和settling;首点每个AutoRange档还要实际1.2s。不能用host大dt把这些时长省略。', 'SP4换针使校准失效。calibration.start用宿主装入的薄膜标样和单独输入参考Rs,实际四相每相至少45s、合计180s,再加移动/量程;增益仅由外部参考/观测比值得出。不把厂家VLSI508µm硅标准硬套本薄膜模型,也不冒充实际NIST证书。', 'Keithley2450源电流档10nA至1A,每档源分辨率FS*5e-5、观测电流分辨率FS*1e-6;电压观测档20mV至200V,分辨率FS*5e-7。工程增益/偏置/τ不代表厂家精度或噪声分布。10/100nA档明确要求rear triax配置。', '源量程与电压观测档分离;源compliance≤20V档可至1A,>20V至200V档最多100mA,并同时≤20W;compliance至少源电压档10%;达到compliance/功率限制时实际I下降,电能依实际端压/电流累计并标观测失败,不能组合1A和200V。未利用105%过量程能力。', 'Signatone D系统原表10µΩ至100MΩ只写Ω,未明确Ω/sq;本模型不把它偷换成面电阻硬范围。输入标样1e-12至1e15Ω/sq仅工程数值域,反演要求正有限,实际读数可解析性由2450电流/电压档、分辨率和compliance限制。', '2450到额定精度需真实3600s连续上电,warmup状态真实累计。默认require_warmup=False为工程估算,设True会在3600s前拒绝测量/校准;任何模式均不承诺OEM额定精度或系统<1%。', '本几何工程XY行程±130mm;300mm片的圆形采区须至少20mm边缘排除,属于当前结构代理的安全域而非厂家限制。所有四针接点还须在边界内;被排除点有原因,不伪装为实际测量。', '机械stage实际位移=-测点坐标,固定世界探针落到wafer指定点;针抬起后才能XY,暗箱合上测量。取消/断电在当前姿态停止,不瞬移归零;仅已完成点输出,热量和质量留账。', '膜与基底共被动集中热节点,局部附加热容由宿主输入(默认0.1J/K,非整机218kg或夹具质量热容)。源电能=样品焦耳热+接触热外流;载入/移出两种材料质量体积和当前显热明确守恒。', '所有Session公开result/poll均隐藏所选参考身份,内部evaluator转发同样脱敏;privileged provenance.read单独访问。共享Python/磁盘不是OS隔离。', '真实仪器、机器人装样、TCR温控、真实标样证书/漂移/OEM准确度、完整非均匀PDE和厚晶片计量、急停硬件电路not_run。'] for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k in ('acquisition.start','calibration.start');caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.signatone_quadpro2.SignatoneQuadpro2Session.invoke',invocation=f'session.invoke(instance_id="quadpro2_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='运行入口原子核对薄层/参考温域、选型、暗箱/针尖/移动安全域、量程、校准与可选预热。',state_ids=['power.enabled','sample.present','probe.position_m','hood.angle_rad','calibration.valid','source.warmup_ready','acquisition.phase'],enforced_by='runtime',check='SignatoneQuadpro2Runtime.invoke guards before commit')],state_effects=[dict(state_id=s,timing='immediate',description_zh='命令实际即时状态变化') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='仅输出独立可绑定状态;真实姿态/显示联动由场景报告取证。',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='真实>=180s校准4相及抬针完成' if k=='calibration.start' else '所有接受点依真实运动/等待/首点量程/四相测量后抬针完成' if async_ else '原子命令;物理推进仅由宿主step',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','xy_stage','sp4_probe','keithley2450_source_meter'],partial_failure_zh='取消/断电截断激励并停当前XY/Z,保留已测点、完成的试量程及已积耗散/显热;不能回滚样品质量或已生热。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('POWER_OFF','USER_CANCEL','SOURCE_COMPLIANCE','VOLTAGE_OVERFLOW','REFERENCE_TEMPERATURE_RANGE','AUTORANGE_UNRESOLVED') else 'none') for e in ERRORS],verification=[],limitations=limits,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('stage.move','probe.set_contact','enclosure.set_open','acquisition.start','calibration.start','power.set'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='宿主推进有限运动、真实等待、热量、预热与逐点观测') for s in SLOTS if s not in v['effects'] and s not in ('plant.configured','wafer.configured','probe.configured','sample.present','power.enabled')] mechanism=dict(component_ids=['controller','source_meter','stage_x','sample_stage','probe_head','sample_wafer','hood'],state_ids=list(slots),meaning_zh='有限圆片薄膜四探针Green几何、首点固定图量程、实际标样反演校准、双接线正反测绘与被动电热质量账',implementation='lumped',equations=[ 'g(z,a)=ln(|z-a|/R)+ln|1-z*conj(a)/R²|; phi(z)=-(Rs*I/(2*pi))*(g(z,a_source)-g(z,a_sink)). For a source/sink pair the circular boundary has zero normal current. V=phi(c)-phi(d).', 'For center collinear equally-spaced probes and R/s→infinity, K=ln(2)/pi and Rs=(pi/ln2)*V/I. Finite disk K is evaluated per site/configuration, not an arbitrary edge multiplier.', 'Configurations A=(source1,sink4,V2-V3),B=(source1,sink3,V2-V4). Rtransfer=(Vpositive-Vnegative)/(Ipositive-Inegative); Rs_config=calibration_gain*Rtransfer/K_config; Rs is the mean of two configurations.', 'rho_output=Rs*thickness_prior only when an independent thickness prior is supplied; no thickness is inferred from a single four-probe resistance experiment.', 'Rs_forward(T,x,y)=rho_reference(T)/t_film * [1+gx*x/R+gy*y/R+gr*(x²+y²)/R²]. This is an explicitly local homogeneous approximation to a synthetic spatial profile, not a global nonuniform-conductivity PDE solve.', 'Rdrive regularizes the same Green source potentials at a declared finite current-contact radius. Iactual=sign(Irequested)*min(abs(Irequested),Vcompliance/(Rdrive+Rcontact),sqrt(20W/(Rdrive+Rcontact)),Isource_range_max), where range max is1A for compliance<=20V and0.1A for>20V through200V; measurement voltage range is independent.', 'Psource=Iactual²*(Rdrive+Rcontact); Psample=Iactual²*Rdrive; Pcontact_export=Iactual²*Rcontact. Ctotal*dT/dt=Psample-G*(T-Ta); Ctotal=Clocal+mfilm*Cpfilm+msubstrate*Cpsubstrate.', 'Detector dz/dt=(gain*V+offset-z)/tau, observed voltage/current follow declared2450 resolution steps; source resolutionFS*5e-5, measured IFS*1e-6 and measured VFS*5e-7.', 'Motion axes advance with explicit finite speed. Stage_xy=-sample_point_xy. Each point spends4*dwell>=1.2s measuring plus motion/settling; initial auto-range trials each use1.2s before locking current for entire map.', 'Calibration waits4*max(dwell,45s)>=180s and obtains gain=external_standard_Rs/observed_uncorrected_Rs. No hidden gain or reference material property is read by inverse.', 'Only host step advances axes, powerup3600s warmup clock, sequence events and electrothermal ODE. Fractional nanoseconds carry across normal60Hz floating timesteps. Samples carry independently ledgered sensible heat when loaded or removed.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=limits) spec=importlib.util.spec_from_file_location('_quadpro_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'four_probe_mapping':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'wafer.configure':(WAFER,WAFER_EXAMPLE),'probe.configure':(PROBE,PROBE_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'standard.load':(STANDARD,STANDARD_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE),'map.configure':(MAP,MAP_EXAMPLE)}) for key,value in SLOTS.items():slots[key]['meaning_zh']=value['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'four_probe_mapping':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418"""HIT5P / ISO179 .5J: real-time nonlinear pendulum and observed empty correction.Manual raising / host catching are external engineering actions, not OEM motors."""from __future__ import annotationsimport copy,importlib.util,json,mathfrom pathlib import Pathimport numpy as npfrom scipy.integrate import solve_ivpPROTOCOL_VERSION='1.0.0';SLUG='zwick_hit5p';ASSET_TYPE_ID='instrument.'+SLUG;CATALOG_ID='CHEM-145'ROOT=Path(__file__).resolve().parents[2];ASSET=ROOT/'assets/expansion_batch04/t1_thermal'/SLUG;LIBRARY_PATH=ASSET/'impact_library.json'RELEASE_ANGLE_RAD=math.radians(135.72);ENCODER_RESOLUTION_RAD=math.radians(.018);NOMINAL_ENERGY_J=.5;STRIKE_RADIUS_M=.25;NOMINAL_SPEED_M_S=2.9GRAVITY_COEFFICIENT_NM=NOMINAL_ENERGY_J/(1-math.cos(RELEASE_ANGLE_RAD));INERTIA_KG_M2=2*NOMINAL_ENERGY_J/(NOMINAL_SPEED_M_S/STRIKE_RADIUS_M)**2;SUPPORT_SPAN_M=.062class ActionRejected(ValueError):pass
def number(unit='1',lo=None,hi=None): s={'type':'number','x-unit':unit} if lo is not None:s['minimum']=lo if hi is not None:s['maximum']=hi return s
def obj(properties):return dict(type='object',properties=properties,required=list(properties),additionalProperties=False)def nullable(s):return {'anyOf':[s,{'type':'null'}]}def array(s,minimum=0,maximum=200001):return dict(type='array',items=s,minItems=minimum,maxItems=maximum)def enum(items):return {'type':'string','enum':items}BOOL={'type':'boolean'};TEXT={'type':'string'};PHASE=enum(['idle','running','succeeded','cancelled','failed'])
def validate(s,v): if 'anyOf' in s: for o in s['anyOf']: try:validate(o,v);return except ActionRejected:pass raise ActionRejected('INVALID_ARGUMENT') k=s.get('type') if k in ('number','integer'): if isinstance(v,bool) or not isinstance(v,(int,float)) or not math.isfinite(v) or k=='integer' and type(v) is not int or not s.get('minimum',-math.inf)<=v<=s.get('maximum',math.inf):raise ActionRejected('INVALID_ARGUMENT') elif k=='object': if not isinstance(v,dict) or set(v)!=set(s['properties']):raise ActionRejected('INVALID_ARGUMENT') for key,value in v.items():validate(s['properties'][key],value) elif k=='array': if not isinstance(v,list) or not s.get('minItems',0)<=len(v)<=s.get('maxItems',math.inf):raise ActionRejected('INVALID_ARGUMENT') for x in v:validate(s['items'],x) elif k=='boolean' and type(v) is not bool:raise ActionRejected('INVALID_ARGUMENT') elif k=='string' and not isinstance(v,str):raise ActionRejected('INVALID_ARGUMENT') elif k=='null' and v is not None:raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']:raise ActionRejected('INVALID_ARGUMENT')
def library():return {r['id']:r for r in json.loads(LIBRARY_PATH.read_text())['templates']}def encoder(angle):return round(angle/ENCODER_RESOLUTION_RAD)*ENCODER_RESOLUTION_RADPLANT_EXAMPLE=dict(ambient_k=296.15,friction_torque_nm=.001,host_raise_speed_rad_s=1.,shield_speed_rad_s=2.,bearing_heat_capacity_j_k=5.,bearing_conductance_w_k=.2,local_sample_heat_capacity_j_k=.01,sample_conductance_w_k=.03,sample_heat_fraction=.8,accept_engineering=True)PLANT=obj(dict(ambient_k=number('K',273.15,323.15),friction_torque_nm=number('N*m',0,.1),host_raise_speed_rad_s=number('rad/s',.01,2),shield_speed_rad_s=number('rad/s',.01,5),bearing_heat_capacity_j_k=number('J/K',.001,1e5),bearing_conductance_w_k=number('W/K',1e-9,1e4),local_sample_heat_capacity_j_k=number('J/K',1e-6,100),sample_conductance_w_k=number('W/K',1e-9,1e4),sample_heat_fraction=number('1',0,1),accept_engineering=BOOL))FIXTURE_EXAMPLE=dict(standard='ISO179_Charpy',pendulum_energy_j=.5,strike_radius_m=.25,support_span_m=.062,release_angle_rad=RELEASE_ANGLE_RAD,accept_effective_inertia=True)FIXTURE=obj(dict(standard=enum(['ISO179_Charpy']),pendulum_energy_j=dict(type='number',enum=[.5],**{'x-unit':'J'}),strike_radius_m=dict(type='number',enum=[.25],**{'x-unit':'m'}),support_span_m=dict(type='number',enum=[.062],**{'x-unit':'m'}),release_angle_rad=dict(type='number',enum=[RELEASE_ANGLE_RAD],**{'x-unit':'rad'}),accept_effective_inertia=BOOL))SAMPLE_EXAMPLE=dict(reference_id='basf_ultradur_b4520',notch='A',length_m=.08,width_m=.01,thickness_m=.004,notch_depth_m=.002,volume_m3=3.192e-6,mass_kg=.00415,specific_heat_capacity_j_kg_k=1200.,initial_temperature_k=296.15,temperature_tolerance_k=2.,host_charpy_strength_j_m2=None,behavior='energy_threshold',no_break_restitution=.2,accept_reference_transfer_and_fracture_proxy=True)SAMPLE=obj(dict(reference_id=TEXT,notch=enum(['A','unnotched']),length_m=number('m',.063,.15),width_m=number('m',.001,.03),thickness_m=number('m',.0005,.02),notch_depth_m=number('m',0,.025),volume_m3=number('m^3',1e-10,.001),mass_kg=number('kg',1e-7,.2),specific_heat_capacity_j_kg_k=number('J/(kg*K)',1,1e5),initial_temperature_k=number('K',200,400),temperature_tolerance_k=number('K',0,30),host_charpy_strength_j_m2=nullable(number('J/m^2',1,1e7)),behavior=enum(['energy_threshold','unbreakable_proxy']),no_break_restitution=number('1',0,1),accept_reference_transfer_and_fracture_proxy=BOOL))METHOD_EXAMPLE=dict(sample_interval_s=.002,timeout_s=10.,remaining_area_prior_m2=3.2e-5)METHOD=obj(dict(sample_interval_s=number('s',.001,.1),timeout_s=number('s',2,60),remaining_area_prior_m2=nullable(number('m^2',1e-12,.1))))ROW=obj(dict(point_index={'type':'integer','x-unit':'1'},time_s=number('s'),encoder_angle_rad=nullable(number('rad')),kind=enum(['sample','impact','apex']),broken=BOOL))VALIDITY=enum(['not_completed','valid','below_working_range','above_working_range','no_break','invalid_speed','temperature_invalid','negative_corrected_energy'])ANALYSIS=obj(dict(release_angle_rad=number('rad',0,math.pi),rebound_angle_rad=number('rad',-math.pi,math.pi),friction_torque_nm=number('N*m',0,1),remaining_area_prior_m2=nullable(number('m^2',1e-12,.1)),outcome=enum(['break','no_break'])))ANALYSIS_OUTPUT=obj(dict(raw_energy_j=number('J'),corrected_energy_j=number('J'),impact_strength_j_m2=nullable(number('J/m^2')),validity=VALIDITY,evidence=TEXT))RESULT=obj(dict(operation_id=nullable(TEXT),phase=PHASE,mode=TEXT,elapsed_s=number('s'),rows=array(ROW),release_angle_rad=nullable(number('rad')),rebound_angle_rad=nullable(number('rad')),raw_energy_j=nullable(number('J')),corrected_energy_j=nullable(number('J')),impact_strength_j_m2=nullable(number('J/m^2')),observed_impact_speed_m_s=nullable(number('m/s')),outcome=enum(['pending','empty','break','no_break']),validity=VALIDITY,terminal_reason=nullable(TEXT),template_source=nullable(TEXT),evidence=TEXT))LEDGER_KEYS=['loaded_mass_kg','removed_mass_kg','sample_mass_kg','mass_residual_kg','loaded_volume_m3','removed_volume_m3','sample_volume_m3','volume_residual_m3','host_work_j','pendulum_kinetic_j','pendulum_potential_j','friction_heat_j','bearing_thermal_j','bearing_heat_export_j','sample_absorbed_j','sample_heat_j','sample_damage_stored_j','sample_thermal_j','sample_heat_export_j','sensible_loaded_j','sensible_removed_j','internal_removed_j','energy_residual_j']LEDGER=obj({k:number('kg' if k.endswith('_kg') else 'm^3' if k.endswith('_m3') else 'J') for k in LEDGER_KEYS})CAPS={}def cap(k,s,o,e,c,meaning,visibility='agent',kind='device_command'):CAPS[k]=dict(input_schema=s,output_schema=o,example_arguments=e,component_ids=[c],function_zh=meaning,visibility=visibility,kind=kind,effects=[])for k,s,e,c in [('plant.configure',PLANT,PLANT_EXAMPLE,'pendulum'),('fixture.configure',FIXTURE,FIXTURE_EXAMPLE,'fixture_base'),('method.configure',METHOD,METHOD_EXAMPLE,'controller')]:cap(k,s,obj(dict(configured=BOOL)),e,c,'配置工程过程、固定ISO179 .5J/62mm夹具或真实观测采样方法','agent' if k=='method.configure' else 'evaluator','configuration')cap('sample.load',SAMPLE,obj(dict(present=BOOL)),SAMPLE_EXAMPLE,'sample_left','载入Charpy真实参考及显式温度/几何/破坏代理','evaluator')cap('sample.remove',obj({}),obj(dict(removed_mass_kg=number('kg'),removed_volume_m3=number('m^3'))),{},'sample_left','取出整条或全部收集碎片,带走质量/显热/损伤能','evaluator')cap('power.set',obj(dict(enabled=BOOL)),obj(dict(enabled=BOOL)),dict(enabled=True),'power_switch','启停电子显示/记录;掉电不删除自由摆机械能')cap('shield.set_open',obj(dict(opened=BOOL)),obj(dict(target_angle_rad=number('rad'))),dict(opened=True),'shield','宿主有限速开合已选可选Charpy局部防碎片罩','evaluator')cap('pendulum.raise',obj({}),obj(dict(target_angle_rad=number('rad'))),{},'pendulum','外部手动抬摆有限速代理;非HIT5P电机或自动回摆','evaluator')cap('pendulum.catch',obj({}),obj(dict(requested=BOOL)),{},'pendulum','请求宿主在下一实际转折点接住,非仪器自带刹车','evaluator')cap('calibration.start',obj({}),obj(dict(operation_id=TEXT)),{},'latch','真实空摆至首个回升峰值,以量化角度估计有效摩擦')cap('calibration.clear',obj({}),obj(dict(valid=BOOL)),{},'controller','清除摩擦校正,不改变机械物理')cap('acquisition.start',obj({}),obj(dict(operation_id=TEXT)),{},'latch','机械释放后的有限时间Charpy冲击和真实角度记录')cap('acquisition.stop',obj({}),obj(dict(phase=PHASE,elapsed_s=number('s'))),{},'controller','只停记录,自由摆/撞击/摩擦仍随step继续,不回滚损伤')cap('acquisition.result',obj({}),RESULT,{},'controller','公开角色统一去选中材料身份的能量与破坏状态','agent','query')cap('analysis.impact',ANALYSIS,ANALYSIS_OUTPUT,dict(release_angle_rad=RELEASE_ANGLE_RAD,rebound_angle_rad=-1.8,friction_torque_nm=.001,remaining_area_prior_m2=3.2e-5,outcome='break'),'controller','从外部量化角度/独立面积先验反演J与J/m²,非Izod J/m','agent','analysis')cap('ledger.read',obj({}),LEDGER,{},'controller','受限机械/热/损伤/质量体积账','evaluator','query')cap('provenance.read',obj({}),obj(dict(current_sample=nullable(TEXT),operation_source=nullable(TEXT))),{},'controller','受限当前和已启动操作来源快照','evaluator','query')cap('sim.step',obj(dict(dt_s=number('s',0,86400))),obj(dict(time_s=number('s'))),dict(dt_s=.02),'controller','唯一宿主时间推进','evaluator','simulation')UNSUPPORTED={'hardware.connect':'无真实仪器通信','robot.load':'无机器人装样或机械抓取验证','measurement.izod':'选ISO179 Charpy,未配Izod','measurement.tensile_impact':'未配拉伸冲击夹具/摆锤','measurement.instrumented_force':'无仪器化锤/高速力电子学','pendulum.oem_motor_return':'本HIT5P配置无已证自动回摆','brake.oem_disc':'本HIT5P无已配盘式制动','thermal.set_temperature':'未选冷却/加热附件','accuracy.certification':'没有标准认证或实测噪声数据'}for k,v in UNSUPPORTED.items():cap(k,obj({}),obj({}),{},'controller',v)SLOTS={}def slot(k,s,u,o,c,meaning,vis='agent'):SLOTS[k]=dict(schema=s,unit=u,origin=o,component=c,meaning=meaning,visibility=vis,write=None)slot('clock.time_s',number('s'),'s','derived','controller','唯一宿主时钟,read不推进')for k in ['plant.configured','fixture.configured','method.configured','sample.present','sample.broken','sample.spent','power.enabled','pendulum.held','latch.engaged','catch.requested','calibration.valid']:slot(k,BOOL,'1','derived','controller','配置/样品/机械边界状态;不是硬件安全认证')slot('pendulum.angle_rad',number('rad'),'rad','scene','pendulum','精确场景角:0竖下,+135.72°释放侧;世界轴−Y,受限不可绕过encoder','evaluator')slot('pendulum.target_angle_rad',number('rad'),'rad','setpoint','pendulum','外部手动抬摆目标,不代表已到达')slot('encoder.angle_rad',nullable(number('rad')),'rad','sensor','controller','0.018°量化角度,分辨率不代表准确度或随机噪声')for k in ['shield.angle_rad','shield.target_angle_rad']:slot(k,number('rad'),'rad','scene' if '.angle' in k else 'setpoint','shield','局部可选防碎片罩角度,0闭合/1.1打开')slot('latch.position_m',number('m'),'m','scene','latch','释放锁扣显示代理,0在正释放角锁入/.004退出,非实测锁扣运动')slot('power.angle_rad',number('rad'),'rad','scene','power_switch','电子电源显示姿态0/.28')slot('fragments.offset_m',number('m'),'m','scene','sample_right','破断后两半视觉分離示意.006m,不是碎片弹道或新增能量','evaluator')slot('calibration.friction_torque_nm',nullable(number('N*m')),'N*m','derived','controller','由实际空摆量化α/β求等效Coulomb摩擦,非隐藏plant参数')slot('measurement.energy_j',nullable(number('J')),'J','sensor','controller','最后外部角度反演校正吸能,量程有效性另读validity;掉电不亮')slot('measurement.validity',VALIDITY,'1','derived','controller','当前测量有效性,.5J所选工作范围.05.. .4J')slot('acquisition.phase',PHASE,'1','derived','controller','异步记录状态,完成/取消不等于机械停摆')slot('acquisition.elapsed_s',number('s'),'s','derived','controller','记录实际时间')slot('acquisition.points',{'type':'integer','x-unit':'1'},'1','derived','controller','采样及明确impact/apex事件行数')for k,u in [('truth.angular_velocity_rad_s','rad/s'),('truth.sample_absorbed_j','J'),('truth.sample_temperature_k','K'),('truth.bearing_temperature_k','K'),('truth.sample_mass_kg','kg')]:slot(k,number(u),u,'process_truth','pendulum','受限非线性摆锤/热库存真值','evaluator')
def analyze_impact(release_angle_rad,rebound_angle_rad,friction_torque_nm,remaining_area_prior_m2,outcome): alpha=abs(release_angle_rad);beta=abs(rebound_angle_rad);raw=GRAVITY_COEFFICIENT_NM*(math.cos(beta)-math.cos(alpha));corrected=raw-friction_torque_nm*(alpha+beta) validity='negative_corrected_energy' if corrected<0 else 'below_working_range' if corrected<.05 else 'above_working_range' if corrected>.4 else 'no_break' if outcome=='no_break' else 'valid' return dict(raw_energy_j=raw,corrected_energy_j=corrected,impact_strength_j_m2=corrected/remaining_area_prior_m2 if remaining_area_prior_m2 is not None and validity=='valid' else None,validity=validity,evidence='external_quantized_angles_and_empty_swing_correction; independent_remaining_area_prior; ISO179_J_per_m2_not_Izod_J_per_m; not_certified_standard_compliance')
class ZwickHit5pRuntime: def __init__(self,instance_id='hit_01'): self.instance_id=instance_id;self.time_ns=0;self._clock_remainder_ns=0.;self.revision=0;self.power=False;self.plant=None;self.fixture=None;self.method=None;self.sample=None;self.reference=None;self.source=None self.theta=0.;self.omega=0.;self.mechanical='held';self.raise_target=0.;self._raise_start_ns=0;self._raise_end_ns=0;self._raise_angle0=0.;self._raise_started=False;self._raise_rate=0.;self.shield=1.1;self.shield_target=1.1;self.shield_start=1.1;self.shield_start_ns=0;self.shield_end_ns=0;self.catch_requested=False;self._segment=None;self._pending_impact=False;self._first_apex=False self.broken=False;self.spent=False;self.absorbed=0.;self.damage=0.;self.bearing_U=0.;self.sample_U=0.;self.calibration=None;self.phase='idle';self.operation_id=None;self.mode='none';self.elapsed=0.;self.rows=[];self._counter=0;self.terminal_reason=None;self._operation_source=None;self._release_observed=None;self._rebound_observed=None;self._observed_speed=None;self._outcome='pending';self._validity='not_completed';self._analysis=None;self.last_energy=None;self.records={};self._principals={};self._requests={};self._owners={};self._cancel_operations={} self.book={k:0. for k in ['loaded_mass_kg','removed_mass_kg','loaded_volume_m3','removed_volume_m3','host_work_j','friction_heat_j','bearing_heat_export_j','sample_absorbed_j','sample_heat_j','sample_heat_export_j','sensible_loaded_j','sensible_removed_j','internal_removed_j']} @property def time_s(self):return self.time_ns/1e9 def register_principal(self,name,visibility): if not isinstance(name,str) or not name or visibility not in ('agent','evaluator','debug') or name in self._principals:raise ActionRejected('INVALID_ARGUMENT') self._principals[name]=visibility def session(self,name): if name not in self._principals:raise ActionRejected('ACCESS_DENIED') return ZwickHit5pSession(self,name) def _mass(self):return self.sample['mass_kg'] if self.sample else 0. def _capacity(self):return self.plant['local_sample_heat_capacity_j_k']+(self._mass()*self.sample['specific_heat_capacity_j_kg_k'] if self.sample else 0.) def _temperature(self):return self.plant['ambient_k']+self.sample_U/self._capacity() if self.plant else 296.15 def _energy(self):return .5*INERTIA_KG_M2*self.omega**2+GRAVITY_COEFFICIENT_NM*(1-math.cos(self.theta)) def _latch(self):return self.mechanical=='held' and abs(self.theta-RELEASE_ANGLE_RAD)<1e-10 def _shield_moving(self):return self.time_ns<self.shield_end_ns def _temperature_valid(self): if not self.sample:return True t=self._temperature();ref=self.reference.get('reference_temperature_K');domain=self.reference.get('valid_temperature_range_K');tol=self.sample['temperature_tolerance_k'] return (ref is None or abs(t-ref)<=tol+1e-9) and (not domain or abs(domain[1]-domain[0])<1e-9 or domain[0]<=t<=domain[1]) and abs(t-self.sample['initial_temperature_k'])<=tol+1e-9 def read(self,visibility='agent'): d={'clock.time_s':self.time_s,'plant.configured':self.plant is not None,'fixture.configured':self.fixture is not None,'method.configured':self.method is not None,'sample.present':self.sample is not None,'sample.broken':self.broken,'sample.spent':self.spent,'power.enabled':self.power,'pendulum.held':self.mechanical=='held','latch.engaged':self._latch(),'catch.requested':self.catch_requested,'calibration.valid':self.calibration is not None,'pendulum.angle_rad':self.theta,'pendulum.target_angle_rad':self.raise_target,'encoder.angle_rad':encoder(self.theta) if self.power else None,'shield.angle_rad':self.shield,'shield.target_angle_rad':self.shield_target,'latch.position_m':0. if self._latch() else .004,'power.angle_rad':.28 if self.power else 0.,'fragments.offset_m':.006 if self.broken and self.sample else 0.,'calibration.friction_torque_nm':self.calibration,'measurement.energy_j':self.last_energy if self.power else None,'measurement.validity':self._validity,'acquisition.phase':self.phase,'acquisition.elapsed_s':self.elapsed,'acquisition.points':len(self.rows),'truth.angular_velocity_rad_s':self.omega,'truth.sample_absorbed_j':self.absorbed,'truth.sample_temperature_k':self._temperature(),'truth.bearing_temperature_k':self.plant['ambient_k']+self.bearing_U/self.plant['bearing_heat_capacity_j_k'] if self.plant else 296.15,'truth.sample_mass_kg':self._mass()} return {k:copy.deepcopy(v) for k,v in d.items() if visibility!='agent' or SLOTS[k]['visibility']=='agent'} def ledger(self): b=copy.deepcopy(self.book);m=self._mass();v=self.sample['volume_m3'] if self.sample else 0.;b.update(sample_mass_kg=m,mass_residual_kg=b['loaded_mass_kg']-b['removed_mass_kg']-m,sample_volume_m3=v,volume_residual_m3=b['loaded_volume_m3']-b['removed_volume_m3']-v,pendulum_kinetic_j=.5*INERTIA_KG_M2*self.omega**2,pendulum_potential_j=GRAVITY_COEFFICIENT_NM*(1-math.cos(self.theta)),bearing_thermal_j=self.bearing_U,sample_damage_stored_j=self.damage,sample_thermal_j=self.sample_U) b['energy_residual_j']=b['host_work_j']+b['sensible_loaded_j']-b['sensible_removed_j']-b['internal_removed_j']-b['bearing_heat_export_j']-b['sample_heat_export_j']-self._energy()-self.bearing_U-self.sample_U-self.damage;return b def _record(self,kind='sample'): self.rows.append(dict(point_index=len(self.rows),time_s=self.time_s,encoder_angle_rad=encoder(self.theta) if self.power else None,kind=kind,broken=self.broken)) def _finish(self,phase,reason): self.phase=phase;self.terminal_reason=reason if self.operation_id:self.records[self.operation_id]=self._result(use_cache=False) def _result(self,use_cache=True): if use_cache and self.phase!='running' and self.operation_id in self.records:return copy.deepcopy(self.records[self.operation_id]) a=self._analysis or {};return dict(operation_id=self.operation_id,phase=self.phase,mode=self.mode,elapsed_s=self.elapsed,rows=copy.deepcopy(self.rows),release_angle_rad=self._release_observed,rebound_angle_rad=self._rebound_observed,raw_energy_j=a.get('raw_energy_j'),corrected_energy_j=a.get('corrected_energy_j'),impact_strength_j_m2=a.get('impact_strength_j_m2'),observed_impact_speed_m_s=self._observed_speed,outcome=self._outcome,validity=self._validity,terminal_reason=self.terminal_reason,template_source=self._operation_source,evidence='synthetic_forward_model; actual_quantized_encoder_trajectory; ISO179_manufacturer_material_reference_plus_explicit_energy_threshold_no_break_thermal_transfer_assumptions; not_native_material_curve') def _cool(self,dt,bearing_power=0.): if not self.plant:return C=self.plant['bearing_heat_capacity_j_k'];G=self.plant['bearing_conductance_w_k'];old=self.bearing_U;new=old*math.exp(-G*dt/C)+bearing_power*C/G*(-math.expm1(-G*dt/C));self.bearing_U=new;self.book['bearing_heat_export_j']+=old+bearing_power*dt-new C=self._capacity();G=self.plant['sample_conductance_w_k'];old=self.sample_U;self.sample_U=old*math.exp(-G*dt/C);self.book['sample_heat_export_j']+=old-self.sample_U def _new_segment(self): if self.mechanical!='free':return torque=self.plant['friction_torque_nm'];gravity=-GRAVITY_COEFFICIENT_NM*math.sin(self.theta) if abs(self.omega)<1e-10 and abs(gravity)<=torque+1e-12:self.omega=0.;self.mechanical='held';self.catch_requested=False;self._segment=None;return direction=math.copysign(1,self.omega if abs(self.omega)>1e-10 else gravity);C_b=self.plant['bearing_heat_capacity_j_k'];G_b=self.plant['bearing_conductance_w_k'];C_s=self._capacity();G_s=self.plant['sample_conductance_w_k'] def rhs(t,y): P=torque*direction*y[1];return [y[1],(-GRAVITY_COEFFICIENT_NM*math.sin(y[0])-torque*direction)/INERTIA_KG_M2,P,P-G_b*y[3]/C_b,-G_s*y[4]/C_s,G_b*y[3]/C_b,G_s*y[4]/C_s] event_kind='impact' if self._pending_impact else 'apex' def event(t,y):return y[0] if event_kind=='impact' else y[1] event.terminal=True;event.direction=-1 if event_kind=='impact' or direction>0 else 1 y0=np.array([self.theta,self.omega,0.,self.bearing_U,self.sample_U,0.,0.]);sol=solve_ivp(rhs,[0,10],y0,events=event,dense_output=True,method='DOP853',rtol=2e-12,atol=2e-14,max_step=.02) if not sol.success or not len(sol.t_events[0]):raise RuntimeError('Pendulum event integration failed') duration=float(sol.t_events[0][0]);end=self.time_ns+max(1,round(duration*1e9));self._segment=dict(start_ns=self.time_ns,end_ns=end,duration=duration,solution=sol.sol,last_y=y0,event=event_kind) def _propagate_free(self,nxt): s=self._segment;t=s['duration'] if nxt==s['end_ns'] else (nxt-s['start_ns'])/1e9;y=s['solution'](t);old=s['last_y'];self.theta=float(y[0]);self.omega=float(y[1]);self.book['friction_heat_j']+=float(y[2]-old[2]);self.bearing_U=float(y[3]);self.sample_U=float(y[4]);self.book['bearing_heat_export_j']+=float(y[5]-old[5]);self.book['sample_heat_export_j']+=float(y[6]-old[6]);s['last_y']=y def _physical_impact(self): self.theta=0.;self._pending_impact=False;self._first_apex=True if self.phase=='running': previous=[r for r in self.rows if r['kind']=='sample' and r['encoder_angle_rad'] is not None][-2:] if len(previous)==2:self._observed_speed=abs((previous[-1]['encoder_angle_rad']-previous[-2]['encoder_angle_rad'])/(previous[-1]['time_s']-previous[-2]['time_s']))*STRIKE_RADIUS_M self._record('impact') if self.sample and not self.spent: available=.5*INERTIA_KG_M2*self.omega**2;required=self.break_energy if required is not None and available>=required: lost=required;self.omega=-math.sqrt(max(0,2*(available-lost)/INERTIA_KG_M2));self.broken=True;self._outcome='break' else: retained=available*self.sample['no_break_restitution']**2;lost=available-retained;self.omega=math.sqrt(max(0,2*retained/INERTIA_KG_M2));self._outcome='no_break' heat=lost*self.plant['sample_heat_fraction'];self.absorbed+=lost;self.book['sample_absorbed_j']+=lost;self.book['sample_heat_j']+=heat;self.sample_U+=heat;self.damage+=lost-heat;self.spent=True else: if self.phase=='running':self._outcome='empty' if abs(self.omega)<1e-10:self.mechanical='held';self._physical_apex() def _physical_apex(self): self.omega=0. if self._first_apex: self._first_apex=False if self.phase=='running': self._rebound_observed=encoder(self.theta);self._record('apex') if self.mode=='calibration': alpha=abs(self._release_observed);beta=abs(self._rebound_observed);estimate=GRAVITY_COEFFICIENT_NM*(math.cos(beta)-math.cos(alpha))/(alpha+beta) if estimate<0:self._finish('failed','INVALID_EMPTY_SWING') else:self.calibration=estimate;self._validity='valid';self._analysis=analyze_impact(alpha,beta,estimate,None,'no_break');self._finish('succeeded','empty_swing_completed') else: self._analysis=analyze_impact(self._release_observed,self._rebound_observed,self.calibration,self.method['remaining_area_prior_m2'],self._outcome);self._validity=self._analysis['validity'];self.last_energy=self._analysis['corrected_energy_j'] if not self._temperature_valid():self._validity='temperature_invalid';self._analysis['impact_strength_j_m2']=None elif self._observed_speed is None or not 2.9*.9<=self._observed_speed<=2.9*1.1:self._validity='invalid_speed';self._analysis['impact_strength_j_m2']=None self._finish('succeeded' if self._validity in ('valid','no_break') else 'failed',self._validity) if self.catch_requested:self.mechanical='held';self.catch_requested=False self._segment=None def invoke(self,capability_id,**arguments): if capability_id not in CAPS:raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability_id]['input_schema'],arguments);k=capability_id;a=copy.deepcopy(arguments) if k in UNSUPPORTED:raise ActionRejected('UNSUPPORTED') if k=='acquisition.result':return self._result() if k=='ledger.read':return self.ledger() if k=='provenance.read':return dict(current_sample=self.source,operation_source=self._operation_source) if k=='analysis.impact':return analyze_impact(**a) if k=='sim.step':self.step(a['dt_s']);return dict(time_s=self.time_s) if self.phase=='running' and k not in ('acquisition.stop','power.set','pendulum.catch'):raise ActionRejected('BUSY') if k=='plant.configure': if self.plant or self.power or self.sample:raise ActionRejected('PLANT_ALREADY_CONFIGURED') if not a['accept_engineering']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') if a['bearing_heat_capacity_j_k']/a['bearing_conductance_w_k']<.001 or a['local_sample_heat_capacity_j_k']/a['sample_conductance_w_k']<.001:raise ActionRejected('THERMAL_TIME_CONSTANT_OUTSIDE_NUMERICAL_DOMAIN') self.plant=a;out=dict(configured=True) elif k=='fixture.configure': if self.sample or self.mechanical!='held':raise ActionRejected('SAMPLE_PRESENT_OR_MOVING') if not a['accept_effective_inertia']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') self.fixture=a;self.calibration=None;out=dict(configured=True) elif k=='method.configure': nanos=a['sample_interval_s']*1e9 if abs(nanos-round(nanos))>1e-4:raise ActionRejected('SAMPLING_GRID_RESOLUTION') self.method=a;out=dict(configured=True) elif k=='sample.load': if not self.plant or not self.fixture:raise ActionRejected('CONFIGURATION_REQUIRED') if self.sample:raise ActionRejected('SAMPLE_PRESENT') if not self._latch() or self.shield<1.1-1e-12 or self._shield_moving():raise ActionRejected('LOADING_GEOMETRY') if not a['accept_reference_transfer_and_fracture_proxy']:raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') if a['notch_depth_m']>=a['width_m'] or a['notch']=='unnotched' and a['notch_depth_m']!=0 or a['notch']=='A' and a['notch_depth_m']<=0:raise ActionRejected('INVALID_NOTCH_GEOMETRY') if a['volume_m3']>a['length_m']*a['width_m']*a['thickness_m']+1e-12:raise ActionRejected('INVALID_VOLUME') ref=library().get(a['reference_id']) if ref is None:raise ActionRejected('UNKNOWN_REFERENCE') nominal=ref.get('reference_temperature_K');domain=ref.get('valid_temperature_range_K');T=a['initial_temperature_k'];tol=a['temperature_tolerance_k'] if nominal is not None and abs(T-nominal)>tol+1e-9 or domain and domain[1]-domain[0]>1e-9 and not domain[0]<=T<=domain[1]:raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') strength=a['host_charpy_strength_j_m2'];field='charpy_notched_impact_strength_J_m2' if a['notch']=='A' else 'charpy_unnotched_impact_strength_J_m2' if strength is None:strength=ref.get(field) if a['behavior']=='energy_threshold' and strength is None:raise ActionRejected('MISSING_CHARPY_REFERENCE_OR_PRIOR') incoming=a['mass_kg']*a['specific_heat_capacity_j_kg_k']*(T-self.plant['ambient_k']);self.sample=a;self.reference=ref;self.source=json.dumps(dict(reference_id=a['reference_id'],source=ref.get('source'),evidence=ref.get('evidence')),sort_keys=True);self.break_energy=None if a['behavior']=='unbreakable_proxy' else strength*(a['width_m']-a['notch_depth_m'])*a['thickness_m'];self.broken=self.spent=False;self.absorbed=self.damage=0.;self.sample_U+=incoming;self.book['sensible_loaded_j']+=incoming;self.book['loaded_mass_kg']+=a['mass_kg'];self.book['loaded_volume_m3']+=a['volume_m3'];out=dict(present=True) elif k=='sample.remove': if not self.sample:raise ActionRejected('NO_SAMPLE') if not self._latch() or self.shield<1.1-1e-12 or self._shield_moving():raise ActionRejected('LOADING_GEOMETRY') mass=self._mass();volume=self.sample['volume_m3'];sensible=mass*self.sample['specific_heat_capacity_j_kg_k']*(self._temperature()-self.plant['ambient_k']);self.book['sensible_removed_j']+=sensible;self.book['internal_removed_j']+=self.damage;self.book['removed_mass_kg']+=mass;self.book['removed_volume_m3']+=volume;self.sample_U-=sensible;self.sample=self.reference=self.source=None;self.broken=self.spent=False;self.absorbed=self.damage=0.;out=dict(removed_mass_kg=mass,removed_volume_m3=volume) elif k=='power.set': if not self.plant:raise ActionRejected('PLANT_REQUIRED') if not a['enabled'] and self.phase=='running':self._finish('cancelled','POWER_OFF') self.power=a['enabled'];out=dict(enabled=self.power) elif k=='shield.set_open': if not self.plant:raise ActionRejected('PLANT_REQUIRED') if self.mechanical!='held':raise ActionRejected('PENDULUM_MOVING') target=1.1 if a['opened'] else 0.;self.shield_start=self.shield;self.shield_target=target;self.shield_start_ns=self.time_ns;self.shield_end_ns=self.time_ns+math.ceil(abs(target-self.shield)/self.plant['shield_speed_rad_s']*1e9);out=dict(target_angle_rad=target) elif k=='pendulum.raise': if not self.plant or not self.fixture:raise ActionRejected('CONFIGURATION_REQUIRED') if self.mechanical!='held':raise ActionRejected('PENDULUM_MOVING') if self.shield>1e-12 or self._shield_moving():raise ActionRejected('SHIELD_OPEN') if self.sample and not self.spent and not self._latch():raise ActionRejected('FRESH_SAMPLE_IN_PATH') self.raise_target=RELEASE_ANGLE_RAD;distance=RELEASE_ANGLE_RAD-self.theta;self._raise_start_ns=self.time_ns;self._raise_end_ns=self.time_ns+math.ceil(abs(distance)/self.plant['host_raise_speed_rad_s']*1e9);self._raise_angle0=self.theta;self._raise_started=False;self._raise_rate=distance/((self._raise_end_ns-self.time_ns)/1e9) if distance else 0.;self.mechanical='raising' if distance else 'held';out=dict(target_angle_rad=self.raise_target) elif k=='pendulum.catch': if self.mechanical!='free':raise ActionRejected('NOT_FREE_SWING') self.catch_requested=True;out=dict(requested=True) elif k=='calibration.clear':self.calibration=None;out=dict(valid=False) elif k in ('calibration.start','acquisition.start'): if not self.power:raise ActionRejected('POWER_OFF') if not self.plant or not self.fixture or not self.method:raise ActionRejected('CONFIGURATION_REQUIRED') if not self._latch():raise ActionRejected('NOT_ARMED') if self.shield>1e-12 or self._shield_moving():raise ActionRejected('SHIELD_OPEN') if k=='calibration.start' and self.sample:raise ActionRejected('EMPTY_REQUIRED') if k=='acquisition.start': if not self.sample:raise ActionRejected('NO_SAMPLE') if self.spent:raise ActionRejected('SAMPLE_SPENT') if self.calibration is None:raise ActionRejected('CALIBRATION_REQUIRED') if not self._temperature_valid():raise ActionRejected('REFERENCE_TEMPERATURE_RANGE') self._counter+=1;self.operation_id=f'{self.instance_id}:swing:{self._counter}';self.phase='running';self.mode='calibration' if k=='calibration.start' else 'impact';self.elapsed=0.;self.rows=[];self.terminal_reason=None;self._operation_source=self.source;self._release_observed=encoder(self.theta);self._rebound_observed=self._observed_speed=None;self._outcome='pending';self._validity='not_completed';self._analysis=None;self._start_ns=self.time_ns;self._end_ns=self.time_ns+round(self.method['timeout_s']*1e9);self._period_ns=round(self.method['sample_interval_s']*1e9);self._sample_ns=self.time_ns+self._period_ns;self.mechanical='free';self._pending_impact=True;self._first_apex=False;self.catch_requested=False;self._segment=None;self._record();out=dict(operation_id=self.operation_id) elif k=='acquisition.stop': if self.phase!='running':raise ActionRejected('NOT_RUNNING') self._finish('cancelled','USER_CANCEL');out=dict(phase=self.phase,elapsed_s=self.elapsed) else:raise ActionRejected('UNKNOWN_CAPABILITY') self.revision+=1;return copy.deepcopy(out) def step(self,dt_s): validate(number('s',0,86400),dt_s);raw=dt_s*1e9+self._clock_remainder_ns;ns=round(raw);self._clock_remainder_ns=raw-ns if not ns:return end=self.time_ns+ns while self.time_ns<end: if self.mechanical=='free' and self._segment is None:self._new_segment() if self.mechanical=='raising' and not self._raise_started: old=self._energy();self.omega=self._raise_rate;self.book['host_work_j']+=self._energy()-old;self._raise_started=True nexts=[end] if self._shield_moving():nexts.append(self.shield_end_ns) if self.mechanical=='free':nexts.append(self._segment['end_ns']) if self.mechanical=='raising':nexts.append(self._raise_end_ns) if self.phase=='running':nexts.extend([self._sample_ns,self._end_ns]) nxt=min(t for t in nexts if t>self.time_ns);dt=(nxt-self.time_ns)/1e9 if self.mechanical=='free':self._propagate_free(nxt) elif self.mechanical=='raising': old=self._energy();self.theta=self._raise_angle0+self._raise_rate*(nxt-self._raise_start_ns)/1e9;heat=self.plant['friction_torque_nm']*abs(self._raise_rate)*dt;self.book['friction_heat_j']+=heat;self.book['host_work_j']+=self._energy()-old+heat;self._cool(dt,heat/dt) else:self._cool(dt) self.time_ns=nxt self.shield=self.shield_target if self.time_ns>=self.shield_end_ns else self.shield_start+(self.shield_target-self.shield_start)*(self.time_ns-self.shield_start_ns)/(self.shield_end_ns-self.shield_start_ns) if self.phase=='running':self.elapsed=(self.time_ns-self._start_ns)/1e9 if self.mechanical=='raising' and self.time_ns==self._raise_end_ns: old=self._energy();self.theta=RELEASE_ANGLE_RAD;self.omega=0.;self.book['host_work_j']+=self._energy()-old;self.mechanical='held' if self.mechanical=='free' and self._segment and self.time_ns==self._segment['end_ns']: kind=self._segment['event'];self._segment=None if kind=='impact':self._physical_impact() else:self._physical_apex() if self.phase=='running' and self.time_ns==self._sample_ns:self._record();self._sample_ns+=self._period_ns if self.phase=='running' and self.time_ns>=self._end_ns:self._finish('failed','OBSERVATION_TIMEOUT') self.revision+=1
class ZwickHit5pSession: def __init__(self, host, principal_id): self._host = host; self._principal = principal_id @property def _role(self): return self._host._principals[self._principal] def _target(self, instance_id): if instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE') def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_zwick_hit5p_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k:v for k,v in meta['capabilities'].items() if v['visibility']=='agent' or self._role!='agent'}, state_slots={k:v for k,v in meta['state_slots'].items() if v['visibility']=='agent' or self._role!='agent'}) def read(self, *, instance_id, state_ids=None): self._target(instance_id); h=self._host; values=h.read(self._role); ids=list(values) if state_ids is None else state_ids if not isinstance(ids,list) or any(not isinstance(k,str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain':'simulation','time_s':h.time_s}, observations={k:dict(value=copy.deepcopy(values[k]),unit=SLOTS[k]['unit'],quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor','derived') else 'valid',sample_time_s=h.time_s,sample_window_s=None) for k in ids}) def _filter_result(self, result): result = copy.deepcopy(result) # A bridge may dispatch agent-visible capabilities through a privileged # session. Public acquisition payloads therefore use the SAME redaction # for every role. Full provenance has its own evaluator-only capability. if 'rows' in result and 'template_source' in result: result['template_source'] = str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record provenance available only through evaluator provenance.read' if result['template_source'] is not None else None result['evidence'] = 'synthetic_forward_model; quantized_encoder_angles_and_observed_empty_swing_correction; manufacturer_ISO179_scalar_reference_and_explicit_fracture_thermal_proxy; selected record restricted' if result['operation_id'] is not None else 'no_measurement' return result def invoke(self, *, instance_id, capability_id, arguments, request_id): h=self._host try: self._target(instance_id) if not isinstance(capability_id,str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role=='agent' and CAPS[capability_id]['visibility']!='agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'],arguments); key=(self._principal,request_id); digest=json.dumps([capability_id,arguments],sort_keys=True,allow_nan=False) if key in h._requests: old,response=h._requests[key] if old!=digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) if capability_id in ('acquisition.stop','acquisition.result') and self._role=='agent' and h.operation_id and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') if capability_id=='power.set' and not arguments['enabled'] and h.phase=='running' and self._role=='agent' and h._owners.get(h.operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=self._filter_result(h.invoke(capability_id,**arguments)); operation=result.get('operation_id') if capability_id in ('acquisition.start','calibration.start') else None if operation: h._owners[operation]=self._principal response=dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=operation,status='accepted' if operation else 'succeeded',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result=result,observations={},error=None) h._requests[key]=(digest,copy.deepcopy(response)); return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION,instance_id=instance_id,request_id=request_id,operation_id=None,status='unsupported' if str(exc)=='UNSUPPORTED' else 'rejected',state_revision=h.revision,clock={'domain':'simulation','time_s':h.time_s},result={},observations={},error=dict(code=str(exc),message=str(exc),retryable=False,side_effects='none')) def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id); entry=SLOTS.get(state_id) if not entry or not entry['write']: raise ActionRejected('ACCESS_DENIED') capability,argument=entry['write']; return self.invoke(instance_id=instance_id,capability_id=capability,arguments={argument:value},request_id=request_id) def poll(self, operation_id): h=self._host if h._owners.get(operation_id)!=self._principal: raise ActionRejected('ACCESS_DENIED') result=h._result() if operation_id==h.operation_id and h.phase=='running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id,status=result['phase'],result=self._filter_result(result)) def cancel(self, operation_id, request_id): self.poll(operation_id); h=self._host if not isinstance(request_id,str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key=(self._principal,request_id) if key in h._cancel_operations: if h._cancel_operations[key]!=operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id!=h.operation_id or h.phase!='running': raise ActionRejected('NOT_RUNNING') result=self.invoke(instance_id=h.instance_id,capability_id='acquisition.stop',arguments={},request_id=request_id) if result['status']=='succeeded': h._cancel_operations[key]=operation_id return result
EFFECTS={ 'plant.configure':['plant.configured','truth.sample_temperature_k','truth.bearing_temperature_k'], 'fixture.configure':['fixture.configured','calibration.valid','calibration.friction_torque_nm'], 'method.configure':['method.configured'], 'sample.load':['sample.present','sample.broken','sample.spent','truth.sample_mass_kg','truth.sample_temperature_k','truth.sample_absorbed_j','fragments.offset_m'], 'sample.remove':['sample.present','sample.broken','sample.spent','truth.sample_mass_kg','truth.sample_temperature_k','truth.sample_absorbed_j','fragments.offset_m'], 'power.set':['power.enabled','power.angle_rad','encoder.angle_rad','measurement.energy_j','acquisition.phase'], 'shield.set_open':['shield.target_angle_rad'], 'pendulum.raise':['pendulum.target_angle_rad','pendulum.held','latch.engaged','latch.position_m'], 'pendulum.catch':['catch.requested'], 'calibration.clear':['calibration.valid','calibration.friction_torque_nm'], 'acquisition.start':['acquisition.phase','acquisition.elapsed_s','acquisition.points','measurement.validity','pendulum.held','latch.engaged','latch.position_m','catch.requested'], 'calibration.start':['acquisition.phase','acquisition.elapsed_s','acquisition.points','measurement.validity','pendulum.held','latch.engaged','latch.position_m','catch.requested'], 'acquisition.stop':['acquisition.phase'], 'sim.step':list(SLOTS)}for k,v in EFFECTS.items():CAPS[k]['effects']=vERRORS=sorted(set(__import__('re').findall(r"ActionRejected\('([A-Z_0-9]+)'",Path(__file__).read_text()))|{'USER_CANCEL','POWER_OFF','OBSERVATION_TIMEOUT','INVALID_EMPTY_SWING'})LIMITATIONS=[ '固定HIT5P / ISO179 Charpy .5J摆锤010930 / 62mm夹具010961,0.5J不是整机最大5J;释放135.72°、摆长250mm、名义2.9m/s±10%、encoder .018°。厂家工作范围10..80%,即.05.. .4J;范围外可报告估计J但不给有效标准化强度。', '本HIT5P配置为机械释放,不配自动回摆和盘式制动。pendulum.raise为外部手动有限速代理,pendulum.catch请求宿主在下一转折点接住并保持;它们不是OEM电机/刹车,也未验证机器人抓取/人手安全。', '当前几何摆轴−Y,0竖下、正角释放侧在+X,负角速度撞击向−X;刀口半径.25m不是所有质量的COM。重力矩K=.5/(1−cosα),有效惯量I=2*.5/(2.9/.25)²由名义规格约束推导,不是独立部件惯量实测。厂家.119kg仅名义总摆锤,70kg整机不当摆锤或热容。', '自由摆I*θddot=−K*sinθ−τeff*sign(ω)。恒定Coulomb有效摩擦为明确空气/轴承合并近似,不解频率相关空气阻力或轴承温变;实际摩擦功τeff*|dθ|进入局部轴承工程热节点。', '空摆首回升峰值提供τcal=K*(cosβ−cosα)/(α+β),完全来自量化encoder角度及名义K,不读取hidden friction。样品Eobs=K*(cosβ−cosα)−τcal*(α+β);角度分辨不等于OEM准确度,无经验noise分布。', '真实厂家61牌号ISO179标量来自各明确温度/缺口工况;N不破、未知值与零吸能不同,绝不把Izod J/m换成Charpy J/m²。原始force/displacement/time曲线缺失,当前前向摆动曲线是synthetic_forward_model。', '宿主接受的energy-threshold代理在实际θ=0时移除参考Charpy强度×剩余截面积的能量;不解接触力峰值、颈缩、裂纹扩展或支点应变。能量不足或unbreakable代理按显式restitution反弹,partial吸能可记录但不能当完整断裂强度。', '瞬时冲击是集总离散事件,不声称全带宽碰撞/力传感;破断角速度由真实能量扣除得到。β比例进入样品热,其余进入损伤/新表面库存;所有碎片留在收集边界,取样才携出mass、显热与损伤能。', '显式非线性/热耦合积分的工程计算域要求bearing C/G及未装样local C/G≥1ms;过快热节点原子拒绝,不把该数值稳定边界当OEM物理限制。', '宿主抬摆轨迹有限速、理想速度约束;启动/停止的惯性能量计入有符号host work,可回收机械能,不假造有限峰值电机功率。被动换热参数为宿主工程输入,无主动温控附件。', '采样按宿主定义时间网格,impact/apex额外事件独立标记;首峰值完成记录后摆锤继续自由摆,cancel/掉电亦不删机械能。没有宿主catch时继续至Coulomb静摩擦可支撑位置,自然停摆不强制回到0。', '默认80×10×4mm、A缺口深2mm,剩余面积32mm²。载入其它过程尺寸不会自动重建固定3D示例;sample mass、volume、Cp为独立宿主先验。破后分离是受限视觉示意,不是碎片弹道或连续变形碰撞表面。', '单温度参考仅在宿主显式容差内作常数近似,不进行不同温度/缺口/速率数据暗中插值。Coulomb校正、工程移植和代理结果不构成ISO179认证。', '精确场景摆角/片段位置及过程能量受限evaluator,agent使用量化encoder;所有角色普通结果/poll都隐藏选中牌号/来源。完整来源仅provenance.read;共享磁盘/Python不构成OS隔离。']def export_zwick_hit5p_contract_metadata(): slots={};caps={} for k,v in SLOTS.items():slots[k]=dict(meaning_zh=v['meaning'],component_ids=[v['component']],value_schema=copy.deepcopy(v['schema']),unit=v['unit'],reference_conditions='SI; selected HIT5P ISO179 Charpy0.5J / .25m /135.72deg /62mm span; external manual raise/catch.',origin=v['origin'],visibility=v['visibility'],access='read_only',read_binding=dict(backend='host',artifact_id='runtime',accessor=f'ZwickHit5pSession.read(state_ids=[{k!r}])'),write_via=None,sampling=dict(mode='instant',time_domain='simulation',window_description='Pure read; encoder quantized0.018deg; rows on method time grid with separate impact/apex events.'),source_ids=['simulation_assumption']) for k,v in CAPS.items(): un=k in UNSUPPORTED;async_=k in ('acquisition.start','calibration.start');caps[k]={key:copy.deepcopy(v[key]) for key in ['input_schema','output_schema','component_ids','function_zh','kind','visibility','example_arguments']} caps[k].update(availability='unsupported' if un else 'implemented',implementation={layer:'absent' if un or layer in ('scene','robot','hardware') else 'implemented' for layer in ['process','scene','robot','hardware','host']},binding=None if un else dict(backend='host',artifact_id='runtime',entrypoint='asset_runtime.zwick_hit5p.ZwickHit5pSession.invoke',invocation=f'session.invoke(instance_id="hit_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'),preconditions=[] if un or v['kind'] in ('query','analysis') else [dict(description_zh='入口原子核对ISO179 .5J选型、抬摆锁止、罩位置、空摆校准和实际样品前提。',state_ids=['power.enabled','sample.present','pendulum.held','latch.engaged','shield.angle_rad','acquisition.phase'],enforced_by='runtime',check='ZwickHit5pRuntime.invoke')],state_effects=[dict(state_id=s,timing='on_step' if k=='sim.step' else 'immediate',description_zh='设定或操作标志;真实机械/温度/角度读数仅step推进') for s in v['effects']],observes=[],model_effects=dict(mode='none',description_zh='运行层输出供scene独立绑定验证的状态,不直接写几何',binding_ids=[]),execution=dict(mode='asynchronous' if async_ else 'synchronous',time_domain='simulation',completion_criterion='释放、实际冲击和首回升角观测完成;记录结束不代表机械停摆' if async_ else '原子配置/外部动作请求,实际状态由step推进',completion_state_ids=['acquisition.phase'] if async_ else [],timeout_s=None,cancellation='supported' if async_ else 'unsupported',retry='same_request_id',resources=['host_clock','pendulum','ISO179_fixture','encoder'],partial_failure_zh='停止记录保留全部已点/机械能/破坏/热与库存;自由摆继续至外部catch或自然静止。'),errors=[dict(code=e,meaning_zh=e,side_effects='partial' if async_ and e in ('USER_CANCEL','POWER_OFF','OBSERVATION_TIMEOUT','INVALID_EMPTY_SWING') else 'none') for e in ERRORS],verification=[],limitations=LIMITATIONS,source_ids=['manufacturer_primary','simulation_assumption','template_library']) if k in ('acquisition.start','calibration.start','pendulum.raise','pendulum.catch','shield.set_open'): caps[k]['state_effects'] += [dict(state_id=s,timing='on_step',description_zh='由统一宿主时钟推进非线性摆动、摩擦/冲击/被动热及量化encoder') for s in SLOTS if s not in v['effects'] and SLOTS[s]['origin'] in ('sensor','derived','scene','process_truth')] mechanism=dict(component_ids=['pendulum','striker','latch','fixture_base','sample_left','sample_right','controller'],state_ids=list(slots),meaning_zh='ISO179 .5J非线性摆动、实际空摆角度摩擦校正、能量阈值破坏/反弹和可守恒热库存',implementation='lumped',equations=['Kgrav=.5/(1-cos(alpha)); I=2*.5/(2.9/.25)^2; alpha=135.72deg.','Emechanical=0.5*I*omega²+Kgrav*(1-cos(theta)); I*domega/dt=-Kgrav*sin(theta)-tau*sign(omega).','Pfriction=tau*abs(omega); passive bearing/sample heat nodes retain and export energy.','At theta=0: break iff kinetic>=explicit threshold aCharpy*Aremaining; omega_after=-sqrt(2*(kinetic-threshold)/I).','No-break: omega_after=+restitution*abs(omega_before), absorbed=(1-restitution²)*kinetic; no complete-break strength inferred.','Qsample=heat_fraction*absorbed; remaining absorbed stored as damage/surface energy.','Calibration from observed empty alpha,beta: tau_est=Kgrav*(cos(beta)-cos(alpha))/(alpha+beta).','Observed absorbed energy=Kgrav*(cos(beta)-cos(alpha))-tau_est*(alpha+beta); aCharpy=Eobs/Aremaining_prior only for complete valid break and supplied independent area.','External host raising: dWhost=dEmechanical+dQfriction, including ideal velocity boundary kinetic change; at-turn catch imposes hold at omega0 without energy deletion.','Host sole clock; free-flight dense ODE segments anchored at physical events and integer-nanosecond sampling grid with fractional-nanosecond carry.'],parameters={},source_ids=['simulation_assumption','template_library'],limitations=LIMITATIONS) spec=importlib.util.spec_from_file_location('_hit_local_annotations',ROOT/'scripts/asset_runtime/_annotations.py');ann=importlib.util.module_from_spec(spec);spec.loader.exec_module(ann);ann.KEY_ZH.update({k:v['meaning'] for k,v in SLOTS.items()});ann.annotate_export(SLUG,caps,slots,{'charpy_pendulum':mechanism},inputs={'plant.configure':(PLANT,PLANT_EXAMPLE),'fixture.configure':(FIXTURE,FIXTURE_EXAMPLE),'sample.load':(SAMPLE,SAMPLE_EXAMPLE),'method.configure':(METHOD,METHOD_EXAMPLE)}) for k,v in SLOTS.items():slots[k]['meaning_zh']=v['meaning'] return dict(asset_type_id=ASSET_TYPE_ID,catalog_id=CATALOG_ID,capabilities=caps,state_slots=slots,mechanisms={'charpy_pendulum':mechanism})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350"""CHEM-146 ZwickRoell Mflow 1128610 extrusion plastometer runtime (ISO 1133 methods A and B, SI units).
Physics owned by the host clock (``step`` is the only entry that advances time): * barrel/furnace lumped heat node with a PI controller (heater limited by an explicit engineering power), ambient loss; * polymer charge: enthalpy with sensible + latent (melting range) terms, pellet compaction (bulk -> melt density), heat exchange with the barrel, thermal-history clock above the melting onset; * die flow: reference MVR of the selected manufacturer record transferred to the actual condition with explicit host priors (power-law index n, flow activation energy Ea, thermal-history rate) and the piston friction: Q = MVR_ref * ((m g - F_f) / (m_ref g))^(1/n) * exp(-(Ea / (n R)) (1/T - 1/T_ref)) * exp(k_h t_hist) * phi^3 ; * piston rides on the charge column (compaction + extrusion), weight potential energy -> friction heat (barrel) and pressure work (charge); manual host withdraw / insert at finite speed; * automatic cutter: alternate blade half turns, the strand is severed when the blade crosses pi/2; * external RS-232 analytical balance proxy with settling time, resolution, gain/offset (no built-in balance); * displacement encoder (0.003 mm), time base (0.002 s), temperature display (0.01 K) quantisation.A single MVR/MFR scalar does not identify the rheology: n, Ea, melt density, cp, latent heat, compaction and history areexplicit host priors (evidence = assumption). The observed results are computed only from quantised observations."""from __future__ import annotations
import copyimport jsonimport mathimport refrom pathlib import Path
PROTOCOL_VERSION = '1.0.0'SLUG = 'zwick_mflow'ASSET_TYPE_ID = 'instrument.' + SLUGCATALOG_ID = 'CHEM-146'ROOT = Path(__file__).resolve().parents[2]ASSET = ROOT / 'assets/expansion_batch04/t1_thermal' / SLUGLIBRARY_PATH = ASSET / 'melt_flow_library.json'
# ---------------------------------------------------------------- documented / standard constantsGRAVITY = 9.80665GAS_CONSTANT = 8.314462618BARREL_DIAMETER_M = 0.00955 # 1128612 (documented)PISTON_HEAD_DIAMETER_M = 0.009474 # ISO 1133-1 piston headSTANDARD_AREA_M2 = math.pi / 4 * ((BARREL_DIAMETER_M + PISTON_HEAD_DIAMETER_M) / 2) ** 2 # ISO mean area, 0.711 cm^2DIE_DIAMETER_M = 0.002095 # 312342 (documented)DIE_LENGTH_M = 0.008DIE_AREA_M2 = math.pi * DIE_DIAMETER_M ** 2 / 4BARREL_LENGTH_M = 0.180PISTON_TRAVEL_M = BARREL_LENGTH_MPISTON_LOAD_KG = 0.325 # the piston alone is the 0.325 kg load stage (documented)LOAD_RANGE_KG = (0.325, 21.6) # documented total test load rangeTEMPERATURE_RANGE_K = (323.15, 723.15) # documented 50 .. 450 degCENCODER_RESOLUTION_M = 3e-6 # documented 0.003 mmTIME_RESOLUTION_S = 0.002 # documented 0.002 sTEMPERATURE_DISPLAY_RESOLUTION_K = 0.01 # documented "< 0.1 K"; this model shows 0.01 K stepsCONNECTED_APPARENT_POWER_VA = 700.0 # documented 0.7 kVA full load (not the heater power)MFR_RANGE_KG_S = (0.1e-3 / 600, 2000e-3 / 600) # product page approx. 0.1 .. 2000 g/10 min# transducer arm (same geometry as outputs/.../interface_definition.py; checked by the tests)SENSOR_ZERO_POSITION_M = 0.050SENSOR_ARM_LENGTH_M = 0.140SENSOR_ELEVATION_MAX_RAD = 0.42SENSOR_REFERENCE_ELEVATION_RAD = math.asin(-SENSOR_ZERO_POSITION_M / SENSOR_ARM_LENGTH_M)SENSOR_RANGE_M = (0.0, SENSOR_ZERO_POSITION_M + SENSOR_ARM_LENGTH_M * math.sin(SENSOR_ELEVATION_MAX_RAD))CUTTER_TRAVEL_RAD = math.piPOWER_SWITCH_ON_RAD = 0.28MAX_SUBSTEP_S = 0.05MIN_PISTON_M = 0.005 # the piston must stay above the die (end of usable charge)LIVE_MVR_WINDOW_S = 4.0
class ActionRejected(ValueError): pass
# ---------------------------------------------------------------- schema helpersdef number(unit='1', lo=None, hi=None): s = {'type': 'number', 'x-unit': unit} if lo is not None: s['minimum'] = lo if hi is not None: s['maximum'] = hi return s
def obj(properties): return dict(type='object', properties=properties, required=list(properties), additionalProperties=False)
def nullable(s): return {'anyOf': [s, {'type': 'null'}]}
def array(s, minimum=0, maximum=200001): return dict(type='array', items=s, minItems=minimum, maxItems=maximum)
def enum(items): return {'type': 'string', 'enum': list(items)}
BOOL = {'type': 'boolean'}TEXT = {'type': 'string'}INT = {'type': 'integer', 'x-unit': '1'}PHASE = enum(['idle', 'running', 'succeeded', 'cancelled', 'failed'])
def validate(s, v): if 'anyOf' in s: for o in s['anyOf']: try: validate(o, v) return except ActionRejected: pass raise ActionRejected('INVALID_ARGUMENT') k = s.get('type') if k in ('number', 'integer'): if isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v) or (k == 'integer' and type(v) is not int): raise ActionRejected('INVALID_ARGUMENT') if not s.get('minimum', -math.inf) <= v <= s.get('maximum', math.inf): raise ActionRejected('INVALID_ARGUMENT') elif k == 'object': if not isinstance(v, dict) or set(v) != set(s['properties']): raise ActionRejected('INVALID_ARGUMENT') for key, value in v.items(): validate(s['properties'][key], value) elif k == 'array': if not isinstance(v, list) or not s.get('minItems', 0) <= len(v) <= s.get('maxItems', math.inf): raise ActionRejected('INVALID_ARGUMENT') for x in v: validate(s['items'], x) elif k == 'boolean' and type(v) is not bool: raise ActionRejected('INVALID_ARGUMENT') elif k == 'string' and not isinstance(v, str): raise ActionRejected('INVALID_ARGUMENT') elif k == 'null' and v is not None: raise ActionRejected('INVALID_ARGUMENT') if 'enum' in s and v not in s['enum']: raise ActionRejected('INVALID_ARGUMENT')
_LIBRARY = None
def library(): global _LIBRARY if _LIBRARY is None: _LIBRARY = {r['id']: r for r in json.loads(LIBRARY_PATH.read_text())['templates']} return _LIBRARY
def quantize(value, step): return round(value / step) * step
def sensor_arm_angle(position_m): """Transducer-arm joint angle (0 = reference pose, piston on the die); upper stop beyond ~107 mm.""" s = (position_m - SENSOR_ZERO_POSITION_M) / SENSOR_ARM_LENGTH_M if s >= math.sin(SENSOR_ELEVATION_MAX_RAD): elevation = SENSOR_ELEVATION_MAX_RAD else: elevation = math.asin(max(s, math.sin(SENSOR_REFERENCE_ELEVATION_RAD))) return elevation - SENSOR_REFERENCE_ELEVATION_RAD
# ---------------------------------------------------------------- inputsPLANT_EXAMPLE = dict(ambient_k=296.15, barrel_heat_capacity_j_k=900.0, barrel_loss_w_k=0.55, heater_max_w=450.0, controller_gain_w_k=80.0, controller_integral_s=120.0, sample_conductance_w_k=0.25, piston_friction_n=0.30, manual_piston_speed_m_s=0.02, cutter_half_turn_s=0.25, accept_engineering=True)PLANT = obj(dict(ambient_k=number('K', 273.15, 323.15), barrel_heat_capacity_j_k=number('J/K', 100.0, 5000.0), barrel_loss_w_k=number('W/K', 0.01, 10.0), heater_max_w=number('W', 10.0, CONNECTED_APPARENT_POWER_VA), controller_gain_w_k=number('W/K', 1.0, 2000.0), controller_integral_s=number('s', 5.0, 10000.0), sample_conductance_w_k=number('W/K', 0.001, 20.0), piston_friction_n=number('N', 0.0, 3.0), manual_piston_speed_m_s=number('m/s', 0.001, 0.1), cutter_half_turn_s=number('s', 0.05, 5.0), accept_engineering=BOOL))SAMPLE_EXAMPLE = dict(reference_id='basf_ultradur_b4520', reference_temperature_k=523.15, reference_load_kg=2.16, mass_kg=0.0060, bulk_density_kg_m3=800.0, melt_density_kg_m3=1110.0, specific_heat_j_kg_k=1900.0, initial_temperature_k=296.15, melting_low_k=488.15, melting_high_k=498.15, latent_heat_j_kg=48000.0, power_law_index=0.75, activation_energy_j_mol=50000.0, history_rate_per_s=5e-5, accept_rheology_thermal_density_and_packing_assumptions=True)SAMPLE = obj(dict(reference_id=TEXT, reference_temperature_k=number('K', 323.15, 723.15), reference_load_kg=number('kg', 0.325, 21.6), mass_kg=number('kg', 1e-4, 0.02), bulk_density_kg_m3=number('kg/m^3', 100.0, 3000.0), melt_density_kg_m3=number('kg/m^3', 300.0, 3000.0), specific_heat_j_kg_k=number('J/(kg*K)', 300.0, 5000.0), initial_temperature_k=number('K', 273.15, 373.15), melting_low_k=number('K', 273.15, 723.15), melting_high_k=number('K', 273.15, 723.15), latent_heat_j_kg=number('J/kg', 0.0, 3e5), power_law_index=number('1', 0.2, 1.0), activation_energy_j_mol=number('J/mol', 0.0, 2e5), history_rate_per_s=number('1/s', -0.005, 0.005), accept_rheology_thermal_density_and_packing_assumptions=BOOL))METHOD_EXAMPLE = dict(test_load_kg=2.16, preheat_time_s=300.0, duration_s=240.0, sample_interval_s=0.2, cut_interval_s=10.0, window_upper_m=0.050, window_lower_m=0.020, temperature_tolerance_k=0.5, automatic_weighing=True)METHOD = obj(dict(test_load_kg=number('kg', 0.325, 21.6), preheat_time_s=number('s', 60.0, 3600.0), duration_s=number('s', 1.0, 3600.0), sample_interval_s=number('s', TIME_RESOLUTION_S, 30.0), cut_interval_s=nullable(number('s', 0.5, 600.0)), window_upper_m=number('m', 0.005, 0.075), window_lower_m=number('m', 0.005, 0.075), temperature_tolerance_k=number('K', 0.01, 5.0), automatic_weighing=BOOL))BALANCE_EXAMPLE = dict(resolution_kg=1e-7, gain=1.0, offset_kg=0.0, settling_s=4.0, accept_external_balance_proxy=True)BALANCE = obj(dict(resolution_kg=number('kg', 1e-9, 1e-3), gain=number('1', 0.5, 1.5), offset_kg=number('kg', -1e-3, 1e-3), settling_s=number('s', 0.01, 120.0), accept_external_balance_proxy=BOOL))CAL_ENCODER = obj(dict(observed_low_m=number('m', -0.01, 0.2), observed_high_m=number('m', -0.01, 0.2), reference_low_m=number('m', 0.0, 0.2), reference_high_m=number('m', 0.0, 0.2)))CAL_BALANCE = obj(dict(observed_low_kg=number('kg', -1e-3, 0.2), observed_high_kg=number('kg', -1e-3, 0.2), reference_low_kg=number('kg', 0.0, 0.2), reference_high_kg=number('kg', 0.0, 0.2)))ROW = obj(dict(point_index=INT, time_s=number('s'), encoder_position_m=nullable(number('m')), temperature_k=nullable(number('K')), quality=enum(['ok', 'encoder_out_of_range', 'power_off'])))SEGMENT = obj(dict(segment_id=TEXT, start_time_s=nullable(number('s')), end_time_s=number('s'), duration_s=nullable(number('s')), observed_mass_kg=nullable(number('kg')), status=enum(['unweighed', 'weighing', 'weighed']), measurement_segment=BOOL))FLOW = obj(dict(mvr_m3_s=nullable(number('m^3/s')), mvr_cm3_10min=nullable(number('cm^3/(10min)')), mfr_kg_s=nullable(number('kg/s')), mfr_g_10min=nullable(number('g/(10min)')), density_at_test_temperature_kg_m3=nullable(number('kg/m^3')), window_positions_m=nullable(array(number('m'), 2, 2)), window_times_s=nullable(array(number('s'), 2, 2)), weighed_segments=INT, evidence=TEXT))VALIDITY = enum(['not_completed', 'valid', 'window_not_traversed', 'temperature_out_of_tolerance', 'preheat_below_iso_minimum', 'sample_exhausted', 'cancelled'])RESULT = obj(dict(operation_id=nullable(TEXT), phase=PHASE, elapsed_s=number('s'), test_temperature_k=nullable(number('K')), test_load_kg=nullable(number('kg')), rows=array(ROW), segments=array(SEGMENT, 0, 10000), flow=nullable(FLOW), validity=VALIDITY, terminal_reason=nullable(TEXT), template_source=nullable(TEXT), evidence=TEXT))ANALYSIS = obj(dict(start_position_m=number('m', 0.0, 0.2), end_position_m=number('m', 0.0, 0.2), start_time_s=number('s', 0.0, 1e9), end_time_s=number('s', 0.0, 1e9), area_prior_m2=number('m^2', 1e-6, 1e-3), weighed_segments=array(obj(dict(mass_kg=number('kg', 0.0, 1.0), duration_s=number('s', TIME_RESOLUTION_S, 1e6))), 0, 10000), melt_density_prior_kg_m3=nullable(number('kg/m^3', 100.0, 5000.0))))ANALYSIS_OUTPUT = obj(dict(mvr_m3_s=number('m^3/s'), mvr_cm3_10min=number('cm^3/(10min)'), mfr_kg_s=nullable(number('kg/s')), mfr_g_10min=nullable(number('g/(10min)')), density_derived_mfr_kg_s=nullable(number('kg/s')), density_at_test_temperature_kg_m3=nullable(number('kg/m^3')), evidence=TEXT))LEDGER_KEYS = ['loaded_mass_kg', 'sample_mass_kg', 'strand_mass_kg', 'segments_mass_kg', 'collected_mass_kg', 'removed_mass_kg', 'extruded_mass_kg', 'mass_residual_kg', 'heater_input_j', 'host_work_j', 'loaded_enthalpy_j', 'barrel_thermal_j', 'sample_enthalpy_j', 'load_potential_j', 'ambient_export_j', 'extruded_enthalpy_j', 'removed_enthalpy_j', 'friction_heat_j', 'pressure_work_j', 'energy_residual_j']LEDGER = obj({k: number('kg' if k.endswith('_kg') else 'J') for k in LEDGER_KEYS})
# ---------------------------------------------------------------- capabilitiesCAPS = {}
def cap(k, s, o, e, c, meaning, visibility='agent', kind='device_command'): CAPS[k] = dict(input_schema=s, output_schema=o, example_arguments=e, component_ids=[c], function_zh=meaning, visibility=visibility, kind=kind, effects=[])
CONFIGURED = obj(dict(configured=BOOL))cap('plant.configure', PLANT, CONFIGURED, PLANT_EXAMPLE, 'heater', '宿主声明炉体热容/散热、加热器上限与PI控温参数、活塞摩擦、手动速度和切刀半圈时间(工程参数,须显式接受)', 'evaluator', 'configuration')cap('balance.configure', BALANCE, CONFIGURED, BALANCE_EXAMPLE, 'balance_rs232', '配置外接分析天平代理(分辨率、增益/偏置、稳定时间);Mflow本身没有内置天平', 'evaluator', 'configuration')cap('method.configure', METHOD, CONFIGURED, METHOD_EXAMPLE, 'controller', '设定方法:试验载荷、预热时间、最长采集时间、采样与切断间隔、活塞位移窗口、温度容差、自动称量', 'agent', 'configuration')cap('power.set', obj(dict(enabled=BOOL)), obj(dict(enabled=BOOL)), dict(enabled=True), 'power_switch', '开关整机电源;断电停止加热与切刀、取消进行中的采集,已发生的挤出/热量/切段保留')cap('thermal.set_temperature', obj(dict(target_k=number('K', *TEMPERATURE_RANGE_K))), obj(dict(target_k=number('K'))), dict(target_k=523.15), 'heater', '只写入料筒目标温度(50–450°C);实际温度由PI控温随宿主step演化')cap('weight.configure', obj(dict(total_load_kg=number('kg', *LOAD_RANGE_KG))), obj(dict(total_load_kg=number('kg'))), dict(total_load_kg=2.16), 'test_weight', '宿主��动在活塞上放/换砝码,设定总试验载荷(含0.325kg活塞,不重复加算);砝码势能变化计入宿主功', 'evaluator')cap('sample.load', SAMPLE, obj(dict(present=BOOL, column_height_m=number('m'))), SAMPLE_EXAMPLE, 'barrel', '宿主经漏斗把颗粒/粉末装入料筒(活塞须已抽出);绑定厂家MVR参考记录与显式熔体密度/比热/潜热/幂律/活化能/热历史先验', 'evaluator')cap('sample.remove', obj({}), obj(dict(removed_mass_kg=number('kg'))), {}, 'barrel', '宿主清筒带走剩余料及其焓;已挤出的挤出丝/切段不受影响', 'evaluator')cap('piston.withdraw', obj({}), obj(dict(target_m=number('m'))), {}, 'piston', '宿主以有限速度把活塞(连同砝码)提到料筒口上方;不是气动提升选件', 'evaluator')cap('piston.insert', obj({}), obj(dict(target_m=number('m'))), {}, 'piston', '宿主以有限速度放下活塞,直到压在料柱上(或落到口模上);之后砝码载荷作用于料柱', 'evaluator')cap('cutter.cut', obj({}), obj(dict(requested=BOOL)), {}, 'cutter', '切刀转半圈;刀片经过口模下方(π/2)时切断当前挤出丝,形成一个切段(面板“循环”键同此能力)')CAPS['cutter.cut']['component_ids'] = ['cutter', 'button_cycle']cap('collection.clear', obj({}), obj(dict(collected_mass_kg=number('kg'))), {}, 'collection_tray', '宿主清走收集区全部切段与挂在口模下的挤出丝(称量记录保留)', 'evaluator')cap('balance.weigh', obj(dict(segment_id=TEXT)), obj(dict(requested=BOOL)), dict(segment_id='mflow_01:acq:1:segment:2'), 'balance_rs232', '请求外接分析天平称量一个切段;经过稳定时间后按分辨率/标定给出观测质量')cap('calibration.encoder', CAL_ENCODER, obj(dict(scale=number('1'), offset_m=number('m'))), dict(observed_low_m=0.010, observed_high_m=0.060, reference_low_m=0.010, reference_high_m=0.060), 'displacement_sensor', '用独立长度标准的两点观测修正位移读数(只用宿主给的观测/参考值,不读过程真值)', 'evaluator')cap('calibration.balance', CAL_BALANCE, obj(dict(scale=number('1'), offset_kg=number('kg'))), dict(observed_low_kg=0.0, observed_high_kg=0.001, reference_low_kg=0.0, reference_high_kg=0.001), 'balance_rs232', '用标准砝码两点观测修正外接天平读数', 'evaluator')cap('acquisition.start', obj({}), obj(dict(operation_id=TEXT)), {}, 'button_start', '开始采集:核对通电、方法、试样已装且活塞压在料柱上、载荷与方法一致、预热已满、炉温在容差内;先切一次清除预热期挤出物,再按间隔切段并记录位移/时间/温度')cap('acquisition.stop', obj({}), obj(dict(phase=PHASE, elapsed_s=number('s'))), {}, 'button_stop', '只终止记录与后续自动切断;已挤出物、切段和热状态保留,活塞继续在载荷下下降')cap('acquisition.result', obj({}), RESULT, {}, 'controller', '返回按观测(量化位移/时间、外部称量)计算的MVR/MFR、切段表与有效性;所有角色都隐去所选材料身份', 'agent', 'query')cap('analysis.flow', ANALYSIS, ANALYSIS_OUTPUT, dict(start_position_m=0.050, end_position_m=0.020, start_time_s=0.0, end_time_s=60.0, area_prior_m2=STANDARD_AREA_M2, weighed_segments=[dict(mass_kg=0.0002, duration_s=10.0)], melt_density_prior_kg_m3=None), 'controller', 'ISO 1133纯函数分析:MVR=A·Δx/Δt(A为独立面积先验),MFR=Σm/Σt,按需给出密度换算;不读取过程真值', 'agent', 'analysis')cap('ledger.read', obj({}), LEDGER, {}, 'controller', '受限质量/能量账本(装料、挤出、清筒、热输入、散热、摩擦、压力功、势能)', 'evaluator', 'query')cap('provenance.read', obj({}), obj(dict(current_sample=nullable(TEXT), operation_source=nullable(TEXT))), {}, 'controller', '受限:当前试样与最近采集所用参考记录的来源', 'evaluator', 'query')cap('sim.step', obj(dict(dt_s=number('s', 0.0, 86400.0))), obj(dict(time_s=number('s'))), dict(dt_s=0.2), 'controller', '唯一宿主时间推进(纳秒整数时钟,余数累计)', 'evaluator', 'simulation')UNSUPPORTED = { 'hardware.connect': '无真实Ethernet/RS-232/USB通信或testXpert连接', 'robot.load': '无机器人装料、压实与清筒验证', 'pneumatic.lift': '未选气动砝码提升单元1128621', 'pneumatic.load_selector': '未选带选重器的气动提升单元1128624', 'die.plug': '未选口模塞1128618(高MFR防预流)', 'die.change': '未建模更换口模;固定标准口模312342(手腕一转解锁口模的动作不在本资产能力内)', 'method.astm_c_half_die': '未选半口模325554(ASTM D1238方法C)', 'material.fluorinated_or_pvc': '所选料筒1128612与活塞1128614为非含氟材料用;含氟材料需耐酸料筒1128613/活塞1128615,PVC需口模092326(ASTM D3364),均未选。口模312342本身为烧结耐磨耐酸件、厂家列为含氟与非含氟材料通用', 'cleaning.pneumatic_function': '未选清洗功能1128622', 'preload.function': '未选预热期附加预载1128623', 'piston.preheat_hold': '未选预热位活塞保持装置1128627(可在预热期完全卸载熔体、避免提前流出);本资产预热期由宿主只放活塞0.325kg', 'collection.separating_pane': '未选收集单个挤出物的分隔板1128619', 'thermal.recool': '未选压缩空气回冷单元090173(厂家:平均缩短约50%冷却时间);本资产只有自然冷却', 'accuracy.certification': '没有ISO 1133-2温度准确度认证、天平计量证书或厂家准确度实验',}for k, v in UNSUPPORTED.items(): cap(k, obj({}), obj({}), {}, 'controller', v)
# ---------------------------------------------------------------- state slotsSLOTS = {}
def slot(k, schema, unit, origin, component, meaning, visibility='agent', reference=None): SLOTS[k] = dict(schema=schema, unit=unit, origin=origin, component=component, meaning=meaning, visibility=visibility, reference=reference)
slot('clock.time_s', number('s'), 's', 'derived', 'controller', '宿主时钟;read不推进')for k, c, m in [('plant.configured', 'heater', '工程过程参数已声明'), ('method.configured', 'controller', '方法已设定'), ('balance.configured', 'balance_rs232', '外接天平代理已配置'), ('sample.present', 'barrel', '料筒内有试样'), ('power.enabled', 'power_switch', '整机通电'), ('piston.contact', 'piston', '活塞压在料柱上(载荷作用于试样)'), ('piston.moving', 'piston', '宿主手动升降进行中'), ('cutter.running', 'cutter', '切刀正在转半圈'), ('balance.busy', 'balance_rs232', '外接天平正在稳定/称量'), ('encoder.in_range', 'displacement_sensor', '活塞在位移传感器量程内(约0–107mm)且通电')]: slot(k, BOOL, '1', 'derived', c, m)slot('thermal.target_k', number('K'), 'K', 'setpoint', 'heater', '料筒目标温度,只是目标')slot('thermal.indicated_k', nullable(number('K')), 'K', 'sensor', 'heater', '料筒温度显示(0.01K量化);断电为null;未按ISO 1133-2认证')slot('heater.output_fraction', number('1', 0.0, 1.0), '1', 'derived', 'heater', 'PI控温输出占加热器上限的比例', 'evaluator')slot('weight.total_load_kg', nullable(number('kg')), 'kg', 'setpoint', 'test_weight', '当前放在活塞上的总载荷(含0.325kg活塞);未配置为null')slot('method.test_load_kg', nullable(number('kg')), 'kg', 'setpoint', 'controller', '方法声明的试验载荷,采集开始时须与实际载荷一致')slot('preheat.elapsed_s', nullable(number('s')), 's', 'derived', 'barrel', '装料后经过的时间(预热计时);无试样为null')slot('piston.position_m', number('m', 0.0, PISTON_TRAVEL_M), 'm', 'scene', 'piston', '活塞底面到口模上表面的精确距离(场景关节);agent须通过位移传感器读数观测', 'evaluator', '资产坐标+Z;0=活塞底落在口模上表面,0.180m=抽出到料筒口。')slot('piston.target_m', number('m', 0.0, PISTON_TRAVEL_M), 'm', 'setpoint', 'piston', '宿主最近一次手动升降命令的目标位置(抽出=0.180m,插入=当时料柱高度);不随挤出更新', 'evaluator')slot('sensor_arm.angle_rad', number('rad'), 'rad', 'scene', 'sensor_arm', '位移传感器转臂关节角(0=活塞落在口模上时;滚轮顶住活塞凸环下表面)', 'evaluator', '关节绕水平轴(-√½,-√½,0);仰角=asin((位置-0.050)/0.140),超过约0.107m停在上限位。')slot('cutter.angle_rad', number('rad', 0.0, CUTTER_TRAVEL_RAD), 'rad', 'scene', 'cutter', '切刀刀片转角;0与π为两侧停位,经过π/2时切断挤出丝', 'evaluator', '绕竖直+Z轴;交替半圈0→π→0。')slot('power.angle_rad', number('rad'), 'rad', 'scene', 'power_switch', '后置电源摇臂开关姿态:0关、0.28rad开', 'evaluator')slot('extrudate.length_m', number('m'), 'm', 'scene', 'extrudate_strand', '挂在口模下尚未切断的挤出丝长度(体积/口模截面,忽略离模膨胀,仅供可视)', 'evaluator', '沿−Z自口模出口(z=0.228m)向下;可视上限0.150m。')slot('extrudate.last_cut_length_m', number('m'), 'm', 'scene', 'extrudate_segment', '最近一个切段的长度(仅供可视,清走收集区后为0)', 'evaluator')slot('encoder.position_m', nullable(number('m')), 'm', 'sensor', 'displacement_sensor', '位移传感器读数:活塞位置按0.003mm量化并经两点标定;超量程或断电为null')slot('measurement.live_mvr_m3_s', nullable(number('m^3/s')), 'm^3/s', 'sensor', 'controller', '采集中按最近约4s的量化位移×ISO平均截面0.711cm²估算的实时MVR(屏幕Live MVR);非采集为null', reference='熔体在料筒测试温度下的体积流率(不是23°C固体体积)。')slot('measurement.mvr_m3_s', nullable(number('m^3/s')), 'm^3/s', 'sensor', 'controller', '最近一次完成采集的方法B MVR(位移窗口内的��化观测)', reference='熔体在料筒测试温度下的体积流率;×6e8=cm³/10min。')slot('measurement.mfr_kg_s', nullable(number('kg/s')), 'kg/s', 'sensor', 'controller', '最近一次采集的方法A MFR(已称量测量切段Σm/Σt);未称量为null', reference='质量流率;×6e5=g/10min。')slot('measurement.validity', VALIDITY, '1', 'derived', 'controller', '最近一次采集的有效性')slot('acquisition.phase', PHASE, '1', 'derived', 'controller', '采集状态;停止记录不等于停止挤出')slot('acquisition.elapsed_s', number('s'), 's', 'derived', 'controller', '当前/最近一次采集的经过时间')slot('acquisition.points', INT, '1', 'derived', 'controller', '当前/最近一次采集的记录点数')slot('segments.count', INT, '1', 'derived', 'collection_tray', '收集区内切段数(含清除预热挤出物的首段)')slot('segments.unweighed', INT, '1', 'derived', 'collection_tray', '尚未称量的测量切段数')for k, u, c, m, ref in [('truth.barrel_temperature_k', 'K', 'heater', '料筒/炉体集中热节点真温', None), ('truth.sample_temperature_k', 'K', 'barrel', '由焓反演的试样平均温度', None), ('truth.melt_fraction', '1', 'barrel', '熔融分数(熔程内线性)', None), ('truth.pellet_fraction', '1', 'barrel', '尚未熔实的颗粒质量份额(只减不增;按堆积密度占体积)', None), ('truth.sample_mass_kg', 'kg', 'barrel', '料筒内剩余试样质量', None), ('truth.flow_m3_s', 'm^3/s', 'die', '口模真实体积流率(显式流动代理,不作独立测量)', '熔体在试样温度下的体积流率。'), ('truth.thermal_history_s', 's', 'barrel', '试样高于熔融起点的累计时间', None), ('truth.strand_mass_kg', 'kg', 'extrudate_strand', '挂在口模下的挤出丝质量', None), ('truth.heater_power_w', 'W', 'heater', '加热器瞬时功率', None)]: slot(k, number(u), u, 'process_truth', c, m, 'evaluator', ref)
def analyze_flow(start_position_m, end_position_m, start_time_s, end_time_s, area_prior_m2, weighed_segments, melt_density_prior_kg_m3): """ISO 1133 arithmetic on external observations only (pure function).""" if end_time_s <= start_time_s or start_position_m <= end_position_m: raise ActionRejected('OBSERVATION_DOMAIN') q = (start_position_m - end_position_m) * area_prior_m2 / (end_time_s - start_time_s) total_t = sum(r['duration_s'] for r in weighed_segments) mf = sum(r['mass_kg'] for r in weighed_segments) / total_t if weighed_segments else None return dict(mvr_m3_s=q, mvr_cm3_10min=q * 6e8, mfr_kg_s=mf, mfr_g_10min=None if mf is None else mf * 6e5, density_derived_mfr_kg_s=None if melt_density_prior_kg_m3 is None else q * melt_density_prior_kg_m3, density_at_test_temperature_kg_m3=None if mf is None else mf / q, evidence='ISO1133 method B: area_prior*dx/dt from supplied quantised positions/times; method A: sum(m)/sum(t) of supplied weighings; ' 'density conversion only with a supplied melt density at test temperature')
HISTORY_LN_LIMIT = math.log(1e3) # thermal-history multiplier bounded to 1e-3 .. 1e3 (numerical domain)MAX_ROWS = 200000 # rows per acquisition (duration / sample interval + 1 must stay below)MAX_SEGMENTS = 10000 # segments per acquisition (RESULT schema maxItems); manual cuts share the budget
class ZwickMflowRuntime: """One Mflow instance; the host clock is the only time source (``step``)."""
def __init__(self, instance_id='mflow_01'): self.instance_id = instance_id self.time_ns = 0 self._clock_remainder_ns = 0.0 self.revision = 0 self.plant = None self.method = None self.balance = None self.power = False self.target_k = 296.15 self.T_b = 296.15 self.integral_w = 0.0 self.heater_w = 0.0 self.load_kg = None # piston: position = height of the piston bottom above the die top self.x = PISTON_TRAVEL_M self.x_target = PISTON_TRAVEL_M self.contact = False self._move = None # dict(start_ns, x0, direction, speed, insert) # charge self.sample = None self.reference = None self.reference_cell = None self.source = None self.m_s = 0.0 self.H_s = 0.0 self.m_loaded = 0.0 self.pellet = 0.0 self.t_hist = 0.0 self.load_ns = None self.q_true = 0.0 # extrudate / cutter / balance self.strand_kg = 0.0 self.strand_m3 = 0.0 self.segments = [] # segments currently lying in the collection area self._segment_counter = 0 self.last_cut_length = 0.0 self.cutter_angle = 0.0 self._cut = None # dict(start_ns, mid_ns, end_ns, a0, a1, severed, auto) self._weigh_queue = [] self._weighing = None # dict(segment_id, end_ns) self.encoder_cal = (1.0, 0.0) self.balance_cal = (1.0, 0.0) # acquisitions: each keeps its own method snapshot, rows and segments, so later clears / method changes / # weighings of other segments never rewrite a finished record self.phase = 'idle' self.operation_id = None self.elapsed = 0.0 self.rows = [] self._counter = 0 self.terminal_reason = None self._operation_source = None self._acq = None self._acqs = {} self.validity = 'not_completed' self.flow_result = None self.last_mvr = None self.last_mfr = None self.records = {} self._principals = {} self._requests = {} self._owners = {} self._cancel_operations = {} self.book = {k: 0.0 for k in ['loaded_mass_kg', 'collected_mass_kg', 'removed_mass_kg', 'heater_input_j', 'host_work_j', 'loaded_enthalpy_j', 'ambient_export_j', 'extruded_enthalpy_j', 'removed_enthalpy_j', 'friction_heat_j', 'pressure_work_j']}
# ------------------------------------------------------------ helpers @property def time_s(self): return self.time_ns / 1e9
def register_principal(self, name, visibility): if not isinstance(name, str) or not name or visibility not in ('agent', 'evaluator', 'debug') or name in self._principals: raise ActionRejected('INVALID_ARGUMENT') self._principals[name] = visibility
def session(self, name): if not isinstance(name, str) or name not in self._principals: raise ActionRejected('ACCESS_DENIED') return ZwickMflowSession(self, name)
def _ambient(self): return self.plant['ambient_k'] if self.plant else 296.15
def _phi_of_T(self, T): """Latent fraction used by the equilibrium enthalpy h(T) (a zero-width range melts completely at T >= T_lo).""" s = self.sample lo, hi = s['melting_low_k'], s['melting_high_k'] if hi <= lo: return 1.0 if T >= lo else 0.0 return min(1.0, max(0.0, (T - lo) / (hi - lo)))
def _h_of_T(self, T): s = self.sample return s['specific_heat_j_kg_k'] * (T - self._ambient()) + s['latent_heat_j_kg'] * self._phi_of_T(T)
def _phase_of_h(self, h): """Exact inverse of the piecewise-linear specific enthalpy -> (temperature, melt fraction).
The melt fraction comes from the enthalpy, so a zero-width melting range still needs the whole latent heat.""" s = self.sample cp, L, lo, hi, Ta = s['specific_heat_j_kg_k'], s['latent_heat_j_kg'], s['melting_low_k'], s['melting_high_k'], self._ambient() h_lo = cp * (lo - Ta) h_hi = cp * (hi - Ta) + L if h <= h_lo: return Ta + h / cp, 0.0 if h >= h_hi: return Ta + (h - L) / cp, 1.0 frac = (h - h_lo) / (h_hi - h_lo) return lo + frac * (hi - lo), frac
def _sample_state(self): if not self.sample or self.m_s <= 0: return self._ambient(), 0.0 return self._phase_of_h(self.H_s / self.m_s)
def _sample_T(self): return self._sample_state()[0]
def _phi(self): return self._sample_state()[1]
def _column_height(self): if not self.sample or self.m_s <= 0: return 0.0 s = self.sample return self.m_s * (self.pellet / s['bulk_density_kg_m3'] + (1.0 - self.pellet) / s['melt_density_kg_m3']) / STANDARD_AREA_M2
def _load_mass(self): return PISTON_LOAD_KG if self.load_kg is None else self.load_kg
def _flow(self, T, phi): """True melt volume flow through the die (m^3/s) for the loaded, contacting piston.""" if not (self.sample and self.contact and self.m_s > 0): return 0.0 s, ref = self.sample, self.reference_cell force = self._load_mass() * GRAVITY - self.plant['piston_friction_n'] if force <= 0: return 0.0 n = s['power_law_index'] history = max(-HISTORY_LN_LIMIT, min(HISTORY_LN_LIMIT, s['history_rate_per_s'] * self.t_hist)) return (ref['mvr_m3_s'] * (force / (s['reference_load_kg'] * GRAVITY)) ** (1.0 / n) * math.exp(-(s['activation_energy_j_mol'] / (n * GAS_CONSTANT)) * (1.0 / T - 1.0 / s['reference_temperature_k'])) * math.exp(history) * phi ** 3)
def _encoder(self): if not self.power or not (SENSOR_RANGE_M[0] <= self.x <= SENSOR_RANGE_M[1]): return None scale, offset = self.encoder_cal return quantize(scale * self.x + offset, ENCODER_RESOLUTION_M)
def _indicated_T(self): return quantize(self.T_b, TEMPERATURE_DISPLAY_RESOLUTION_K) if self.power else None
def _live_mvr(self): if self.phase != 'running' or not self.power: return None pts = [r for r in self.rows if r['encoder_position_m'] is not None] if len(pts) < 2: return None last = pts[-1] first = next((r for r in pts if last['time_s'] - r['time_s'] <= LIVE_MVR_WINDOW_S + 1e-9), None) if first is None or last['time_s'] <= first['time_s']: return None return max(0.0, (first['encoder_position_m'] - last['encoder_position_m']) * STANDARD_AREA_M2 / (last['time_s'] - first['time_s']))
def _obs_time(self, t_ns, acq=None): return quantize((t_ns - acq['start_ns']) / 1e9, TIME_RESOLUTION_S) if acq else quantize(t_ns / 1e9, TIME_RESOLUTION_S)
def read(self, visibility='agent'): T_s, phi = self._sample_state() d = {'clock.time_s': self.time_s, 'plant.configured': self.plant is not None, 'method.configured': self.method is not None, 'balance.configured': self.balance is not None, 'sample.present': self.sample is not None, 'power.enabled': self.power, 'piston.contact': self.contact, 'piston.moving': self._move is not None, 'cutter.running': self._cut is not None, 'balance.busy': self._weighing is not None, 'encoder.in_range': self._encoder() is not None, 'thermal.target_k': self.target_k, 'thermal.indicated_k': self._indicated_T(), 'heater.output_fraction': self.heater_w / self.plant['heater_max_w'] if self.plant else 0.0, 'weight.total_load_kg': self.load_kg, 'method.test_load_kg': self.method['test_load_kg'] if self.method else None, 'preheat.elapsed_s': None if self.load_ns is None else (self.time_ns - self.load_ns) / 1e9, 'piston.position_m': self.x, 'piston.target_m': self.x_target, 'sensor_arm.angle_rad': sensor_arm_angle(self.x), 'cutter.angle_rad': self.cutter_angle, 'power.angle_rad': POWER_SWITCH_ON_RAD if self.power else 0.0, 'extrudate.length_m': self.strand_m3 / DIE_AREA_M2, 'extrudate.last_cut_length_m': self.last_cut_length, 'encoder.position_m': self._encoder(), 'measurement.live_mvr_m3_s': self._live_mvr(), 'measurement.mvr_m3_s': self.last_mvr, 'measurement.mfr_kg_s': self.last_mfr, 'measurement.validity': self.validity, 'acquisition.phase': self.phase, 'acquisition.elapsed_s': self.elapsed, 'acquisition.points': len(self.rows), 'segments.count': len(self.segments), 'segments.unweighed': sum(1 for g in self.segments if g['measurement_segment'] and g['status'] != 'weighed'), 'truth.barrel_temperature_k': self.T_b, 'truth.sample_temperature_k': T_s, 'truth.melt_fraction': phi, 'truth.pellet_fraction': self.pellet, 'truth.sample_mass_kg': self.m_s, 'truth.flow_m3_s': self.q_true, 'truth.thermal_history_s': self.t_hist, 'truth.strand_mass_kg': self.strand_kg, 'truth.heater_power_w': self.heater_w} return {k: copy.deepcopy(v) for k, v in d.items() if visibility != 'agent' or SLOTS[k]['visibility'] == 'agent'}
def ledger(self): b = copy.deepcopy(self.book) seg_mass = sum(g['true_mass_kg'] for g in self.segments) b.update(sample_mass_kg=self.m_s, strand_mass_kg=self.strand_kg, segments_mass_kg=seg_mass, extruded_mass_kg=self.strand_kg + seg_mass + self.book['collected_mass_kg'], barrel_thermal_j=(self.plant['barrel_heat_capacity_j_k'] * (self.T_b - self._ambient())) if self.plant else 0.0, sample_enthalpy_j=self.H_s, load_potential_j=self._load_mass() * GRAVITY * self.x) b['mass_residual_kg'] = b['loaded_mass_kg'] - self.m_s - self.strand_kg - seg_mass - b['collected_mass_kg'] - b['removed_mass_kg'] b['energy_residual_j'] = (b['heater_input_j'] + b['host_work_j'] + b['loaded_enthalpy_j'] - b['barrel_thermal_j'] - b['sample_enthalpy_j'] - (b['load_potential_j'] - self._potential0) - b['ambient_export_j'] - b['extruded_enthalpy_j'] - b['removed_enthalpy_j']) return b
_potential0 = PISTON_LOAD_KG * GRAVITY * PISTON_TRAVEL_M
# ------------------------------------------------------------ acquisition bookkeeping def _record(self, t_ns): enc = self._encoder() quality = 'power_off' if not self.power else 'ok' if enc is not None else 'encoder_out_of_range' self.rows.append(dict(point_index=len(self.rows), time_s=self._obs_time(t_ns, self._acq), encoder_position_m=enc, temperature_k=self._indicated_T(), quality=quality))
@staticmethod def _public_segments(segments): return [dict(segment_id=g['segment_id'], start_time_s=g['start_obs_s'], end_time_s=g['end_obs_s'], duration_s=None if g['start_obs_s'] is None else quantize(g['end_obs_s'] - g['start_obs_s'], TIME_RESOLUTION_S), observed_mass_kg=g['observed_mass_kg'], status=g['status'], measurement_segment=g['measurement_segment']) for g in segments]
@staticmethod def _compute_flow(acq): """Method B from the acquisition's own rows and window; method A from its own weighed measurement segments.""" m = acq['method'] pts = [r for r in acq['rows'] if r['encoder_position_m'] is not None and r['quality'] == 'ok'] inside = [r for r in pts if m['window_lower_m'] - 1e-12 <= r['encoder_position_m'] <= m['window_upper_m'] + 1e-12] mvr = None window = None if len(inside) >= 2 and inside[0]['encoder_position_m'] > inside[-1]['encoder_position_m'] and inside[-1]['time_s'] > inside[0]['time_s']: a, b = inside[0], inside[-1] mvr = (a['encoder_position_m'] - b['encoder_position_m']) * STANDARD_AREA_M2 / (b['time_s'] - a['time_s']) window = ([a['encoder_position_m'], b['encoder_position_m']], [a['time_s'], b['time_s']]) weighed = [g for g in acq['segments'] if g['measurement_segment'] and g['status'] == 'weighed'] mfr = None if weighed: mfr = sum(g['observed_mass_kg'] for g in weighed) / sum(quantize(g['end_obs_s'] - g['start_obs_s'], TIME_RESOLUTION_S) for g in weighed) if mvr is None and mfr is None: return None return dict(mvr_m3_s=mvr, mvr_cm3_10min=None if mvr is None else mvr * 6e8, mfr_kg_s=mfr, mfr_g_10min=None if mfr is None else mfr * 6e5, density_at_test_temperature_kg_m3=None if (mvr is None or mfr is None or mvr <= 0) else mfr / mvr, window_positions_m=None if window is None else window[0], window_times_s=None if window is None else window[1], weighed_segments=len(weighed), evidence='method B: ISO mean area 0.711 cm^2 x quantised encoder displacement / quantised time inside the window of the method used for this run; ' 'method A: externally weighed measurement segments of this run / their quantised cut interval')
def _result_of(self, acq): return dict(operation_id=acq['op'], phase=acq['phase'], elapsed_s=acq['elapsed'], test_temperature_k=acq['target_k'], test_load_kg=acq['load_kg'], rows=copy.deepcopy(acq['rows']), segments=self._public_segments(acq['segments']), flow=copy.deepcopy(acq['flow']) if acq['phase'] != 'running' else None, validity=acq['validity'], terminal_reason=acq['terminal_reason'], template_source=acq['source'], evidence='synthetic_forward_model; quantised encoder/time/temperature observations and external weighings; manufacturer MVR scalar ' 'transferred with explicit rheology/thermal/density priors; not native Mflow data')
def _result(self): if self._acq is None: return dict(operation_id=None, phase='idle', elapsed_s=0.0, test_temperature_k=None, test_load_kg=None, rows=[], segments=[], flow=None, validity='not_completed', terminal_reason=None, template_source=None, evidence='no_measurement') if self._acq['phase'] == 'running': return self._result_of(self._acq) return copy.deepcopy(self.records[self._acq['op']])
def _finish(self, phase, reason): acq = self._acq method = acq['method'] if phase == 'cancelled': validity = 'cancelled' elif reason == 'SAMPLE_EXHAUSTED': validity = 'sample_exhausted' elif not acq['window_traversed']: validity = 'window_not_traversed' elif acq['temperature_excursion']: validity = 'temperature_out_of_tolerance' elif method['preheat_time_s'] < 300.0: validity = 'preheat_below_iso_minimum' else: validity = 'valid' acq.update(phase=phase, terminal_reason=reason, validity=validity, end_ns=self.time_ns, elapsed=self.elapsed) acq['flow'] = self._compute_flow(acq) self.phase, self.terminal_reason, self.validity, self.flow_result = phase, reason, validity, acq['flow'] ok = acq['flow'] is not None and validity == 'valid' self.last_mvr = acq['flow']['mvr_m3_s'] if ok else None self.last_mfr = acq['flow']['mfr_kg_s'] if ok else None self.records[acq['op']] = self._result_of(acq)
def _refresh_record(self, op): """A weighing that finishes after its run updates only that run's record (masses only, same method snapshot).""" acq = self._acqs.get(op) if acq is None or acq['phase'] == 'running': return acq['flow'] = self._compute_flow(acq) self.records[op] = self._result_of(acq) if op == self.operation_id: self.flow_result = acq['flow'] if acq['validity'] == 'valid' and acq['flow'] is not None: self.last_mfr = acq['flow']['mfr_kg_s']
# ------------------------------------------------------------ cutter and balance def _start_cut(self, auto): """Blade moves from where it stands to the far rest (0 or pi); the strand is severed where the path crosses pi/2.""" a0 = self.cutter_angle a1 = CUTTER_TRAVEL_RAD if a0 < CUTTER_TRAVEL_RAD / 2 else 0.0 duration = max(1, round(self.plant['cutter_half_turn_s'] * 1e9 * abs(a1 - a0) / CUTTER_TRAVEL_RAD)) frac = (CUTTER_TRAVEL_RAD / 2 - a0) / (a1 - a0) self._cut = dict(start_ns=self.time_ns, mid_ns=self.time_ns + round(frac * duration), end_ns=self.time_ns + duration, a0=a0, a1=a1, severed=False, auto=auto)
def _sever(self, t_ns): """Blade crosses pi/2: the hanging strand becomes a segment.""" acq = self._acq if self.phase == 'running' else None if acq is not None: acq['cuts'] += 1 op = acq['op'] if acq is not None else 'manual' start_obs = acq['last_cut_obs'] if acq is not None else None end_obs = self._obs_time(t_ns, acq) measurement = acq is not None and acq['cuts'] >= 2 if self.strand_kg > 0 or acq is not None: self._segment_counter += 1 seg = dict(segment_id=f'{op}:segment:{self._segment_counter}', operation_id=op, true_mass_kg=self.strand_kg, true_volume_m3=self.strand_m3, start_obs_s=start_obs if measurement else None, end_obs_s=end_obs, observed_mass_kg=None, status='unweighed', measurement_segment=measurement) self.segments.append(seg) if acq is not None: acq['segments'].append(seg) self.last_cut_length = self.strand_m3 / DIE_AREA_M2 if measurement and acq['method']['automatic_weighing'] and self.balance is not None: self._weigh_queue.append(seg['segment_id']) self._start_next_weighing() self.strand_kg = 0.0 self.strand_m3 = 0.0 if acq is not None: acq['last_cut_obs'] = end_obs
def _start_next_weighing(self): if self._weighing is None and self._weigh_queue and self.balance is not None: sid = self._weigh_queue.pop(0) seg = next(g for g in self.segments if g['segment_id'] == sid) seg['status'] = 'weighing' self._weighing = dict(segment_id=sid, end_ns=self.time_ns + max(1, round(self.balance['settling_s'] * 1e9)))
def _complete_weighing(self): w = self._weighing self._weighing = None seg = next((g for g in self.segments if g['segment_id'] == w['segment_id']), None) if seg is not None: b = self.balance scale, offset = self.balance_cal raw = quantize(b['gain'] * seg['true_mass_kg'] + b['offset_kg'], b['resolution_kg']) seg['observed_mass_kg'] = scale * raw + offset seg['status'] = 'weighed' self._refresh_record(seg['operation_id']) self._start_next_weighing()
# ------------------------------------------------------------ commands def invoke(self, capability_id, **arguments): if capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') validate(CAPS[capability_id]['input_schema'], arguments) k = capability_id a = copy.deepcopy(arguments) if k in UNSUPPORTED: raise ActionRejected('UNSUPPORTED') if k == 'acquisition.result': return self._result() if k == 'ledger.read': return self.ledger() if k == 'provenance.read': return dict(current_sample=self.source, operation_source=self._operation_source) if k == 'analysis.flow': return analyze_flow(**a) if k == 'sim.step': self.step(a['dt_s']) return dict(time_s=self.time_s) if self.phase == 'running' and k not in ('acquisition.stop', 'power.set', 'balance.weigh', 'thermal.set_temperature', 'cutter.cut'): raise ActionRejected('BUSY') if k == 'plant.configure': if self.plant is not None: raise ActionRejected('PLANT_ALREADY_CONFIGURED') if not a['accept_engineering']: raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') if a['barrel_heat_capacity_j_k'] / (a['controller_gain_w_k'] + a['barrel_loss_w_k']) < 5 * MAX_SUBSTEP_S: raise ActionRejected('THERMAL_TIME_CONSTANT_OUTSIDE_NUMERICAL_DOMAIN') self.plant = a self.T_b = a['ambient_k'] self.target_k = max(TEMPERATURE_RANGE_K[0], a['ambient_k']) out = dict(configured=True) elif k == 'balance.configure': if not a['accept_external_balance_proxy']: raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') if self._weighing is not None: raise ActionRejected('BALANCE_BUSY') self.balance = a out = dict(configured=True) elif k == 'method.configure': if a['window_upper_m'] <= a['window_lower_m']: raise ActionRejected('INVALID_WINDOW') nanos = a['sample_interval_s'] / TIME_RESOLUTION_S if abs(nanos - round(nanos)) > 1e-6: raise ActionRejected('SAMPLING_NOT_ON_TIME_BASE') if a['duration_s'] / a['sample_interval_s'] + 2 > MAX_ROWS: raise ActionRejected('TOO_MANY_SAMPLES') self.method = a out = dict(configured=True) elif k == 'power.set': if self.plant is None: raise ActionRejected('PLANT_REQUIRED') if not a['enabled']: if self.phase == 'running': self._finish('cancelled', 'POWER_OFF') if self._cut is not None: self._cut = None # blade stops where it is; an uncrossed turn does not cut self.heater_w = 0.0 self.integral_w = 0.0 self.power = a['enabled'] out = dict(enabled=self.power) elif k == 'thermal.set_temperature': if self.plant is None: raise ActionRejected('PLANT_REQUIRED') self.target_k = a['target_k'] out = dict(target_k=self.target_k) elif k == 'weight.configure': if self.plant is None: raise ActionRejected('PLANT_REQUIRED') if self._move is not None: raise ActionRejected('PISTON_MOVING') old = self._load_mass() self.load_kg = a['total_load_kg'] self.book['host_work_j'] += (self._load_mass() - old) * GRAVITY * self.x out = dict(total_load_kg=self.load_kg) elif k == 'sample.load': if self.plant is None: raise ActionRejected('PLANT_REQUIRED') if self.sample is not None: raise ActionRejected('SAMPLE_PRESENT') if self._move is not None or self.x < PISTON_TRAVEL_M - 1e-12: raise ActionRejected('PISTON_NOT_WITHDRAWN') if not a['accept_rheology_thermal_density_and_packing_assumptions']: raise ActionRejected('ENGINEERING_ACCEPTANCE_REQUIRED') if a['melting_high_k'] < a['melting_low_k']: raise ActionRejected('INVALID_MELTING_RANGE') if a['bulk_density_kg_m3'] > a['melt_density_kg_m3']: raise ActionRejected('BULK_DENSITY_EXCEEDS_MELT_DENSITY') ref = library().get(a['reference_id']) if ref is None: raise ActionRejected('UNKNOWN_REFERENCE') cell = next((m for m in ref['measurements'] if m.get('mvr_m3_s') is not None and abs(m['reference_temperature_K'] - a['reference_temperature_k']) < 1e-6 and abs(m['reference_load_kg'] - a['reference_load_kg']) < 1e-9), None) if cell is None: raise ActionRejected('NO_NUMERIC_REFERENCE_AT_CONDITION') height = a['mass_kg'] / (a['bulk_density_kg_m3'] * STANDARD_AREA_M2) if height > BARREL_LENGTH_M: raise ActionRejected('CHARGE_EXCEEDS_BARREL') self.sample = a self.reference = ref self.reference_cell = cell self.source = json.dumps(dict(reference_id=a['reference_id'], grade=ref.get('grade'), condition=[cell['reference_temperature_K'], cell['reference_load_kg']], mvr_m3_s=cell['mvr_m3_s'], source=cell.get('source', {}).get('publication')), sort_keys=True, ensure_ascii=False) self.m_s = a['mass_kg'] self.m_loaded = a['mass_kg'] self.pellet = 1.0 self.t_hist = 0.0 self.H_s = a['mass_kg'] * self._h_of_T(a['initial_temperature_k']) self.book['loaded_mass_kg'] += a['mass_kg'] self.book['loaded_enthalpy_j'] += self.H_s self.load_ns = self.time_ns out = dict(present=True, column_height_m=height) elif k == 'sample.remove': if self.sample is None: raise ActionRejected('NO_SAMPLE') if self._move is not None or self.x < PISTON_TRAVEL_M - 1e-12: raise ActionRejected('PISTON_NOT_WITHDRAWN') removed = self.m_s self.book['removed_mass_kg'] += removed self.book['removed_enthalpy_j'] += self.H_s self.m_s = 0.0 self.H_s = 0.0 self.sample = self.reference = self.reference_cell = self.source = None self.pellet = 0.0 self.t_hist = 0.0 self.load_ns = None out = dict(removed_mass_kg=removed) elif k in ('piston.withdraw', 'piston.insert'): if self.plant is None: raise ActionRejected('PLANT_REQUIRED') if self._move is not None: raise ActionRejected('PISTON_MOVING') if k == 'piston.withdraw': target = PISTON_TRAVEL_M self.contact = False else: if self.contact: raise ActionRejected('ALREADY_IN_CONTACT') target = max(self._column_height(), 0.0) self.x_target = target if abs(target - self.x) > 1e-12: self._move = dict(start_ns=self.time_ns, x0=self.x, direction=1.0 if target > self.x else -1.0, speed=self.plant['manual_piston_speed_m_s'], insert=k == 'piston.insert') elif k == 'piston.insert': self.contact = True out = dict(target_m=target) elif k == 'cutter.cut': if not self.power: raise ActionRejected('POWER_OFF') if self._cut is not None: raise ActionRejected('CUTTER_BUSY') if self.phase == 'running': if self._acq['manual_cuts'] >= self._acq['manual_cut_budget']: raise ActionRejected('TOO_MANY_SEGMENTS') self._acq['manual_cuts'] += 1 self._start_cut(auto=False) out = dict(requested=True) elif k == 'collection.clear': if self._weighing is not None: raise ActionRejected('BALANCE_BUSY') collected = self.strand_kg + sum(g['true_mass_kg'] for g in self.segments) self.book['collected_mass_kg'] += collected self.strand_kg = self.strand_m3 = 0.0 self.segments = [] self._weigh_queue = [] self.last_cut_length = 0.0 out = dict(collected_mass_kg=collected) elif k == 'balance.weigh': if self.balance is None: raise ActionRejected('BALANCE_REQUIRED') seg = next((g for g in self.segments if g['segment_id'] == a['segment_id']), None) if seg is None: raise ActionRejected('UNKNOWN_SEGMENT') if seg['status'] != 'unweighed' or a['segment_id'] in self._weigh_queue: raise ActionRejected('SEGMENT_ALREADY_WEIGHED_OR_QUEUED') self._weigh_queue.append(a['segment_id']) self._start_next_weighing() out = dict(requested=True) elif k == 'calibration.encoder': if a['observed_high_m'] - a['observed_low_m'] <= 1e-6 or a['reference_high_m'] - a['reference_low_m'] <= 1e-6: raise ActionRejected('DEGENERATE_CALIBRATION') # observed readings were taken with the current correction: compose the new correction on top s_old, o_old = self.encoder_cal gain = (a['reference_high_m'] - a['reference_low_m']) / (a['observed_high_m'] - a['observed_low_m']) off = a['reference_low_m'] - gain * a['observed_low_m'] self.encoder_cal = (gain * s_old, gain * o_old + off) out = dict(scale=self.encoder_cal[0], offset_m=self.encoder_cal[1]) elif k == 'calibration.balance': if a['observed_high_kg'] - a['observed_low_kg'] <= 1e-9 or a['reference_high_kg'] - a['reference_low_kg'] <= 1e-9: raise ActionRejected('DEGENERATE_CALIBRATION') s_old, o_old = self.balance_cal gain = (a['reference_high_kg'] - a['reference_low_kg']) / (a['observed_high_kg'] - a['observed_low_kg']) off = a['reference_low_kg'] - gain * a['observed_low_kg'] self.balance_cal = (gain * s_old, gain * o_old + off) out = dict(scale=self.balance_cal[0], offset_kg=self.balance_cal[1]) elif k == 'acquisition.start': if not self.power: raise ActionRejected('POWER_OFF') if self.plant is None or self.method is None: raise ActionRejected('CONFIGURATION_REQUIRED') if self.sample is None: raise ActionRejected('NO_SAMPLE') if not self.contact or self._move is not None: raise ActionRejected('PISTON_NOT_ON_CHARGE') if self.load_kg is None or abs(self.load_kg - self.method['test_load_kg']) > 1e-9: raise ActionRejected('LOAD_MISMATCH') if (self.time_ns - self.load_ns) / 1e9 < self.method['preheat_time_s'] - 1e-9: raise ActionRejected('PREHEAT_NOT_COMPLETE') if abs(self._indicated_T() - self.target_k) > self.method['temperature_tolerance_k'] + 1e-9: raise ActionRejected('TEMPERATURE_NOT_STABLE') if self._cut is not None: raise ActionRejected('CUTTER_BUSY') ci = self.method['cut_interval_s'] if ci is not None and ci < 1.5 * self.plant['cutter_half_turn_s']: raise ActionRejected('CUT_INTERVAL_TOO_SHORT') self._counter += 1 self.operation_id = f'{self.instance_id}:acq:{self._counter}' self.phase = 'running' self.elapsed = 0.0 self.terminal_reason = None self.validity = 'not_completed' self.flow_result = None self._operation_source = self.source period = round(self.method['sample_interval_s'] * 1e9) self._acq = dict(op=self.operation_id, method=copy.deepcopy(self.method), rows=[], segments=[], phase='running', validity='not_completed', terminal_reason=None, flow=None, elapsed=0.0, source=self.source, start_ns=self.time_ns, end_limit_ns=self.time_ns + round(self.method['duration_s'] * 1e9), period_ns=period, next_sample_ns=self.time_ns + period, next_cut_ns=None if ci is None else self.time_ns + round(ci * 1e9), cuts=0, last_cut_obs=None, window_traversed=False, temperature_excursion=False, target_k=self.target_k, load_kg=self.load_kg, end_ns=None) auto_cuts = 0 if ci is None else int(self.method['duration_s'] // ci) + 2 self._acq.update(manual_cut_budget=MAX_SEGMENTS - auto_cuts, manual_cuts=0) self._acqs[self.operation_id] = self._acq self.rows = self._acq['rows'] self._record(self.time_ns) if ci is not None: self._start_cut(auto=True) # trim cut: removes what flowed during the preheat out = dict(operation_id=self.operation_id) elif k == 'acquisition.stop': if self.phase != 'running': raise ActionRejected('NOT_RUNNING') self._finish('cancelled', 'USER_CANCEL') out = dict(phase=self.phase, elapsed_s=self.elapsed) else: raise ActionRejected('UNKNOWN_CAPABILITY') self.revision += 1 return copy.deepcopy(out)
# ------------------------------------------------------------ time integration def _next_events(self, end): ev = [end, self.time_ns + round(MAX_SUBSTEP_S * 1e9)] if self._move is not None: m = self._move dist = abs(self.x_target - m['x0']) ev.append(m['start_ns'] + max(1, math.ceil(dist / m['speed'] * 1e9))) if self._cut is not None: ev += [self._cut['mid_ns'], self._cut['end_ns']] if not self._cut['severed'] else [self._cut['end_ns']] if self._weighing is not None: ev.append(self._weighing['end_ns']) if self.phase == 'running': ev += [self._acq['next_sample_ns'], self._acq['end_limit_ns']] if self._acq['next_cut_ns'] is not None: ev.append(self._acq['next_cut_ns']) return min(t for t in ev if t > self.time_ns)
def _integrate(self, dt): """Explicit conservative update over one sub-step (all energy terms booked with the same values).""" p = self.plant Ta = p['ambient_k'] # heater: PI with conditional integration (anti-windup) if self.power: e = self.target_k - self.T_b u = p['controller_gain_w_k'] * e + self.integral_w P = min(max(u, 0.0), p['heater_max_w']) if 0.0 < u < p['heater_max_w'] or (u >= p['heater_max_w'] and e < 0) or (u <= 0 and e > 0): self.integral_w = min(max(self.integral_w + p['controller_gain_w_k'] / p['controller_integral_s'] * e * dt, 0.0), p['heater_max_w']) else: P = 0.0 self.heater_w = P loss = p['barrel_loss_w_k'] * (self.T_b - Ta) friction = 0.0 pressure_work = 0.0 self.q_true = 0.0 exchange = 0.0 if self.sample is not None and self.m_s > 0: T_s, phi = self._sample_state() # barrel -> charge heat over dt: exponential relaxation towards the barrel temperature with the secant heat # capacity (sensible + latent) of the charge; unconditionally stable for any charge size / conductance G = p['sample_conductance_w_k'] * (self.m_s / self.m_loaded) dT = self.T_b - T_s if abs(dT) > 1e-12 and G > 0: dH_eq = self.m_s * self._h_of_T(self.T_b) - self.H_s exchange = dH_eq * -math.expm1(-G * dt * dT / dH_eq) if T_s > self.sample['melting_low_k']: self.t_hist += dt # die flow for the contacting piston (melt fraction from the enthalpy) extruded_volume = 0.0 if self.contact: q = self._flow(T_s, phi) dm = min(self.sample['melt_density_kg_m3'] * q * dt, phi * self.m_s) if dm > 0: h = self.H_s / self.m_s self.m_s -= dm self.H_s -= dm * h self.book['extruded_enthalpy_j'] += dm * h self.strand_kg += dm self.strand_m3 += dm / self.sample['melt_density_kg_m3'] extruded_volume = dm / self.sample['melt_density_kg_m3'] self.q_true = extruded_volume / dt self.H_s += exchange # compaction bookkeeping: unmelted pellets only turn into melt (never back to bulk pellets) self.pellet = min(self.pellet, 1.0 - self._phi()) if self.contact: x_new = min(self._column_height(), self.x) dx = self.x - x_new if dx > 0: friction = p['piston_friction_n'] * dx force = self._load_mass() * GRAVITY - p['piston_friction_n'] pressure_work = force * dx # the share that pushed melt through the die is dissipated there and leaves with the extrudate # (delta_p * V_extruded); only the compaction share heats the charge left in the barrel die_work = min(pressure_work, force / STANDARD_AREA_M2 * extruded_volume) self.book['extruded_enthalpy_j'] += die_work self.H_s += pressure_work - die_work self.x = x_new self.book['heater_input_j'] += P * dt self.book['ambient_export_j'] += loss * dt self.book['friction_heat_j'] += friction self.book['pressure_work_j'] += pressure_work self.T_b += (P * dt - loss * dt - exchange + friction) / p['barrel_heat_capacity_j_k']
def _advance_move(self, nxt): m = self._move dist = abs(self.x_target - m['x0']) t = (nxt - m['start_ns']) / 1e9 done = t * m['speed'] >= dist - 1e-15 new_x = self.x_target if done else m['x0'] + m['direction'] * m['speed'] * t dx = new_x - self.x heat = self.plant['piston_friction_n'] * abs(dx) self.book['host_work_j'] += self._load_mass() * GRAVITY * dx + heat self.book['friction_heat_j'] += heat self.T_b += heat / self.plant['barrel_heat_capacity_j_k'] self.x = new_x if done: self._move = None if m['insert']: self.contact = True
def step(self, dt_s): validate(number('s', 0.0, 86400.0), dt_s) raw = dt_s * 1e9 + self._clock_remainder_ns ns = round(raw) self._clock_remainder_ns = raw - ns if ns <= 0 or self.plant is None: self.time_ns += max(ns, 0) self.revision += 1 return end = self.time_ns + ns while self.time_ns < end: nxt = self._next_events(end) dt = (nxt - self.time_ns) / 1e9 if self._move is not None: self._advance_move(nxt) self._integrate(dt) # a descending insert can meet the (shrinking) charge column if self._move is not None and self._move['insert'] and self.x <= self._column_height() + 1e-12: self.x = max(self._column_height(), 0.0) self.x_target = self.x self._move = None self.contact = True if self._cut is not None: c = self._cut frac = min(1.0, (nxt - c['start_ns']) / max(1, c['end_ns'] - c['start_ns'])) self.cutter_angle = c['a0'] + (c['a1'] - c['a0']) * frac self.time_ns = nxt if self._cut is not None: c = self._cut if not c['severed'] and self.time_ns >= c['mid_ns']: c['severed'] = True self._sever(self.time_ns) if self.time_ns >= c['end_ns']: self.cutter_angle = c['a1'] self._cut = None if self._weighing is not None and self.time_ns >= self._weighing['end_ns']: self._complete_weighing() if self.phase == 'running': acq = self._acq self.elapsed = (self.time_ns - acq['start_ns']) / 1e9 acq['elapsed'] = self.elapsed am = acq['method'] if acq['next_cut_ns'] is not None and self.time_ns >= acq['next_cut_ns']: acq['next_cut_ns'] += round(am['cut_interval_s'] * 1e9) if self._cut is None and self.power: self._start_cut(auto=True) if self.time_ns >= acq['next_sample_ns']: acq['next_sample_ns'] += acq['period_ns'] self._record(self.time_ns) row = self.rows[-1] if row['temperature_k'] is not None and abs(row['temperature_k'] - acq['target_k']) > am['temperature_tolerance_k'] + 1e-9: enc = row['encoder_position_m'] if enc is not None and am['window_lower_m'] <= enc <= am['window_upper_m']: acq['temperature_excursion'] = True enc = row['encoder_position_m'] if enc is not None and enc <= am['window_lower_m']: acq['window_traversed'] = any(r['encoder_position_m'] is not None and r['encoder_position_m'] >= am['window_upper_m'] for r in self.rows) self._finish('succeeded' if acq['window_traversed'] else 'failed', 'WINDOW_TRAVERSED' if acq['window_traversed'] else 'STARTED_BELOW_WINDOW') if self.phase == 'running' and (self.m_s <= 1e-12 or self.x <= MIN_PISTON_M): self._finish('failed', 'SAMPLE_EXHAUSTED') if self.phase == 'running' and self.time_ns >= acq['end_limit_ns']: self._finish('failed', 'DURATION_ELAPSED') self.revision += 1
class ZwickMflowSession: def __init__(self, host, principal_id): self._host = host self._principal = principal_id
@property def _role(self): return self._host._principals[self._principal]
def _target(self, instance_id): if not isinstance(instance_id, str) or instance_id != self._host.instance_id: raise ActionRejected('UNKNOWN_INSTANCE')
def describe(self, *, instance_id=None, asset_type_id=None): if (instance_id is None) == (asset_type_id is None): raise ActionRejected('INVALID_ARGUMENT') if instance_id is not None: self._target(instance_id) if asset_type_id is not None and asset_type_id != ASSET_TYPE_ID: raise ActionRejected('UNKNOWN_INSTANCE') meta = export_zwick_mflow_contract_metadata() return dict(protocol_version=PROTOCOL_VERSION, asset_type_id=ASSET_TYPE_ID, asset_version='1.0.0', capabilities={k: v for k, v in meta['capabilities'].items() if v['visibility'] == 'agent' or self._role != 'agent'}, state_slots={k: v for k, v in meta['state_slots'].items() if v['visibility'] == 'agent' or self._role != 'agent'})
def read(self, *, instance_id, state_ids=None): self._target(instance_id) h = self._host values = h.read(self._role) ids = list(values) if state_ids is None else state_ids if not isinstance(ids, list) or any(not isinstance(k, str) for k in ids): raise ActionRejected('INVALID_ARGUMENT') if any(k not in values for k in ids): raise ActionRejected('ACCESS_DENIED') return dict(instance_id=instance_id, status='succeeded', state_revision=h.revision, clock={'domain': 'simulation', 'time_s': h.time_s}, observations={k: dict(value=copy.deepcopy(values[k]), unit=SLOTS[k]['unit'], quality='unavailable' if values[k] is None else 'estimated' if SLOTS[k]['origin'] in ('sensor', 'derived') else 'valid', sample_time_s=h.time_s, sample_window_s=None) for k in ids})
def _filter_result(self, result): result = copy.deepcopy(result) # Public acquisition payloads use the same redaction for every role; provenance.read is the evaluator channel. if 'rows' in result and 'template_source' in result: result['template_source'] = (str(LIBRARY_PATH.relative_to(ROOT)) + '; selected record available only through evaluator provenance.read') if result['template_source'] is not None else None result['evidence'] = ('synthetic_forward_model; quantised encoder/time/temperature observations and external weighings; manufacturer MVR scalar with explicit priors; selected record restricted' if result['operation_id'] is not None else 'no_measurement') return result
def invoke(self, *, instance_id, capability_id, arguments, request_id): h = self._host try: self._target(instance_id) if not isinstance(capability_id, str) or capability_id not in CAPS: raise ActionRejected('UNKNOWN_CAPABILITY') if self._role == 'agent' and CAPS[capability_id]['visibility'] != 'agent': raise ActionRejected('ACCESS_DENIED') if not isinstance(request_id, str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') validate(CAPS[capability_id]['input_schema'], arguments) key = (self._principal, request_id) digest = json.dumps([capability_id, arguments], sort_keys=True, allow_nan=False) if key in h._requests: old, response = h._requests[key] if old != digest: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(response) # Operations started by another *agent* are private to it; ones started from the physical panel or by the host # (evaluator/debug principals, e.g. a Matterix key press) are visible to every operator at the instrument. owner = h._owners.get(h.operation_id) if h.operation_id else None foreign = owner is not None and owner != self._principal and h._principals.get(owner) == 'agent' if capability_id in ('acquisition.stop', 'acquisition.result') and self._role == 'agent' and foreign: raise ActionRejected('ACCESS_DENIED') if capability_id in ('cutter.cut', 'thermal.set_temperature') and h.phase == 'running' and self._role == 'agent' and foreign: raise ActionRejected('ACCESS_DENIED') if capability_id == 'power.set' and not arguments['enabled'] and h.phase == 'running' and self._role == 'agent' and foreign: raise ActionRejected('ACCESS_DENIED') result = self._filter_result(h.invoke(capability_id, **arguments)) operation = result.get('operation_id') if capability_id == 'acquisition.start' else None if operation: h._owners[operation] = self._principal response = dict(protocol_version=PROTOCOL_VERSION, instance_id=instance_id, request_id=request_id, operation_id=operation, status='accepted' if operation else 'succeeded', state_revision=h.revision, clock={'domain': 'simulation', 'time_s': h.time_s}, result=result, observations={}, error=None) h._requests[key] = (digest, copy.deepcopy(response)) return response except ActionRejected as exc: return dict(protocol_version=PROTOCOL_VERSION, instance_id=instance_id, request_id=request_id, operation_id=None, status='unsupported' if str(exc) == 'UNSUPPORTED' else 'rejected', state_revision=h.revision, clock={'domain': 'simulation', 'time_s': h.time_s}, result={}, observations={}, error=dict(code=str(exc), message=str(exc), retryable=False, side_effects='none'))
def write(self, *, instance_id, state_id, value, request_id): self._target(instance_id) if not isinstance(state_id, str): raise ActionRejected('INVALID_ARGUMENT') entry = SLOTS.get(state_id) if not entry or state_id not in WRITE_VIA: raise ActionRejected('ACCESS_DENIED') capability, argument = WRITE_VIA[state_id] return self.invoke(instance_id=instance_id, capability_id=capability, arguments={argument: value}, request_id=request_id)
def poll(self, operation_id): h = self._host if not isinstance(operation_id, str): raise ActionRejected('INVALID_ARGUMENT') if h._owners.get(operation_id) != self._principal: raise ActionRejected('ACCESS_DENIED') result = h._result() if operation_id == h.operation_id and h.phase == 'running' else h.records.get(operation_id) if result is None: raise ActionRejected('UNKNOWN_OPERATION') return dict(operation_id=operation_id, status=result['phase'], result=self._filter_result(result))
def cancel(self, operation_id, request_id): self.poll(operation_id) h = self._host if not isinstance(request_id, str) or not request_id: raise ActionRejected('INVALID_ARGUMENT') key = (self._principal, request_id) if key in h._cancel_operations: if h._cancel_operations[key] != operation_id: raise ActionRejected('REQUEST_CONFLICT') return copy.deepcopy(h._requests[key][1]) if key in h._requests: raise ActionRejected('REQUEST_CONFLICT') if operation_id != h.operation_id or h.phase != 'running': raise ActionRejected('NOT_RUNNING') result = self.invoke(instance_id=h.instance_id, capability_id='acquisition.stop', arguments={}, request_id=request_id) if result['status'] == 'succeeded': h._cancel_operations[key] = operation_id return result
WRITE_VIA = {'thermal.target_k': ('thermal.set_temperature', 'target_k')} # the load is placed by the host (evaluator weight.configure)EFFECTS = { 'plant.configure': ['plant.configured', 'thermal.target_k', 'truth.barrel_temperature_k', 'truth.sample_temperature_k', 'heater.output_fraction'], 'balance.configure': ['balance.configured'], 'method.configure': ['method.configured', 'method.test_load_kg'], 'power.set': ['power.enabled', 'power.angle_rad', 'thermal.indicated_k', 'encoder.position_m', 'encoder.in_range', 'acquisition.phase', 'measurement.validity', 'measurement.live_mvr_m3_s', 'truth.heater_power_w', 'heater.output_fraction', 'cutter.running', 'measurement.mvr_m3_s', 'measurement.mfr_kg_s'], 'thermal.set_temperature': ['thermal.target_k'], 'weight.configure': ['weight.total_load_kg'], 'sample.load': ['sample.present', 'preheat.elapsed_s', 'truth.sample_mass_kg', 'truth.sample_temperature_k', 'truth.melt_fraction', 'truth.pellet_fraction', 'truth.thermal_history_s'], 'sample.remove': ['sample.present', 'preheat.elapsed_s', 'truth.sample_mass_kg', 'truth.sample_temperature_k', 'truth.melt_fraction', 'truth.pellet_fraction', 'truth.thermal_history_s'], 'piston.withdraw': ['piston.target_m', 'piston.moving', 'piston.contact'], 'piston.insert': ['piston.target_m', 'piston.moving', 'piston.contact'], 'cutter.cut': ['cutter.running'], 'collection.clear': ['segments.count', 'segments.unweighed', 'extrudate.length_m', 'extrudate.last_cut_length_m', 'truth.strand_mass_kg'], 'balance.weigh': ['balance.busy', 'segments.unweighed'], 'calibration.encoder': ['encoder.position_m'], 'calibration.balance': [], 'acquisition.start': ['acquisition.phase', 'acquisition.elapsed_s', 'acquisition.points', 'measurement.validity', 'cutter.running', 'measurement.live_mvr_m3_s'], 'acquisition.stop': ['acquisition.phase', 'measurement.validity', 'measurement.live_mvr_m3_s', 'measurement.mvr_m3_s', 'measurement.mfr_kg_s'], 'sim.step': list(SLOTS),}for _k, _v in EFFECTS.items(): CAPS[_k]['effects'] = _vERRORS = sorted(set(re.findall(r"ActionRejected\('([A-Z_0-9]+)'", Path(__file__).read_text())) | {'USER_CANCEL', 'POWER_OFF', 'WINDOW_TRAVERSED', 'STARTED_BELOW_WINDOW', 'SAMPLE_EXHAUSTED', 'DURATION_ELAPSED'})ASYNC = {'acquisition.start'}LIMITATIONS = [ '选定Mflow 1128610(230V)基础版:料筒1128612内径9.55mm、活塞1128614(即0.325kg载荷档)、口模312342 2.095mm×8mm(烧结耐磨耐酸);未选气动提升/选重器1128621/1128624、清洗1128622、预载1128623、预热位活塞保持1128627、口模塞1128618、分隔板1128619、回冷090173、半口模325554、耐酸料筒/活塞1128613/1128615与PVC口模092326;不建模换口模。', '厂家规格:50–450°C、总载荷0.325–21.6kg、位移分辨率0.003mm(方法B误差限±0.02mm)、时间分辨率0.002s(误差限±0.01s)、温度显示分辨率<0.1K、口模以上0–75mm温度准确度<0.3K(ISO 1133-2);这些是分辨率/误差限,不是本模型的噪声模型。', '炉体为集中热节点,PI控温;热容、散热、加热器上限(≤0.7kVA连接视在功率)、控温参数与试样换热导率都是宿主显式输入的工程参数,不是厂家数据;温度准确度未经ISO 1133-2认证。', '试样为装料焓节点:比热、潜热(熔程线性)、颗粒堆积密度、熔体密度均为宿主先验;厂家库只给23°C固体密度与DSC熔点,固体密度不得当作测试温度下熔体密度。', '口模流动由所选厂家MVR标量在其温度/载荷下锚定,经宿主给定的幂律指数n、流动活化能Ea和热历史速率外推到实际条件,并扣除活塞摩擦;单个MVR/MFR不能唯一决定完整流变曲线、入口压力损失、壁滑或温敏性。', '未熔颗粒按φ³抑制流动(显式假设);颗粒压实只随熔化单向发生,重新凝固不会恢复颗粒堆积。', '活塞位置=料柱高度(ISO平均截面0.711cm²);方法B的MVR由窗口内首末量化位移与量化时间计算;方法A的MFR只用外接天平称得的测量切段质量与其切断间隔;密度只在两者都有时给出。', '砝码下落势能分为摩擦功(进入炉体)与压力功:推动熔体通过口模的部分Δp·V在口模内耗散并随挤出物离开,压实部分进入留在料筒内的试样;手动升降活塞的宿主功含势能变化与摩擦热;挤出物带走其焓(在空气中冷却,视为离开系统边界),质量仍在库存中直到收集或清走。', '切刀为交替半圈,经过π/2瞬间切断;首次切断清除预热期挤出物,之后相邻两次自动切断之间为测量切段;切刀电机功率/速度未公开,半圈时间为工程参数。', '外接分析天平(厂家可选043851/014720,0.1mg读数)只作RS-232代理:稳定时间、增益/偏置和分辨率由宿主给定;称量不在Mflow主机内完成。', '位移传感器按照片所见转臂结构建模,量程约0–107mm(工程假设);超量程或断电时读数为null;两点标定只使用宿主提供的独立观测值。', 'agent只能看到量化位移、显示温度、切段观测和结果;精确活塞位置、熔融分数、真实流率和所选材料身份只对evaluator可见;acquisition.result对所有角色隐去材料身份,完整来源只能经provenance.read获得。', '时间推进为事件对齐的守恒子步(≤50ms;炉体PI为显式、料筒—试样换热为指数松弛):所有能量/质量项用同一数值记账因而账本精确闭合,但不同step切分会造成约1e-8–1e-7m、1e-4K量级的真值差,恰在量化边界附近的个别记录行(约1%)会相差一个量化步(0.003mm),MVR不受影响。', '正向模型的位移—体积换算与方法B分析使用同一ISO平均截面0.711cm²,因此方法B的回收只检验量化与算术,不独立检验截面假设(环隙回流未建模)。', '默认n/Ea先验跨条件外推有明显误差:例如B4330G6 HR从250°C/2.16kg外推到260°C/5kg得约16.5cm³/10min,厂家表为19(−13%);换条件时宿主应改用该条件的厂家数值格或给出更合适的先验。', '热历史倍率exp(k·t)限制在1e-3–1e3的数值域;堆积密度不得大于熔体密度(被拒);每次采集的记录行不超过200000行(方法设定时检查)。', '每次采集保存自己的方法快照、记录行与切段:清走收集区、改方法或称量其它切段都不会改写已完成的结果;晚完成的称量只回填其所属采集。每次采集的切段不超过10000个(手动切刀与自动切段共用预算);由某个agent启动的采集中,其他agent不能改��度设定、切刀、停止或读取其结果;面板/宿主启动的采集对所有操作者共享。', '没有真实硬件、testXpert连接、机器人装料/压实/清筒、挤出丝接触或卷曲、离模膨胀实测与ISO认证。',]
def export_zwick_mflow_contract_metadata(): slots = {} caps = {} for k, v in SLOTS.items(): slots[k] = dict(meaning_zh=v['meaning'], component_ids=[v['component']], value_schema=copy.deepcopy(v['schema']), unit=v['unit'], reference_conditions=v['reference'], origin=v['origin'], visibility=v['visibility'], access='read_write' if k in WRITE_VIA else 'read_only', read_binding=dict(backend='host', artifact_id='runtime', accessor=f'ZwickMflowSession.read(state_ids=[{k!r}])'), write_via=None if k not in WRITE_VIA else dict(capability_id=WRITE_VIA[k][0], argument=WRITE_VIA[k][1], fixed_arguments={}), sampling=dict(mode='instant', time_domain='simulation', window_description='Pure read; encoder 0.003 mm, time 0.002 s, display 0.01 K quantisation; rows on the method time grid.'), source_ids=['simulation_assumption']) for k, v in CAPS.items(): un = k in UNSUPPORTED async_ = k in ASYNC c = {key: copy.deepcopy(v[key]) for key in ['input_schema', 'output_schema', 'component_ids', 'function_zh', 'kind', 'visibility', 'example_arguments']} c.update(availability='unsupported' if un else 'implemented', implementation={layer: 'absent' if un or layer in ('scene', 'robot', 'hardware') else 'implemented' for layer in ['process', 'scene', 'robot', 'hardware', 'host']}, binding=None if un else dict(backend='host', artifact_id='runtime', entrypoint='asset_runtime.zwick_mflow.ZwickMflowSession.invoke', invocation=f'session.invoke(instance_id="mflow_01",capability_id={k!r},arguments={v["example_arguments"]!r},request_id="unique")'), preconditions=[] if un or v['kind'] in ('query', 'analysis', 'simulation') else [dict( description_zh='入口原子核对通电、配置、试样/活塞/载荷/预热/温度、切刀与天平忙闲等前提;被拒时状态不变。', state_ids=['power.enabled', 'plant.configured', 'sample.present', 'piston.contact', 'acquisition.phase'], enforced_by='runtime', check='ZwickMflowRuntime.invoke')], state_effects=[dict(state_id=s, timing='on_step' if k == 'sim.step' else 'immediate', description_zh='设定或操作标志;温度、位移、挤出与切段只随step推进') for s in v['effects']], observes=[], model_effects=dict(mode='none', description_zh='运行层只输出状态,由场景层绑定关节与读数', binding_ids=[]), execution=dict(mode='asynchronous' if async_ else 'synchronous', time_domain='simulation', completion_criterion='活塞读数越过窗口下限(或超时/料尽/取消)' if async_ else '原子配置或外部动作请求,实际状态由step推进', completion_state_ids=['acquisition.phase'] if async_ else [], timeout_s=None, cancellation='supported' if async_ else 'unsupported', retry='same_request_id', resources=['host_clock', 'barrel', 'piston', 'cutter', 'encoder'], partial_failure_zh='停止/断电/超时只终止记录与自动切断;已挤出物、切段、称量记录与热状态全部保留。'), errors=[dict(code=e, meaning_zh=e, side_effects='partial' if async_ and e in ('USER_CANCEL', 'POWER_OFF', 'SAMPLE_EXHAUSTED', 'DURATION_ELAPSED', 'STARTED_BELOW_WINDOW') else 'none') for e in ERRORS], verification=[], limitations=LIMITATIONS, source_ids=['manufacturer_primary', 'simulation_assumption', 'template_library']) if k in ('acquisition.start', 'piston.insert', 'piston.withdraw', 'cutter.cut', 'thermal.set_temperature', 'power.set', 'balance.weigh', 'weight.configure', 'sample.load'): c['state_effects'] += [dict(state_id=s, timing='on_step', description_zh='由统一宿主时钟推进热、熔化、挤出、切刀、称量与量化观测') for s in SLOTS if s not in v['effects'] and SLOTS[s]['origin'] in ('sensor', 'derived', 'scene', 'process_truth')] caps[k] = c mechanism = dict( component_ids=['heater', 'barrel', 'piston', 'test_weight', 'die', 'cutter', 'displacement_sensor', 'sensor_arm', 'controller', 'balance_rs232'], state_ids=list(slots), meaning_zh='料筒PI控温、装料熔化与压实、幂律口模流动(载荷/摩擦/温度/热历史)、活塞位移观测、切刀切段与外部称量', implementation='lumped', equations=['C_b dT_b/dt = P_heater - G_b (T_b - T_amb) - Q_bs + F_f |dx|/dt ; P_heater = clamp(Kp e + I, 0, P_max), dI/dt = (Kp/Ti) e (conditional integration)', 'h(T) = cp (T - T_amb) + L phi(T), phi = clamp((T - T_lo)/(T_hi - T_lo), 0, 1) ; dH_s/dt = G_s (m_s/m_0)(T_b - T_s) + (m g - F_f) dx/dt - h_s dm_ext/dt', 'Q = MVR_ref ((m g - F_f)/(m_ref g))^(1/n) exp(-(Ea/(n R))(1/T_s - 1/T_ref)) exp(k_h t_hist) phi^3 ; dm_ext = rho_melt Q dt', 'x_piston = m_s (p/rho_bulk + (1-p)/rho_melt) / A_ISO, A_ISO = pi/4 ((D_barrel + D_piston)/2)^2 = 0.711 cm^2 ; p = min(p, 1 - phi)', 'W_host = m g dx + F_f |dx| (manual moves) ; potential released under load -> F_f dx (barrel) + (m g - F_f) dx (charge)', 'MVR_B = A_ISO (x_first - x_last)/(t_last - t_first) inside [window_lower, window_upper] from quantised encoder (3 um) and time (2 ms)', 'MFR_A = sum(m_obs)/sum(dt_cut) over externally weighed measurement segments; density_T = MFR/MVR', 'arm elevation = asin((x - 0.050)/0.140), upper stop 0.42 rad; encoder range ~0 .. 0.107 m'], parameters={}, source_ids=['simulation_assumption', 'template_library'], limitations=LIMITATIONS) import importlib.util spec = importlib.util.spec_from_file_location('_mflow_local_annotations', ROOT / 'scripts/asset_runtime/_annotations.py') ann = importlib.util.module_from_spec(spec) spec.loader.exec_module(ann) ann.KEY_ZH.update({k: v['meaning'] for k, v in SLOTS.items()}) ann.annotate_export(SLUG, caps, slots, {'melt_flow_rate': mechanism}, inputs={'plant.configure': (PLANT, PLANT_EXAMPLE), 'sample.load': (SAMPLE, SAMPLE_EXAMPLE), 'method.configure': (METHOD, METHOD_EXAMPLE), 'balance.configure': (BALANCE, BALANCE_EXAMPLE)}) for k, v in SLOTS.items(): slots[k]['meaning_zh'] = v['meaning'] if v['reference']: slots[k]['reference_conditions'] = v['reference'] return dict(asset_type_id=ASSET_TYPE_ID, catalog_id=CATALOG_ID, capabilities=caps, state_slots=slots, mechanisms={'melt_flow_rate': mechanism})123456789101112131415161718192021222324"""Test configuration for the public ChemLab-Assets release.
The release does not redistribute cached third-party source documents (outputs/**/sources, source_cache, raw/folders, references/). Some tests re-hash those caches to prove provenance; when a cache is absent, the test isreported as skipped with the missing path instead of failing."""import pytest
UNPUBLISHED = ("/outputs/", "/references/", "/raw/", "source_cache", "/sources/", "/vendor/")
def _unpublished(exc): name = getattr(exc, "filename", None) return isinstance(exc, FileNotFoundError) and name and any(k in str(name) for k in UNPUBLISHED)
@pytest.hookimpl(hookwrapper=True)def pytest_runtest_makereport(item, call): outcome = yield rep = outcome.get_result() if call.excinfo is not None and call.when in ("setup", "call") and _unpublished(call.excinfo.value): rep.outcome = "skipped" rep.longrepr = (str(item.path), item.location[1] or 0, f"Skipped: needs an unpublished source cache ({call.excinfo.value.filename})")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916"""CHEM-147 AMETEK MOCON OX-TRAN 2/22 L runtime tests: python3 -m unittest tests/test_asset_ametek_oxtran.py
Themes (pipeline.md): setpoints only write targets; read/describe/poll are pure; rejected preconditions leave the stateunchanged; two instances are isolated; agent/evaluator truth isolation and result redaction; O2 mass and heat conservation;real return values validate against the contract schemas; async completion / cancellation residue.Physics: Faraday coulometry (1 cc/day = 0.000199 A), Fickian time lag and steady state against the analytical solution,Arrhenius and humidity transfer, barometric and permeant normalisation, ReZero baseline, individual zero, masks,over-range protection, drawer/clamp interlocks, thermoelectric heat-up against the manufacturer order of magnitude.No native scene, robot or hardware claims."""import copyimport importlib.utilimport jsonimport mathimport sysimport unittestfrom pathlib import Path
ROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT))from scripts.asset_runtime.ametek_oxtran import * # noqa: E402,F401,F403from scripts.asset_runtime import ametek_oxtran as rt # noqa: E402
PROCESS_EVIDENCE = {}CHECKS = []_spec = importlib.util.spec_from_file_location('oxtran_asset_tool', ROOT / 'skills/chemistry-lab-assets/scripts/asset_tool.py')asset_tool = importlib.util.module_from_spec(_spec)_spec.loader.exec_module(asset_tool)_ispec = importlib.util.spec_from_file_location('oxtran_interface', ROOT / 'outputs/expansion_batch04/t1_thermal/ametek_oxtran/interface_definition.py')interface = importlib.util.module_from_spec(_ispec)_ispec.loader.exec_module(interface)PET = 'poly_ethylene_terephthalate'T23 = 296.15
def call(h, k, **a): """Invoke through the runtime, validate the returned value and check that only declared slots changed immediately.""" before = h.read('debug') r = h.invoke(k, **a) validate(CAPS[k]['output_schema'], r) problems = asset_tool.validate_value(r, CAPS[k]['output_schema']) if problems: raise AssertionError(f'{k}: {problems}') after = h.read('debug') delta = {x for x in after if before[x] != after[x]} if k != 'sim.step' and not delta <= set(CAPS[k]['effects']): raise AssertionError(f'{k}: undeclared state changes {sorted(delta - set(CAPS[k]["effects"]))}') PROCESS_EVIDENCE.setdefault(k, []).append(dict(time_s=h.time_s, result_keys=sorted(r), actual_call=True)) return r
def configured(plant=None, gas=None, inst=None, cfg=None, cells=('A',)): h = AmetekOxtranRuntime() call(h, 'plant.configure', **dict(PLANT_EXAMPLE, **(plant or {}))) call(h, 'gas.configure', **dict(GAS_EXAMPLE, **(gas or {}))) call(h, 'instrument.configure', **dict(INSTRUMENT_EXAMPLE, **(inst or {}))) for c in cells: call(h, 'test.configure', **dict(TEST_CFG_EXAMPLE, cell=c, **(cfg or {}))) call(h, 'power.set', enabled=True) return h
def loaded(template=PET, thickness=100e-6, cell='A', h=None, mount=None, clamp=True, settle=3600.0, **kw): h = h or configured(**kw) call(h, 'drawer.move', cell=cell, open=True) h.step(3.0) call(h, 'sample.mount', **dict(MOUNT_EXAMPLE, cell=cell, template_id=template, thickness_m=thickness, **(mount or {}))) call(h, 'drawer.move', cell=cell, open=False) h.step(3.0) if clamp: call(h, 'cell.load_unload', cell=cell) h.step(settle) return h
def run_test(h, cell='A', limit_h=200.0, dt=1800.0): call(h, 'test.start', cell=cell) t = 0.0 while h.cells[cell]['test']['phase'] == 'running' and t < limit_h * 3600: call(h, 'sim.step', dt_s=dt) t += dt return call(h, 'test.result', cell=cell)
def steady_otr(template, thickness, T=T23 - PLANT_EXAMPLE['temperature_sensor_bias_k'], rh=0.0, o2=0.999, baro=101325.0, E=45000.0, beta=0.0): rec = library()[template] f = math.exp(-E / GAS_CONSTANT * (1 / T - 1 / rec['reference_temperature_K']) + beta * rh) pw = rh * saturation_pressure_pa(T) return rec['oxygen_permeability_mol_m_per_m2_s_Pa'] * f * o2 * (baro - pw) / thickness
class ConstantsAndLibrary(unittest.TestCase): def test01_identity_and_documented_constants(self): self.assertEqual(ASSET_TYPE_ID, 'instrument.ametek_oxtran') self.assertEqual(CATALOG_ID, 'CHEM-147') self.assertAlmostEqual(AMP_PER_CC_DAY, 0.000199, delta=0.0000005) # manual appendix D self.assertEqual(TEMPERATURE_RANGE_K, (283.15, 313.15)) self.assertAlmostEqual(TEST_AREA_M2, 50e-4) self.assertAlmostEqual(MAX_FILM_THICKNESS_M, 3.048e-3) self.assertEqual(OTR_RANGE_CC_M2_DAY, (0.005, 200.0)) self.assertAlmostEqual(SENSOR_RANGE_MOL_S * CC_DAY_PER_MOL_S, 1.0) # 200 cc/(m2 day) x 50 cm2 = 1 cc/day
def test02_interface_geometry_agrees_with_runtime(self): self.assertAlmostEqual(interface.DRAWER_TRAVEL_M, DRAWER_TRAVEL_M) self.assertAlmostEqual(interface.CLAMP_TRAVEL_M, CLAMP_TRAVEL_M) self.assertAlmostEqual(interface.POWER_SWITCH_ON_RAD, POWER_SWITCH_ON_RAD) self.assertAlmostEqual(interface.TEST_AREA_M2, TEST_AREA_M2) for part, sid, capid, *_ in interface.MOTION: self.assertIn(sid, SLOTS) self.assertIn(capid, CAPS) for r in interface.READOUTS: self.assertIn(r['source']['bridge'][0], SLOTS) self.assertEqual(SLOTS[r['source']['bridge'][0]]['visibility'], 'agent') for lamp in interface.LAMPS: self.assertIn(lamp['source']['lamp']['bridge'], SLOTS) for key, (capid, args) in interface.KEY_COMMANDS.items(): validate(CAPS[capid]['input_schema'], args) self.assertAlmostEqual(interface.OTR_DISPLAY_SCALE, CC_DAY_PER_MOL_S)
def test03_template_library_real_and_complete(self): lib = json.loads(LIBRARY_PATH.read_text()) self.assertGreaterEqual(lib['coverage']['template_count'], 50) self.assertGreaterEqual(lib['coverage']['with_measured_diffusivity'], 50) self.assertEqual(lib['coverage']['synthetic_records'], 0) for t in lib['templates']: self.assertEqual(t['evidence'], 'measured_literature') self.assertTrue(t['source']['sha256'] and t['measurements']) self.assertGreater(t['oxygen_permeability_mol_m_per_m2_s_Pa'], 0) pet = library()[PET] self.assertAlmostEqual(pet['oxygen_permeability_barrer'], 0.11, places=6) report = json.loads((ROOT / 'outputs/expansion_batch04/t1_thermal/ametek_oxtran/independent_permeation_source_validation.json').read_text()) self.assertEqual(report['status'], 'passed')
def test04_film_step_is_exactly_conservative_and_converges_to_linear_profile(self): c = [5.0] * 20 dx = 1e-6 total0 = sum(c) * dx jt_sum = jb_sum = 0.0 for _ in range(4000): c, jt, jb = rt.film_step(c, dx, 1e-12, 10.0, 0.0, 0.5) jt_sum += jt * 0.5 jb_sum += jb * 0.5 self.assertAlmostEqual(sum(c) * dx - total0, jt_sum - jb_sum, delta=1e-12 * total0) L = 20 * dx self.assertAlmostEqual(jb, 1e-12 * 10.0 / L, delta=1e-9 * 1e-12 * 10.0 / L)
def test05_is_stable_requires_step_and_window_drift(self): self.assertTrue(rt.is_stable([1.0, 1.0, 1.001, 1.0], 3, 1.0, 0.0)) self.assertFalse(rt.is_stable([1.0, 1.006, 1.012, 1.018], 3, 1.0, 0.0)) # every step < 1 % but drift 1.8 % self.assertFalse(rt.is_stable([1.0, 1.0], 3, 1.0, 0.0))
class RuntimeContract(unittest.TestCase): def test10_setpoints_only_write_targets(self): h = configured() T0 = h.T call(h, 'thermal.set_temperature', target_k=313.15) call(h, 'humidity.set', rh_fraction=0.5) self.assertEqual(h.T, T0) self.assertEqual(h.rh_model, 0.0) self.assertEqual(h.read('agent')['thermal.target_k'], 313.15) call(h, 'sim.step', dt_s=600.0) self.assertGreater(h.T, T0 + 3.0) self.assertGreater(h.rh_model, 0.3)
def test11_read_describe_poll_do_not_advance_time(self): h = loaded() h.register_principal('agent', 'agent') s = h.session('agent') r = s.invoke(instance_id='oxtran_01', capability_id='test.start', arguments={'cell': 'A'}, request_id='x1') t0, rev = h.time_ns, h.revision before = copy.deepcopy(h.read('debug')) for _ in range(3): s.read(instance_id='oxtran_01') s.describe(instance_id='oxtran_01') s.poll(r['operation_id']) call(h, 'test.result', cell='A') call(h, 'analysis.otr', **CAPS['analysis.otr']['example_arguments']) self.assertEqual((h.time_ns, h.revision), (t0, rev)) self.assertEqual(before, h.read('debug'))
def test12_rejections_leave_state_unchanged(self): h = configured() cases = [('test.start', dict(cell='A'), 'CELL_NOT_CLAMPED'), ('sample.mount', dict(MOUNT_EXAMPLE), 'DRAWER_NOT_OPEN'), ('sample.unmount', dict(cell='A'), 'NO_FILM'), ('humidity.set', dict(rh_fraction=0.02), 'RH_OUTSIDE_CONTROLLED_RANGE'), ('test.stop', dict(cell='A'), 'NOT_RUNNING'), ('instrument.configure', dict(INSTRUMENT_EXAMPLE, barometer_mode='manual', manual_barometer_pa=None), 'MANUAL_BAROMETER_REQUIRED'), ('plant.configure', dict(PLANT_EXAMPLE), 'PLANT_ALREADY_CONFIGURED'), ('package.test', {}, 'UNSUPPORTED')] for k, a, code in cases: before = copy.deepcopy(h.read('debug')) with self.assertRaises(ActionRejected) as e: h.invoke(k, **a) self.assertEqual(str(e.exception), code, k) self.assertEqual(before, h.read('debug'), k) with self.assertRaises(ActionRejected): h.invoke('thermal.set_temperature', target_k=320.0) with self.assertRaises(ActionRejected): h.invoke('test.configure', **dict(TEST_CFG_EXAMPLE, cycles=True))
def test13_two_instances_isolated(self): a = loaded() b = configured() call(a, 'thermal.set_temperature', target_k=303.15) a.step(3600.0) self.assertAlmostEqual(b.T, PLANT_EXAMPLE['ambient_k']) self.assertIsNone(b.cells['A']['film']) self.assertIsNotNone(a.cells['A']['film'])
def test14_agent_truth_isolation_and_redaction(self): h = loaded() h.register_principal('agent', 'agent'); h.register_principal('eval', 'evaluator') ag, ev = h.session('agent'), h.session('eval') obs = ag.read(instance_id='oxtran_01')['observations'] self.assertTrue(all(SLOTS[k]['visibility'] == 'agent' for k in obs)) self.assertFalse(any(k.startswith('truth.') for k in obs)) with self.assertRaises(ActionRejected): ag.read(instance_id='oxtran_01', state_ids=['truth.cell_a.flux_mol_s']) for k in ('ledger.read', 'provenance.read', 'sample.mount', 'drawer.move', 'sim.step', 'plant.configure'): self.assertEqual(ag.invoke(instance_id='oxtran_01', capability_id=k, arguments=CAPS[k]['example_arguments'], request_id='r' + k)['error']['code'], 'ACCESS_DENIED') r = ag.invoke(instance_id='oxtran_01', capability_id='test.start', arguments={'cell': 'A'}, request_id='s1') h.step(8 * 3600.0) res = ag.invoke(instance_id='oxtran_01', capability_id='test.result', arguments={'cell': 'A'}, request_id='q1')['result'] self.assertNotIn(PET, json.dumps(res)) self.assertIn('evaluator provenance.read', res['template_source']) prov = ev.invoke(instance_id='oxtran_01', capability_id='provenance.read', arguments={}, request_id='p1')['result'] self.assertIn(PET, prov['cell_a']) self.assertEqual(prov['operations'][0]['operation_id'], r['operation_id']) desc = ag.describe(instance_id='oxtran_01') self.assertFalse(any(v['visibility'] != 'agent' for v in desc['capabilities'].values()))
def test15_foreign_agent_guard_and_shared_panel_tests(self): h = loaded() for p in ('a1', 'a2'): h.register_principal(p, 'agent') h.register_principal('panel', 'evaluator') s1, s2, panel = h.session('a1'), h.session('a2'), h.session('panel') s1.invoke(instance_id='oxtran_01', capability_id='test.start', arguments={'cell': 'A'}, request_id='x') h.step(3600.0) for k, a in [('test.stop', {'cell': 'A'}), ('test.result', {'cell': 'A'}), ('cell.load_unload', {'cell': 'A'}), ('thermal.set_temperature', {'target_k': 300.0}), ('humidity.set', {'rh_fraction': 0.0}), ('power.set', {'enabled': False}), ('instrument.configure', dict(INSTRUMENT_EXAMPLE))]: self.assertEqual(s2.invoke(instance_id='oxtran_01', capability_id=k, arguments=a, request_id='y' + k)['error']['code'], 'ACCESS_DENIED', k) self.assertEqual(s1.invoke(instance_id='oxtran_01', capability_id='test.stop', arguments={'cell': 'A'}, request_id='z')['status'], 'succeeded') # a panel/host-started test is visible to every operator call(h, 'test.start', cell='A') h._owners[h.cells['A']['test']['op']] = 'panel' self.assertEqual(s2.invoke(instance_id='oxtran_01', capability_id='test.result', arguments={'cell': 'A'}, request_id='w')['status'], 'succeeded')
def test16_request_dedupe_conflict_and_write_via(self): h = configured() h.register_principal('agent', 'agent') s = h.session('agent') r1 = s.invoke(instance_id='oxtran_01', capability_id='thermal.set_temperature', arguments={'target_k': 300.0}, request_id='same') r2 = s.invoke(instance_id='oxtran_01', capability_id='thermal.set_temperature', arguments={'target_k': 300.0}, request_id='same') self.assertEqual(r1, r2) self.assertEqual(s.invoke(instance_id='oxtran_01', capability_id='thermal.set_temperature', arguments={'target_k': 301.0}, request_id='same')['error']['code'], 'REQUEST_CONFLICT') w = s.write(instance_id='oxtran_01', state_id='humidity.target_fraction', value=0.5, request_id='w1') self.assertEqual(w['status'], 'succeeded') self.assertEqual(h.rh_target, 0.5) with self.assertRaises(ActionRejected): s.write(instance_id='oxtran_01', state_id='cell_a.phase', value='idle', request_id='w2')
def test17_poll_and_cancel_keep_partial_readings(self): h = loaded() h.register_principal('agent', 'agent') s = h.session('agent') op = s.invoke(instance_id='oxtran_01', capability_id='test.start', arguments={'cell': 'A'}, request_id='s')['operation_id'] h.step(4 * 3600.0) self.assertEqual(s.poll(op)['status'], 'running') n = len(h.cells['A']['test']['readings']) self.assertGreater(n, 0) c = s.cancel(op, 'c1') self.assertEqual(c['status'], 'succeeded') self.assertEqual(s.cancel(op, 'c1'), c) res = s.poll(op) self.assertEqual(res['status'], 'cancelled') self.assertEqual(len(res['result']['readings']), n) self.assertEqual(res['result']['validity'], 'cancelled') h.step(3600.0) self.assertEqual(h.cells['A']['p_up'] < 1.0, True) # test gas switched back to carrier flushing with self.assertRaises(ActionRejected): s.cancel(op, 'c2')
def test18_unsupported_options_are_explicit(self): h = configured() for k in UNSUPPORTED: with self.assertRaises(ActionRejected) as e: h.invoke(k) self.assertEqual(str(e.exception), 'UNSUPPORTED')
class Physics(unittest.TestCase): def test20_heatup_matches_manufacturer_order_of_magnitude(self): h = configured() call(h, 'thermal.set_temperature', target_k=313.15) t = 0.0 while h.T + PLANT_EXAMPLE['temperature_sensor_bias_k'] < T23 + 0.99 * (313.15 - T23): h.step(30.0); t += 30.0 self.assertLess(t, 6 * 3600.0) # not an order of magnitude slower than ~60 min (2/28 manual) self.assertGreater(t, 20 * 60.0) h.step(3 * 3600.0) bias = PLANT_EXAMPLE['temperature_sensor_bias_k'] self.assertLess(abs(h.T + bias - 313.15), 0.02) # controlled on the (biased) sensor self.assertLess(abs(h.read('agent')['thermal.indicated_k'] - 313.15), 0.02) call(h, 'thermal.set_temperature', target_k=283.15) # thermoelectric cooling below ambient h.step(4 * 3600.0) self.assertLess(abs(h.T + bias - 283.15), 0.05) L = h.ledger() self.assertLess(abs(L['energy_residual_j']), 1e-6 * max(1.0, abs(L['tec_heat_j'])))
def test21_pet_time_lag_and_steady_state_vs_analytical(self): h = loaded() res = run_test(h)['result'] if False else run_test(h) exams = [r['otr_mol_m2_s'] for r in res['readings'] if r['kind'] == 'exam'] target = steady_otr(PET, 100e-6) self.assertEqual(res['validity'], 'valid') self.assertLess(exams[0], 0.7 * target) # the first exam still sits on the time-lag rise self.assertLess(abs(res['final_otr_mol_m2_s'] - target) / target, 0.01) self.assertTrue(res['converged'] and res['within_repeatability_spec']) self.assertAlmostEqual(res['permeance_mol_m2_s_pa'], res['final_otr_mol_m2_s'] / STD_PRESSURE_PA) self.assertAlmostEqual(res['permeability_mol_m_per_m2_s_pa'], res['permeance_mol_m2_s_pa'] * 100e-6) PROCESS_EVIDENCE['representative_pet_100um'] = dict(final_cc_m2_day=res['final_otr_cc_m2_day'], expected_cc_m2_day=target * CC_DAY_PER_MOL_S, exams=len(exams), individual_zero=res['individual_zero_mol_m2_s'])
def test22_quantisation_resolution_and_sensor_counts(self): h = loaded() res = run_test(h) for r in res['readings']: q = r['otr_cc_pkg_day'] / (OTR_RESOLUTION_CC_M2_DAY * TEST_AREA_M2) self.assertAlmostEqual(q, round(q), places=6) self.assertIsInstance(r['sensor_counts'], int) self.assertEqual(h.read('agent')['sensor.raw_counts'], int(round(h._measured_current() / COUNT_A))) # measured (noisy) current
def test23_faraday_sensor_current_matches_input(self): h = loaded() call(h, 'test.start', cell='A') h.step(6 * 3600.0) while h.route != 'A': h.step(60.0) h.step(29 * 60.0) I_ss = 4 * FARADAY * PLANT_EXAMPLE['sensor_efficiency'] * h.sensor_in + PLANT_EXAMPLE['sensor_background_a'] self.assertLess(abs(h.sensor_I - I_ss) / I_ss, 0.01)
def test24_rezero_baseline_is_subtracted(self): nz = dict(individual_zero='none') base = run_test(loaded(gas=dict(carrier_o2_impurity_fraction=2e-6), cfg=nz)) dirty = run_test(loaded(gas=dict(carrier_o2_impurity_fraction=5e-4), cfg=nz)) # large carrier residual: cancels via ReZero self.assertGreater(dirty['rezero_readings'][0]['sensor_counts'], 20 * base['rezero_readings'][0]['sensor_counts']) self.assertLess(abs(dirty['final_otr_mol_m2_s'] - base['final_otr_mol_m2_s']) / base['final_otr_mol_m2_s'], 0.02) noz = run_test(loaded(gas=dict(carrier_o2_impurity_fraction=5e-4), inst=dict(rezero_enabled=False), cfg=nz)) self.assertGreater(noz['final_otr_mol_m2_s'], dirty['final_otr_mol_m2_s'] + 5 * REPEATABILITY_CC_M2_DAY / CC_DAY_PER_MOL_S)
def test25_no_catalyst_removal_without_hydrogen(self): h1 = loaded(gas=dict(carrier_h2_fraction=0.02)) h2 = loaded(gas=dict(carrier_h2_fraction=0.0)) self.assertAlmostEqual(h1._carrier_residual_fraction(), 2e-6 * (1 - PLANT_EXAMPLE['catalyst_removal_efficiency'])) self.assertAlmostEqual(h2._carrier_residual_fraction(), 2e-6)
def test26_barometric_and_permeant_normalisation(self): ref = run_test(loaded()) alt = run_test(loaded(plant=dict(barometric_pa=85000.0))) self.assertLess(abs(alt['final_otr_mol_m2_s'] - ref['final_otr_mol_m2_s']) / ref['final_otr_mol_m2_s'], 0.015) # normalised to 760 mmHg air = run_test(loaded(gas=dict(test_o2_fraction=0.2095), inst=dict(permeant_concentration_percent=20.95))) self.assertLess(abs(air['final_otr_mol_m2_s'] - ref['final_otr_mol_m2_s']) / ref['final_otr_mol_m2_s'], 0.03) wrong = run_test(loaded(gas=dict(test_o2_fraction=0.2095))) # air supplied but 100 % declared self.assertLess(wrong['final_otr_mol_m2_s'], 0.25 * ref['final_otr_mol_m2_s'])
def test27_temperature_arrhenius(self): cold = run_test(loaded()) h = configured() call(h, 'thermal.set_temperature', target_k=308.15) h.step(3 * 3600.0) hot = run_test(loaded(h=h)) ratio = hot['final_otr_mol_m2_s'] / cold['final_otr_mol_m2_s'] expected = steady_otr(PET, 100e-6, T=308.15 - PLANT_EXAMPLE['temperature_sensor_bias_k']) / steady_otr(PET, 100e-6) self.assertLess(abs(ratio - expected) / expected, 0.02) self.assertGreater(ratio, 1.06 ** 12) # manufacturer: 6-15 % per degC for many barriers
def test28_humidity_dilution_and_water_sensitive_coefficient(self): h = configured() call(h, 'humidity.set', rh_fraction=0.9) h.step(3 * 3600.0) wet = run_test(loaded(h=h)) dry = run_test(loaded()) pw = h._rh_true() * saturation_pressure_pa(h.T) self.assertLess(abs(wet['final_otr_mol_m2_s'] / dry['final_otr_mol_m2_s'] - (101325 - pw) / 101325), 0.02) h2 = configured() call(h2, 'humidity.set', rh_fraction=0.5) call(h2, 'drawer.move', cell='A', open=True); h2.step(3.0) with self.assertRaises(ActionRejected) as e: h2.invoke('sample.mount', **dict(MOUNT_EXAMPLE, template_id='polyacrylonitrile')) self.assertEqual(str(e.exception), 'HUMIDITY_COEFFICIENT_REQUIRED') call(h2, 'sample.mount', **dict(MOUNT_EXAMPLE, template_id='polyacrylonitrile', thickness_m=25e-6, humidity_coefficient=2.0)) with self.assertRaises(ActionRejected) as e2: h2.invoke('sample.mount', **dict(MOUNT_EXAMPLE, cell='B', template_id='nylon_6')) self.assertIn(str(e2.exception), ('DIFFUSIVITY_REQUIRED', 'DRAWER_NOT_OPEN')) f = h2.cells['A']['film'] P1, D1, S1 = h2._transport(f, T23, 0.5) P0, D0, S0 = h2._transport(f, T23, 0.0) self.assertAlmostEqual(P1 / P0, math.exp(1.0)); self.assertAlmostEqual(S1, S0) with self.assertRaises(ActionRejected): h2.invoke('sample.mount', **dict(MOUNT_EXAMPLE, cell='B', humidity_coefficient=1.0))
def test29_mask_area_scales_package_but_not_area_result(self): full = run_test(loaded()) masked = run_test(loaded(mount=dict(exposed_area_m2=5e-4), cfg=dict(declared_area_m2=5e-4))) self.assertLess(abs(masked['final_otr_mol_m2_s'] - full['final_otr_mol_m2_s']) / full['final_otr_mol_m2_s'], 0.03) self.assertLess(abs(masked['final_otr_cc_pkg_day'] / full['final_otr_cc_pkg_day'] - 0.1), 0.005) pkg = run_test(loaded(cfg=dict(report_basis='package'))) self.assertAlmostEqual(pkg['final_otr_cc_pkg_day'], pkg['final_otr_mol_m2_s'] * TEST_AREA_M2 * CC_DAY_PER_MOL_S)
def test30_over_range_protection(self): h = loaded(thickness=25e-6) # PET 25 um ~ 257 cc/(m2 day) at 23 degC > 200 res = run_test(h) self.assertEqual(res['validity'], 'sensor_over_range') self.assertEqual(res['phase'], 'failed') self.assertGreaterEqual(h.ledger()['over_range_events'], 1) h.step(3600.0) self.assertFalse(h.over_range) empty = loaded(template=PET, mount=None, clamp=False) call(empty, 'drawer.move', cell='A', open=True); empty.step(3.0) call(empty, 'sample.unmount', cell='A') call(empty, 'drawer.move', cell='A', open=False); empty.step(3.0) call(empty, 'cell.load_unload', cell='A'); empty.step(600.0) self.assertEqual(run_test(empty)['validity'], 'sensor_over_range') # an empty cartridge floods the sensor
def test31_individual_zero_removes_ambient_ingress_not_edge_leak(self): leaky = run_test(loaded(plant=dict(ambient_ingress_mol_s_pa=4e-15, truseal_flush_efficiency=0.0))) clean = run_test(loaded()) self.assertLess(abs(leaky['final_otr_mol_m2_s'] - clean['final_otr_mol_m2_s']) / clean['final_otr_mol_m2_s'], 0.02) self.assertGreater(leaky['individual_zero_mol_m2_s'], 0.5 * 4e-15 * 0.2095 * 1e5 / TEST_AREA_M2) edge = run_test(loaded(plant=dict(edge_leak_mol_s_pa=1e-17))) bias = 1e-17 * 0.999 * 101325 / TEST_AREA_M2 self.assertGreater(edge['final_otr_mol_m2_s'] - clean['final_otr_mol_m2_s'], 0.8 * bias)
def test32_two_cells_share_one_sensor_with_rezero(self): h = configured(cells=('A', 'B')) loaded(h=h, cell='A') loaded(h=h, cell='B', template='poly_vinyl_chloride', thickness=50e-6) call(h, 'test.start', cell='A'); call(h, 'test.start', cell='B') seen = set() for _ in range(600): h.step(600.0) seen.add(h.route) if all(h.cells[c]['test']['phase'] != 'running' for c in 'AB'): break self.assertTrue({'A', 'B', 'Z'} <= seen) a, b = call(h, 'test.result', cell='A'), call(h, 'test.result', cell='B') self.assertEqual(a['validity'], 'valid'); self.assertEqual(b['validity'], 'valid') self.assertLess(abs(b['final_otr_mol_m2_s'] - steady_otr('poly_vinyl_chloride', 50e-6)) / steady_otr('poly_vinyl_chloride', 50e-6), 0.02)
def test33_standard_mode_cycles_and_start_zero(self): h = loaded(cfg=dict(test_mode='standard', cycles=4, individual_zero='start', conditioning_hours=0.0)) res = run_test(h) kinds = [r['kind'] for r in res['readings']] self.assertEqual(kinds.count('exam'), 4) self.assertEqual(kinds[0], 'individual_zero') self.assertEqual(res['phase'], 'succeeded')
def test34_conditioning_keeps_sensor_off_the_cell(self): h = loaded(cfg=dict(conditioning_hours=5.0)) call(h, 'test.start', cell='A') routes = set() for _ in range(28): h.step(600.0) if h.cells['A']['phase'] == 'conditioning': routes.add(h.route) self.assertNotIn('A', routes) self.assertGreater(h.cells['A']['p_up'], 9e4) # test gas already on during conditioning
def test35_drawer_clamp_interlocks_and_scene_states(self): h = configured() call(h, 'drawer.move', cell='A', open=True) h.step(DRAWER_TRAVEL_M / PLANT_EXAMPLE['drawer_speed_m_s'] / 2) self.assertTrue(0 < h.read('evaluator')['drawer_a.position_m'] < DRAWER_TRAVEL_M) with self.assertRaises(ActionRejected): h.invoke('cell.load_unload', cell='A') h.step(5.0) self.assertEqual(h.read('evaluator')['drawer_a.position_m'], DRAWER_TRAVEL_M) call(h, 'sample.mount', **MOUNT_EXAMPLE) call(h, 'drawer.move', cell='A', open=False); h.step(5.0) call(h, 'cell.load_unload', cell='A') h.step(PLANT_EXAMPLE['clamp_actuation_s'] / 2) self.assertTrue(0 < h.read('evaluator')['clamp_a.position_m'] < CLAMP_TRAVEL_M) h.step(5.0) st = h.read('evaluator') self.assertEqual(st['clamp_a.position_m'], CLAMP_TRAVEL_M) self.assertTrue(st['cell_a.clamped'] and st['cell_a.indicator_on']) with self.assertRaises(ActionRejected): h.invoke('drawer.move', cell='A', open=True) call(h, 'test.start', cell='A') with self.assertRaises(ActionRejected) as e: h.invoke('cell.load_unload', cell='A') self.assertEqual(str(e.exception), 'TEST_ACTIVE') call(h, 'test.stop', cell='A') call(h, 'cell.load_unload', cell='A'); h.step(5.0) self.assertFalse(h.read('agent')['cell_a.clamped']) self.assertGreater(h.ledger()['released_to_air_mol'], 0.0)
def test36_power_off_cancels_and_keeps_clamp(self): h = loaded() call(h, 'test.start', cell='A') h.step(3 * 3600.0) call(h, 'power.set', enabled=False) st = h.read('evaluator') self.assertEqual(st['cell_a.phase'], 'cancelled') self.assertTrue(st['cell_a.clamped']) self.assertIsNone(st['thermal.indicated_k']) self.assertEqual(st['power.angle_rad'], 0.0) self.assertEqual(call(h, 'test.result', cell='A')['validity'], 'cancelled') h.step(3600.0) self.assertEqual(h.sensor_I, 0.0)
def test37_conservation_over_a_complete_workflow(self): h = configured(cells=('A', 'B')) loaded(h=h, cell='A'); loaded(h=h, cell='B', template='poly_vinyl_chloride', thickness=50e-6) call(h, 'test.start', cell='A'); call(h, 'test.start', cell='B') h.step(4 * 3600.0) self.assertTrue(h._test_active('B')) call(h, 'test.stop', cell='B') call(h, 'cell.load_unload', cell='B'); h.step(10.0) call(h, 'drawer.move', cell='B', open=True); h.step(5.0) call(h, 'sample.unmount', cell='B') h.step(10 * 3600.0) L = call(h, 'ledger.read') prov = call(h, 'provenance.read') self.assertIsNone(prov['cell_b']) self.assertIn('poly_ethylene_terephthalate', prov['cell_a']) self.assertEqual(len(prov['operations']), 2) scale = max(L['film_mounted_mol'], L['carrier_in_mol']) self.assertLess(abs(L['film_residual_mol']), 1e-9 * scale) self.assertLess(abs(L['carrier_residual_balance_mol']), 1e-9 * scale) self.assertLess(abs(L['sensor_balance_residual_mol']), 1e-12 * max(L['sensor_input_mol'], 1e-30) + 1e-24) self.assertLess(abs(L['energy_residual_j']), 1e-6 * max(1.0, abs(L['tec_heat_j']))) self.assertGreater(L['carrier_gas_used_mol'], 0); self.assertGreater(L['test_gas_used_mol'], 0)
def test38_step_splitting_is_consistent(self): a, b = loaded(), loaded() call(a, 'test.start', cell='A'); call(b, 'test.start', cell='A') a.step(6 * 3600.0) for _ in range(360): b.step(60.0) self.assertEqual(a.time_ns, b.time_ns) self.assertLess(abs(a.read('evaluator')['truth.cell_a.flux_mol_s'] - b.read('evaluator')['truth.cell_a.flux_mol_s']), 0.01 * a.read('evaluator')['truth.cell_a.flux_mol_s']) self.assertEqual(len(a.cells['A']['test']['readings']), len(b.cells['A']['test']['readings']))
def test39_no_user_gain_on_the_2_22_and_analysis(self): h = loaded() with self.assertRaises(ActionRejected) as e: # 2/22: out-of-spec certified film -> service, no user adjustment h.invoke('sensor.adjust') self.assertEqual(str(e.exception), 'UNSUPPORTED') self.assertNotIn('sensor.adjust_gain', SLOTS) out = call(h, 'analysis.otr', readings_mol_m2_s=[1e-8, 1.01e-8, 1e-8], individual_zero_mol_m2_s=1e-10, window=3, driving_partial_pressure_pa=1e5, thickness_m=1e-4, convergence_percent=2.0) self.assertAlmostEqual(out['steady_state_otr_mol_m2_s'], 1.0033333333333333e-8 - 1e-10) self.assertTrue(out['converged']) self.assertAlmostEqual(out['permeability_barrer'], out['permeability_mol_m_per_m2_s_pa'] / rt.BARRER_SI)
def test40_metadata_exports_every_capability_and_slot(self): meta = export_ametek_oxtran_contract_metadata() self.assertEqual(set(meta['capabilities']), set(CAPS)) self.assertEqual(set(meta['state_slots']), set(SLOTS)) for k, c in meta['capabilities'].items(): self.assertEqual(asset_tool.lint_schema(c['input_schema']) if hasattr(asset_tool, 'lint_schema') else [], [], k) validate(c['input_schema'], c['example_arguments']) for k, s in meta['state_slots'].items(): if s['origin'] == 'process_truth': self.assertIn(s['visibility'], ('evaluator', 'debug')) self.assertEqual(set(WRITE_VIA), {'thermal.target_k', 'humidity.target_fraction'})
def test41_high_permeance_film_is_stable_and_matches_coupled_steady_state(self): # most permeable template with a measured D, thin film, tiny carrier chamber: film and chamber strongly coupled lib = library() top = max((k for k in lib if lib[k]['oxygen_diffusivity_m2_s']), key=lambda k: lib[k]['oxygen_permeability_mol_m_per_m2_s_Pa']) V = 1e-7 h = loaded(template=top, thickness=25e-6, settle=5.0, plant=dict(carrier_chamber_volume_m3=V), cfg=dict(conditioning_hours=5.0, individual_zero='none')) call(h, 'test.start', cell='A') for _ in range(24): call(h, 'sim.step', dt_s=300.0) ev = h.read('evaluator') self.assertTrue(all(math.isfinite(v) for v in ev.values() if isinstance(v, float) and not isinstance(v, bool))) self.assertGreaterEqual(ev['truth.cell_a.carrier_side_o2_mol'], 0.0) self.assertEqual(h.cells['A']['phase'], 'conditioning') # sensor bypassed: no over-range trip while conditioning film = h.cells['A']['film'] P, D, S = h._transport(film, h.T, h._rh_true()) p = h.plant p_up = h.cells['A']['p_up'] n_c = rt.molar_flow(CARRIER_FLOW_SCCM) kh = n_c * GAS_CONSTANT * h.T / h._baro() / V g = TEST_AREA_M2 * P / film['L'] q_in = p['edge_leak_mol_s_pa'] * p_up + p['ambient_ingress_mol_s_pa'] * (1 - p['truseal_flush_efficiency']) * h._air_o2_pa() + h._carrier_residual_fraction() * n_c n_ss = (g * p_up + q_in) / (kh + g * GAS_CONSTANT * h.T / V) self.assertLess(abs(h.cells['A']['n_h'] / n_ss - 1), 1e-6) self.assertGreater(n_ss * GAS_CONSTANT * h.T / V, 0.5 * p_up) # carrier side far from the zero-back-pressure limit L = h.ledger() scale = max(L['film_mounted_mol'], L['carrier_in_mol']) self.assertLess(abs(L['film_residual_mol']), 1e-9 * scale) self.assertLess(abs(L['carrier_residual_balance_mol']), 1e-9 * scale)
def test42_no_carrier_supply_means_no_sweep_and_no_sensor_flow(self): h = loaded(gas=dict(carrier_supply_gauge_pa=0.0), settle=1800.0) n_air = AIR_O2_FRACTION * (101325.0 - 0.45 * saturation_pressure_pa(296.15)) * PLANT_EXAMPLE['carrier_chamber_volume_m3'] / (GAS_CONSTANT * 296.15) self.assertGreaterEqual(h.read('evaluator')['truth.cell_a.carrier_side_o2_mol'], n_air * (1 - 1e-9)) # trapped air is not flushed L = h.ledger() self.assertEqual(L['carrier_gas_used_mol'], 0.0) self.assertLess(abs(L['to_sensor_mol'] + L['to_vent_mol']), 1e-18) # no sweep (rounding-level only) self.assertEqual(L['rezero_stream_mol'] + L['sensor_input_mol'], 0.0) self.assertFalse(h.read('agent')['gas.supply_ok']) with self.assertRaises(ActionRejected) as e: h.invoke('test.start', cell='A') self.assertEqual(str(e.exception), 'GAS_SUPPLY_PRESSURE_OUT_OF_RANGE')
def test43_rezero_stream_is_over_range_protected(self): # no H2 in the carrier: 1000 ppm O2 x 10 sccm ~ 14 cc/day on the ReZero stream, far above the 1.25 cc/day protection limit h = loaded(gas=dict(carrier_h2_fraction=0.0, carrier_o2_impurity_fraction=1e-3), cfg=dict(individual_zero='none', conditioning_hours=0.0)) call(h, 'test.start', cell='A') self.assertEqual(h.seq['kind'], 'Z') stream = 1e-3 * rt.molar_flow(CARRIER_FLOW_SCCM) worst = 0.0 while h._test_active('A') and h.time_s < 40 * 3600: h.step(MAX_SUBSTEP_S) worst = max(worst, h.sensor_I) self.assertLess(worst, 0.5 * 4 * FARADAY * stream) # protected within one sub-step, far below the stream's current self.assertGreaterEqual(h.ledger()['over_range_events'], 1) self.assertEqual(h.zero_list, []) # no ReZero value from a protected slot self.assertEqual(call(h, 'test.result', cell='A')['validity'], 'sensor_over_range')
def test44_partial_slots_record_nothing(self): # conditioning ends 20 s before the end of the first cell-A slot: that slot must not produce an exam h = loaded(cfg=dict(conditioning_hours=(3600.0 - 20.0) / 3600.0, individual_zero='none', test_mode='standard', cycles=1)) res = run_test(h, dt=60.0) times = [r['time_s'] for r in res['readings'] if r['kind'] == 'exam'] self.assertEqual(times, [9000.0]) # Z 0-1800, A 1800-3600 (partial), idle B, Z, A 7200-9000 self.assertEqual(res['validity'], 'valid') self.assertLess(abs(res['final_otr_mol_m2_s'] / steady_otr(PET, 100e-6) - 1), 0.25) # a test started in the middle of the other cell's idle slot waits for a complete slot h = configured(cells=('A', 'B')) loaded(h=h, cell='A'); loaded(h=h, cell='B', template='poly_vinyl_chloride', thickness=50e-6) call(h, 'test.start', cell='A') while not (h.seq['kind'] == 'B' and h.time_ns - h.seq['start_ns'] > 60e9): h.step(30.0) call(h, 'test.start', cell='B') start_b = h.time_s h.step(3 * 3600.0) exams_b = [r for r in h.cells['B']['test']['readings'] if r['kind'] == 'exam'] self.assertTrue(exams_b) self.assertGreaterEqual(exams_b[0]['time_s'], TEST_CFG_EXAMPLE['exam_minutes'] * 60.0) self.assertGreater(exams_b[0]['time_s'] + start_b, start_b + 1800.0)
def test45_power_loss_during_release_unseals_the_cell(self): h = loaded(settle=600.0) call(h, 'cell.load_unload', cell='A') # release stroke starts h.step(PLANT_EXAMPLE['clamp_actuation_s'] / 2) call(h, 'power.set', enabled=False) st = h.read('evaluator') self.assertFalse(st['cell_a.clamped']) self.assertTrue(0 < st['clamp_a.position_m'] < CLAMP_TRAVEL_M) self.assertEqual(st['truth.cell_a.carrier_side_o2_mol'], 0.0) with self.assertRaises(ActionRejected) as e: h.invoke('drawer.move', cell='A', open=True) # the platen is still part-way down self.assertEqual(str(e.exception), 'CARTRIDGE_CLAMPED') call(h, 'power.set', enabled=True) call(h, 'cell.load_unload', cell='A'); h.step(5.0) # completes the clamp stroke and reseals with trapped air self.assertTrue(h.read('agent')['cell_a.clamped']) call(h, 'cell.load_unload', cell='A'); h.step(5.0) call(h, 'drawer.move', cell='A', open=True); h.step(3.0) self.assertEqual(h.read('evaluator')['drawer_a.position_m'], DRAWER_TRAVEL_M) L = h.ledger() scale = max(L['film_mounted_mol'], L['carrier_in_mol']) self.assertLess(abs(L['carrier_residual_balance_mol']), 1e-9 * scale) self.assertLess(abs(L['film_residual_mol']), 1e-9 * scale)
def test46_analysis_inputs_are_bounded(self): h = configured() for bad in ([1e308, 1e308], [2e-3]): with self.assertRaises(ActionRejected): h.invoke('analysis.otr', readings_mol_m2_s=bad, individual_zero_mol_m2_s=None, window=2, driving_partial_pressure_pa=1e5, thickness_m=None, convergence_percent=1.0) out = call(h, 'analysis.otr', readings_mol_m2_s=[1e-3, -1e-3] * (MAX_READINGS // 2), individual_zero_mol_m2_s=-1e-3, window=100, driving_partial_pressure_pa=1.0, thickness_m=0.01, convergence_percent=1.0) self.assertTrue(all(math.isfinite(v) for v in out.values() if isinstance(v, float)))
def test47_describe_returns_private_copies(self): h = configured() h.register_principal('ag', 'agent') d = h.session('ag').describe(instance_id='oxtran_01') n = len(rt.LIMITATIONS) d['capabilities']['test.result']['limitations'].append('mutated by a caller') d['state_slots']['clock.time_s']['meaning_zh'] = 'mutated' self.assertEqual(len(rt.LIMITATIONS), n) meta = export_ametek_oxtran_contract_metadata() self.assertNotIn('mutated by a caller', meta['mechanisms']['oxygen_permeation']['limitations']) self.assertNotIn('mutated by a caller', meta['capabilities']['power.set']['limitations']) self.assertNotEqual(meta['state_slots']['clock.time_s']['meaning_zh'], 'mutated')
def test48_rezero_time_base_and_new_gas_invalidates_the_baseline(self): h = loaded(cfg=dict(individual_zero='none', conditioning_hours=0.0, test_mode='standard', cycles=2)) res = run_test(h, dt=600.0) self.assertEqual([z['time_s'] for z in res['rezero_readings']][:2], [1800.0, 7200.0]) # same time base as the exams self.assertEqual([r['time_s'] for r in res['readings']], [3600.0, 9000.0]) self.assertIsNotNone(h.zero_current) call(h, 'gas.configure', **dict(GAS_EXAMPLE, carrier_o2_impurity_fraction=5e-4)) self.assertIsNone(h.zero_current) call(h, 'test.start', cell='A') self.assertEqual(h.seq['kind'], 'Z') # a new supply is re-zeroed before the next exam call(h, 'power.set', enabled=False) self.assertIsNone(h.zero_current)
def test49_panel_counts_carry_the_measurement_noise(self): h = loaded() call(h, 'test.start', cell='A') diffs = [] for _ in range(400): h.step(30.0) a = h.read('agent') self.assertEqual(a, h.read('agent')) # reads stay pure sigma = math.hypot(PLANT_EXAMPLE['sensor_noise_a'], PLANT_EXAMPLE['sensor_relative_noise'] * max(h.sensor_I_o2, 0.0)) diffs.append((a['sensor.raw_counts'] * COUNT_A - h.read('evaluator')['truth.sensor_current_a']) / sigma) rms = math.sqrt(sum(d * d for d in diffs) / len(diffs)) self.assertTrue(0.6 < rms < 1.6, rms) # carries the declared noise, not the noise-free truth # an exam reading is the panel measurement at the slot end t = h.cells['A']['test'] n = len(t['readings']) while len(t['readings']) == n: before = h._measured_current() h.step(1.0) self.assertEqual(t['readings'][-1]['sensor_counts'], int(round(h._measured_current() / COUNT_A)))
def test50_over_range_is_detected_on_the_measured_current_and_visible(self): target = 1.6 / CC_DAY_PER_MOL_S # 1.6 cc/day on the sensor (> 1.25 cc/day) L = steady_otr(PET, 1.0) * TEST_AREA_M2 / target h = loaded(thickness=L, settle=3 * 3600.0, cfg=dict(individual_zero='none', conditioning_hours=0.0), plant=dict(sensor_noise_a=0.0, sensor_relative_noise=0.0)) call(h, 'test.start', cell='A') seen = None for _ in range(800): h.step(10.0) a = h.read('agent') if a['sensor.over_range']: seen = (a['sensor.route'], a['cell_a.phase']) break self.assertEqual(seen, ('bypass', 'failed')) self.assertGreater(h.sensor_I, 0.5 * OVER_RANGE_CURRENT_A) # the flag is raised by the current, not by the inlet flow h.step(3600.0) self.assertFalse(h.read('agent')['sensor.over_range']) self.assertEqual(call(h, 'test.result', cell='A')['terminal_reason'], 'SENSOR_OVER_RANGE')
def test51_continuous_mode_ends_by_operator_stop(self): for zero in ('end', 'none'): h = loaded(cfg=dict(test_mode='continuous', individual_zero=zero, conditioning_hours=0.0)) call(h, 'test.start', cell='A') while h.cells['A']['exam_count'] < 6: call(h, 'sim.step', dt_s=1800.0) out = call(h, 'test.stop', cell='A') if zero == 'end': self.assertEqual(out['phase'], 'running') self.assertEqual(h.cells['A']['phase'], 'zero_end') while h._test_active('A'): call(h, 'sim.step', dt_s=1800.0) res = call(h, 'test.result', cell='A') self.assertEqual(res['phase'], 'succeeded') self.assertEqual(res['terminal_reason'], 'TEST_COMPLETE' if zero == 'end' else 'OPERATOR_STOP') self.assertEqual(res['validity'], 'valid') self.assertEqual(res['individual_zero_mol_m2_s'] is not None, zero == 'end') self.assertEqual(h.read('agent')['cell_a.final_otr_mol_m2_s'], res['final_otr_mol_m2_s']) # standard mode stopped early is still a cancellation h = loaded(cfg=dict(test_mode='standard', cycles=10, individual_zero='none', conditioning_hours=0.0)) call(h, 'test.start', cell='A'); h.step(3 * 3600.0) self.assertEqual(call(h, 'test.stop', cell='A')['phase'], 'cancelled')
def test52_humidity_change_during_a_test_is_flagged(self): h = loaded(cfg=dict(test_mode='standard', cycles=4, individual_zero='none', conditioning_hours=0.0)) call(h, 'test.start', cell='A') h.step(2 * 3600.0) call(h, 'humidity.set', rh_fraction=0.9) res = run_test(h) if False else None while h._test_active('A'): call(h, 'sim.step', dt_s=1800.0) res = call(h, 'test.result', cell='A') self.assertEqual(res['validity'], 'humidity_out_of_tolerance') self.assertEqual(res['conditions']['target_rh'], 0.0)
def test53_humidity_coefficient_is_a_mount_prior_without_agent_oracle(self): h = configured() call(h, 'drawer.move', cell='A', open=True); h.step(3.0) with self.assertRaises(ActionRejected) as e: # even for a dry test h.invoke('sample.mount', **dict(MOUNT_EXAMPLE, template_id='polyacrylonitrile')) self.assertEqual(str(e.exception), 'HUMIDITY_COEFFICIENT_REQUIRED') call(h, 'sample.mount', **dict(MOUNT_EXAMPLE, template_id='polyacrylonitrile', humidity_coefficient=0.0)) h.register_principal('ag', 'agent') r = h.session('ag').invoke(instance_id='oxtran_01', capability_id='humidity.set', arguments={'rh_fraction': 0.5}, request_id='rh') self.assertEqual(r['status'], 'succeeded') # no template-class dependent rejection
def test54_provenance_is_bounded(self): h = loaded() for _ in range(MAX_PROVENANCE + 5): h.invoke('test.start', cell='A') h.invoke('test.stop', cell='A') prov = call(h, 'provenance.read') self.assertEqual(len(prov['operations']), MAX_PROVENANCE) self.assertEqual(prov['operations'][-1]['operation_id'], h.cells['A']['test']['op'])
def test55_ledgers_are_real_conservation_checks(self): h = configured(cells=('A', 'B'), cfg=dict(conditioning_hours=0.5)) loaded(h=h, cell='A'); loaded(h=h, cell='B', template='poly_vinyl_chloride', thickness=50e-6) call(h, 'test.start', cell='A'); call(h, 'test.start', cell='B') h.step(4 * 3600.0) call(h, 'humidity.set', rh_fraction=0.4); call(h, 'thermal.set_temperature', target_k=303.15) h.step(3 * 3600.0) call(h, 'test.stop', cell='B'); call(h, 'cell.load_unload', cell='B'); h.step(5.0) call(h, 'drawer.move', cell='B', open=True); h.step(3.0) call(h, 'sample.unmount', cell='B') call(h, 'sample.mount', **dict(MOUNT_EXAMPLE, cell='B', template_id='polystyrene', thickness_m=500e-6)) h.step(1200.0) call(h, 'power.set', enabled=False); h.step(1800.0); call(h, 'power.set', enabled=True) call(h, 'drawer.move', cell='B', open=False); h.step(3.0) call(h, 'cell.load_unload', cell='B') h.step(20 * 3600.0) L = call(h, 'ledger.read') scale = max(L['film_mounted_mol'], L['carrier_in_mol']) self.assertLess(abs(L['film_residual_mol']), 1e-12 * scale) self.assertLess(abs(L['carrier_residual_balance_mol']), 1e-12 * scale) self.assertLess(abs(L['sensor_balance_residual_mol']), 1e-13 * L['sensor_input_mol']) self.assertLess(abs(L['energy_residual_j']), 1e-9 * abs(L['tec_heat_j'])) self.assertGreater(L['sensor_discarded_mol'], 0.0) # the residuals are not identities: an O2 amount that appears without a booked flux shows up h.cells['A']['n_h'] += 1e-9 self.assertAlmostEqual(h.ledger()['carrier_residual_balance_mol'] / -1e-9, 1.0, places=3) h.cells['A']['conc'][0] += 1.0 f = h.cells['A']['film'] self.assertAlmostEqual(h.ledger()['film_residual_mol'] / -(f['dx'] * f['area']), 1.0, places=3)
def test56_rezero_over_range_fails_every_active_test_once(self): h = configured(cells=('A', 'B'), gas=dict(carrier_h2_fraction=0.0, carrier_o2_impurity_fraction=1e-3), cfg=dict(individual_zero='none', conditioning_hours=0.0)) loaded(h=h, cell='A'); loaded(h=h, cell='B', template='poly_vinyl_chloride', thickness=50e-6) call(h, 'test.start', cell='A'); call(h, 'test.start', cell='B') self.assertEqual(h.seq['kind'], 'Z') for _ in range(360): h.step(10.0) for cell in 'AB': res = call(h, 'test.result', cell=cell) self.assertEqual((res['phase'], res['validity'], res['terminal_reason']), ('failed', 'sensor_over_range', 'SENSOR_OVER_RANGE')) self.assertEqual(res['exam_count'], 0) self.assertEqual(h.ledger()['over_range_events'], 1) # the tripped stream is not re-entered self.assertEqual(h.zero_list, []) self.assertIsNone(h.seq)
def test57_cancel_aborts_even_a_continuous_test(self): h = loaded(cfg=dict(test_mode='continuous', individual_zero='end', conditioning_hours=0.0)) h.register_principal('ag', 'agent') s = h.session('ag') op = s.invoke(instance_id='oxtran_01', capability_id='test.start', arguments={'cell': 'A'}, request_id='s')['operation_id'] h.step(6 * 3600.0) c = s.cancel(op, 'c1') self.assertEqual((c['status'], c['result']['phase']), ('succeeded', 'cancelled')) self.assertEqual(s.cancel(op, 'c1'), c) self.assertEqual(s.poll(op)['status'], 'cancelled') self.assertEqual(s.poll(op)['result']['validity'], 'cancelled') with self.assertRaises(ActionRejected): s.cancel(op, 'c2') call(h, 'cell.load_unload', cell='A') # no longer TEST_ACTIVE
def test58_no_exam_without_a_baseline(self): pvc = 'poly_vinyl_chloride' kw = dict(template=pvc, thickness=50e-6, cfg=dict(test_mode='standard', cycles=1, individual_zero='none', conditioning_hours=0.0), inst=dict(rezero_frequency=3)) h = loaded(**kw) call(h, 'test.start', cell='A') h.step(3600.0 - 100.0) # Z 0-1800, A 1800-3600: 100 s before the first exam call(h, 'test.stop', cell='A') call(h, 'gas.configure', **dict(GAS_EXAMPLE, carrier_o2_impurity_fraction=5e-4)) # new cylinder: baseline invalid call(h, 'test.start', cell='A') while h._test_active('A'): h.step(600.0) res = call(h, 'test.result', cell='A') self.assertTrue(res['rezero_readings']) self.assertLess(res['rezero_readings'][0]['time_s'], res['readings'][0]['time_s']) self.assertEqual(res['validity'], 'valid') self.assertLess(abs(res['final_otr_mol_m2_s'] / steady_otr(pvc, 50e-6) - 1), 0.03)
def test59_capability_metadata_is_specific(self): meta = export_ametek_oxtran_contract_metadata() slots = meta['state_slots'] pre = {json.dumps(c['preconditions'], ensure_ascii=False, sort_keys=True) for c in meta['capabilities'].values() if c['preconditions']} self.assertGreater(len(pre), 8) # not one template for every command for k, c in meta['capabilities'].items(): for e in c['errors']: self.assertNotEqual(e['meaning_zh'], e['code'], k) self.assertNotIn(e['code'], ('TEST_COMPLETE', 'OPERATOR_STOP'), k) # success reasons are not errors for sid in c['observes'] + [x for p in c['preconditions'] for x in p['state_ids']]: self.assertIn(sid, slots, k) if c['visibility'] == 'agent': self.assertTrue(all(slots[sid]['visibility'] == 'agent' for sid in c['observes']), k) if c['availability'] == 'implemented' and c['kind'] not in ('analysis', 'query'): self.assertTrue(c['observes'] or k == 'test.configure', k) params = meta['mechanisms']['oxygen_permeation']['parameters'] humanized = [k for k, v in params.items() if v['meaning_zh'].split(';')[0].replace(' ', '_').lower() == k.lower()] self.assertEqual(humanized, []) self.assertIsNotNone(slots['truth.cell_a.test_side_o2_pa']['reference_conditions']) for k in ('humidity_coefficient', 'permeability_override_mol_m_per_m2_s_pa', 'diffusivity_override_m2_s', 'declared_thickness_m', 'manual_barometer_pa'): self.assertIn(k, params) # nullable host priors are exported too caps = meta['capabilities'] self.assertNotIn('ACCESS_DENIED', [e['code'] for e in caps['test.start']['errors']]) # agent-visible and not foreign-guarded self.assertIn('ACCESS_DENIED', [e['code'] for e in caps['test.stop']['errors']]) self.assertIn('INVALID_ARGUMENT', [e['code'] for e in caps['sensor.adjust']['errors']]) # the preconditions that reject test.start / cell.load_unload are visible to an agent h = loaded(cells=('A',), clamp=False) a = h.read('agent') self.assertTrue(a['cell_a.method_configured'] and not a['cell_b.method_configured']) call(h, 'cell.load_unload', cell='A') self.assertTrue(h.read('agent')['cell_a.clamp_moving']) h.step(5.0) self.assertFalse(h.read('agent')['cell_a.clamp_moving'])
if __name__ == '__main__': unittest.main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179"""CHEM130 empirical indentation, finite work, OP observation and session tests."""import copy,hashlib,importlib.util,json,math,sys,unittestfrom pathlib import Pathimport numpy as npROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'))from asset_runtime import antonpaar_hit300 as rtOBSERVED=[];STATES=[]def canonical(v): if isinstance(v,dict):return {str(k):canonical(x) for k,x in v.items()} if isinstance(v,(list,tuple)):return [canonical(x) for x in v] if isinstance(v,np.ndarray):return v.tolist() return vdef state(h):return json.dumps(canonical(h.__dict__),sort_keys=True,allow_nan=False)def call(h,k,**a): before=h.read();r=h.invoke(k,**a);after=h.read();json.dumps(r,allow_nan=False);json.dumps(after,allow_nan=False);OBSERVED.append((k,copy.deepcopy(a),copy.deepcopy(r)));STATES.append(after) changed={x for x in before if before[x]!=after[x]} if not changed<=set(rt.CAPS[k]['effects']):raise AssertionError((k,'undeclared state effects',changed-set(rt.CAPS[k]['effects']))) return rdef step(h,t):h.step(t);STATES.append(h.read());json.dumps(h.read(),allow_nan=False)def setup(name='hit_test',plant=None,sample=None,method=None,calibration=None): h=rt.AntonpaarHit300Runtime(name) for k,a in [('plant.configure',dict(rt.PLANT_EXAMPLE,**(plant or {}))),('specimen.load',dict(rt.SAMPLE_EXAMPLE,**(sample or {}))),('power.set',{'enabled':True}),('clamp.set',{'locked':True}),('stage.set_y',{'position_m':.02,'accept_manual':True}),('stage.move_x',{'position_m':.02,'speed_m_s':.005}),('sensor.zero',{}),('sensor.calibrate',dict(rt.CALIBRATION_EXAMPLE,**(calibration or {}))),('head.set_position',{'distance_m':0.})]:call(h,k,**a) step(h,9.);call(h,'contact.set',engaged=True);call(h,'method.configure',**dict(dict(rt.METHOD_EXAMPLE,x_positions_m=[.02],hold_s=.2),**(method or {})));return hdef run(h): call(h,'acquisition.start') for _ in range(4000): step(h,.1) if h.phase!='running':break if h.phase=='running':raise AssertionError('no finite terminal state') return call(h,'acquisition.result')def park(h): if h.phase=='running':call(h,'acquisition.stop') step(h,3.);call(h,'contact.set',engaged=False);call(h,'head.set_position',distance_m=.09);step(h,9.)def cleanup(h):park(h);call(h,'clamp.set',locked=False);call(h,'specimen.remove');call(h,'power.set',enabled=False)def fixture(m=1.5,frame=0.,n=101): x=np.linspace(1.,.05,n);p=.005*x**m;h=1e-7+1e-7*x+frame*p;return p.tolist(),h.tolist()class TestHIT300(unittest.TestCase): def rejected(self,h,k,error='.',**a): before=state(h) with self.assertRaisesRegex(rt.ActionRejected,error):h.invoke(k,**a) self.assertEqual(before,state(h)) def ledger(self,h): l=call(h,'ledger.read');self.assertLess(abs(l['sample_error_kg']),1e-13);self.assertLess(abs(l['volume_error_m3']),1e-19);self.assertLess(abs(l['energy_error_j']),1e-19);self.assertLess(abs(l['thermal_error_j']),1e-19);self.assertGreaterEqual(l['pristine_volume_m3'],0.);self.assertAlmostEqual(l['plastic_work_j'],l['heat_input_j']+l['defect_stored_j'],places=20);return l def test_01_raw_source_time_padding_and_branch_preservation(self): r=rt.library()['substances']['borofloat33_5mn_rep1'];original=json.dumps(r,sort_keys=True);m=rt.source_model(r,True);self.assertEqual(len(r['values']['load_n']),652);self.assertIsNone(r['values']['time_s']);self.assertEqual(m['projection']['padding_nodes_excluded'],540);self.assertEqual(m['projection']['active_last_index'],111);self.assertGreater(m['projection']['elastic_release_below_observed_min_load_n'],0);self.assertEqual(original,json.dumps(r,sort_keys=True));self.assertGreater(m['maximum_load'],.005);self.assertTrue(np.all(np.diff(m['plastic'])>=0)) def test_02_two_real_materials_drive_different_observed_outputs(self): moduli=[] for rid in ['borofloat33_5mn_rep1','soda_lime_glass_5mn_rep1']: h=setup(sample={'reference_id':rid});r=run(h);self.assertEqual(r['phase'],'succeeded');self.assertEqual(r['completed_indents'],1);self.assertIsNotNone(r['points'][0]['analysis']);self.assertEqual(r['reference_id'],rid);moduli.append(r['points'][0]['analysis']['sample_modulus_pa']);self.ledger(h) self.assertNotEqual(*moduli) def test_03_full_array_load_release_retract_move_and_history(self): h=setup(method={'x_positions_m':[.02,.022]});r=run(h);self.assertEqual(r['completed_indents'],2);self.assertEqual(len(r['points']),2);self.assertEqual(len(h.damage),2);self.assertGreater(h.damage[0]['plastic_depth_m'],0);self.assertEqual(h.stage_y,.02);self.assertAlmostEqual(h.stage_x,.022);phases={x['phase'] for x in r['rows']};self.assertTrue({'loading','holding','unloading','release','retracting','moving','approaching'}<=phases);self.assertEqual(h.force,0.);self.ledger(h) def test_04_actual_load_is_not_target_and_read_never_steps(self): h=setup();call(h,'acquisition.start');self.assertEqual(h.force,0.);before=state(h) for _ in range(3):h.read();call(h,'acquisition.result');h.describe() self.assertEqual(state(h),before);step(h,.1);self.assertGreater(h.force,0.);self.assertLess(h.force,h.force_target);self.assertAlmostEqual(h.force_target,.1*h.method['loading_rate_n_s']);self.assertGreater(h.plastic_depth,0.) def test_05_op_analytic_powerlaw_hardness_and_reduced_vs_sample_modulus(self): for exponent in [1.2,1.5,2.,2.8]: p,h=fixture(exponent);c=rt.CALIBRATION_EXAMPLE;r=rt.oliver_pharr(p,h,c);s=.005*exponent/1e-7;hc=2e-7-c['epsilon']*.005/s;area=24.5*hc*hc;er=math.sqrt(math.pi)*s/(2*c['beta']*math.sqrt(area));e=(1-c['poisson_sample']**2)/(1/er-(1-c['poisson_tip']**2)/c['young_tip_pa']);self.assertAlmostEqual(r['unloading_exponent'],exponent,delta=1e-6);self.assertAlmostEqual(r['hardness_pa'],.005/area,delta=1000);self.assertAlmostEqual(r['sample_modulus_pa'],e,delta=10000);self.assertNotEqual(r['sample_modulus_pa'],r['reduced_modulus_pa']) def test_06_frame_compliance_corrected_once(self): p,h=fixture(frame=3e-7);base=rt.oliver_pharr(*fixture(),rt.CALIBRATION_EXAMPLE);good=rt.oliver_pharr(p,h,dict(rt.CALIBRATION_EXAMPLE,frame_compliance_m_n=3e-7));bad=rt.oliver_pharr(p,h,rt.CALIBRATION_EXAMPLE);self.assertAlmostEqual(good['stiffness_n_m'],base['stiffness_n_m'],delta=.01);self.assertAlmostEqual(good['sample_modulus_pa'],base['sample_modulus_pa'],delta=1000);self.assertGreater(abs(bad['stiffness_n_m']-good['stiffness_n_m']),100) def test_07_op_rejects_loading_creep_nose_and_bad_window(self): hst=setup();p,h=fixture();a=dict(load_n=p,depth_m=h,calibration=rt.CALIBRATION_EXAMPLE);self.rejected(hst,'analysis.oliver_pharr','NOT_UNLOADING',**dict(a,load_n=p[::-1],depth_m=h[::-1]));nose=h.copy();nose[2]=h[0]*1.1;self.rejected(hst,'analysis.oliver_pharr','UNLOADING_NOSE',**dict(a,depth_m=nose));self.rejected(hst,'analysis.oliver_pharr','FIT_DATA',**dict(a,depth_m=h[:-1]));self.rejected(hst,'analysis.oliver_pharr','CALIBRATION_DOMAIN',**dict(a,calibration=dict(rt.CALIBRATION_EXAMPLE,fit_min_fraction=.8,fit_max_fraction=.5)));self.rejected(hst,'analysis.oliver_pharr','ELASTIC_UNLOADING_NOT_ACCEPTED',**dict(a,calibration=dict(rt.CALIBRATION_EXAMPLE,accept_elastic_unloading=False))) def test_08_op_peak_depth_is_paired_not_global_max(self): p,h=fixture();h[1]=h[0]*1.001;r=rt.oliver_pharr(p,h,rt.CALIBRATION_EXAMPLE);self.assertEqual(r['max_depth_m'],h[0]);self.assertNotEqual(r['max_depth_m'],max(h)) def test_09_area_domain_and_tip_poisson_correction_fail_explicitly(self): h=setup();p,d=fixture();a=dict(load_n=p,depth_m=d,calibration=dict(rt.CALIBRATION_EXAMPLE,area_min_depth_m=1e-6));self.rejected(h,'analysis.oliver_pharr','CONTACT_AREA_DOMAIN',**a);a['calibration']=dict(rt.CALIBRATION_EXAMPLE,young_tip_pa=1e9);self.rejected(h,'analysis.oliver_pharr','MODULUS_DOMAIN',**a) def test_10_live_analysis_uses_only_observed_unloading(self): h=setup();r=run(h);rr=[x for x in r['rows'] if x['phase']=='unloading'];external=call(h,'analysis.oliver_pharr',load_n=[x['force_n'] for x in rr],depth_m=[x['depth_m'] for x in rr],calibration=rt.CALIBRATION_EXAMPLE);self.assertEqual(external,r['points'][0]['analysis']);self.assertIn('h_corrected',external['evidence']) def test_11_no_fake_success_on_sparse_analysis(self): h=setup(method={'sample_interval_s':2.});r=run(h);self.assertEqual(r['phase'],'succeeded');self.assertIsNone(r['points'][0]['analysis']);self.assertIn(r['points'][0]['analysis_error'],['FIT_POINTS','FIT_DATA']);self.assertEqual(r['completed_indents'],1) def test_12_known_force_program_exact_and_actual_phase_times(self): h=setup(method={'hold_s':1.});r=run(h);phases={k:[x for x in r['rows'] if x['phase']==k] for k in ['loading','holding','unloading','release']};self.assertAlmostEqual(phases['holding'][0]['time_s']-phases['loading'][0]['time_s'],3.,places=9);self.assertAlmostEqual(phases['unloading'][0]['time_s']-phases['holding'][0]['time_s'],1.,places=9);self.assertAlmostEqual(phases['release'][0]['time_s']-phases['unloading'][0]['time_s'],3.,places=9);self.assertGreater(r['elapsed_s'],7.);self.assertAlmostEqual(r['rows'][-1]['elapsed_s'],r['elapsed_s']) def test_13_piecewise_plastic_work_matches_independent_source_integral(self): h=setup();r=run(h);pmax=h.method['peak_load_n'];p=h.model['load'];hp=h.model['plastic'];grid=np.r_[0.,p[(p>0)&(p<pmax)],pmax];plastic=np.interp(grid,p,hp);expected=float(np.sum(.5*(grid[1:]+grid[:-1])*np.diff(plastic)));l=self.ledger(h);self.assertAlmostEqual(l['plastic_work_j'],expected,delta=1e-19);self.assertAlmostEqual(h.plastic_depth,float(np.interp(pmax,p,hp)),places=17);m=h.model['exponent'];elastic=pmax*(pmax/h.model['coefficient'])**(1/m)/(m+1);self.assertAlmostEqual(l['elastic_recovered_j'],elastic,delta=1e-17);self.assertEqual(l['elastic_stored_j'],0.) def test_14_finite_mass_persistent_deformation_and_recovery(self): h=setup();mass=h._ledger()['sample_present_kg'];run(h);l=self.ledger(h);self.assertEqual(l['sample_present_kg'],mass);self.assertGreater(l['deformed_volume_m3'],0);self.assertGreater(l['pristine_volume_m3'],0);self.assertAlmostEqual(l['deformed_volume_m3'],h.specimen['deformation_shape_factor']*h.specimen['deformation_area_c2']*h.plastic_depth**3,delta=1e-32);cleanup(h);l=self.ledger(h);self.assertEqual(l['sample_present_kg'],0.);self.assertEqual(l['sample_recovered_kg'],mass);self.assertEqual(l['deformed_volume_m3'],0.) def test_15_reject_same_position_overlap_and_allow_new_manual_y(self): h=setup();run(h);self.rejected(h,'acquisition.start','POSITION_ALREADY_DAMAGED');park(h);call(h,'stage.set_y',position_m=.021,accept_manual=True);call(h,'head.set_position',distance_m=0.);step(h,9.);call(h,'contact.set',engaged=True);r=run(h);self.assertEqual(r['phase'],'succeeded');self.assertEqual(len(h.damage),2) h=setup(method={'x_positions_m':[.02,.02001]});self.rejected(h,'acquisition.start','ARRAY_OVERLAP') def test_16_atomic_hardware_limits_and_sampling_grid(self): h=setup() for field,v in [('peak_load_n',.500001),('peak_load_n',0.),('x_positions_m',[.04001]),('sample_interval_s',.15),('sample_interval_s',.16)]:self.rejected(h,'method.configure',**dict(h.method,**{field:v})) for dt in [True,-.1,float('nan'),float('inf')]:self.rejected(h,'sim.step',dt_s=dt) self.rejected(h,'stage.move_x',position_m=.05,speed_m_s=.01);self.rejected(h,'head.set_position',distance_m=.09001);self.rejected(h,'power.set',enabled=1);self.rejected(h,'method.configure',**dict(h.method,unexpected=1)) def test_17_source_load_range_unknown_conditions_and_explicit_transfer(self): h=setup(method={'peak_load_n':.01});self.rejected(h,'acquisition.start','REFERENCE_LOAD_DOMAIN');h=setup(sample={'accept_unknown_conditions':False});self.rejected(h,'acquisition.start','UNKNOWN_REFERENCE_CONDITIONS');h=setup(sample={'accept_condition_transfer':False},method={'hold_s':5.,'peak_load_n':.002});self.rejected(h,'acquisition.start','REFERENCE_CONDITIONS');h=rt.AntonpaarHit300Runtime();call(h,'plant.configure',**rt.PLANT_EXAMPLE);self.rejected(h,'specimen.load','MODEL_NOT_ACCEPTED',**dict(rt.SAMPLE_EXAMPLE,accept_elastic_release_extrapolation=False)) def test_18_dynamic_strain_rate_hold_and_noise_unsupported(self): h=setup() for key,v in [('mode','dynamic'),('control','strain_rate')]:self.rejected(h,'method.configure','UNSUPPORTED',**dict(h.method,**{key:v})) self.rejected(h,'method.configure','HOLD_MODEL_NOT_ACCEPTED',**dict(h.method,accept_no_creep_hold=False)) for k in rt.UNSUPPORTED:self.rejected(h,k,'UNSUPPORTED') def test_19_manual_y_requires_clearance_acceptance_and_no_automatic_y(self): h=setup();self.rejected(h,'stage.set_y','HEAD_NOT_CLEAR',position_m=.01,accept_manual=True);park(h);self.rejected(h,'stage.set_y','MANUAL_ACTION_NOT_ACCEPTED',position_m=.01,accept_manual=False);t=h.time_s;call(h,'stage.set_y',position_m=.01,accept_manual=True);self.assertEqual(h.time_s,t);self.assertEqual(h.stage_y,.01);call(h,'stage.move_x',position_m=.03,speed_m_s=.005);self.assertEqual(h.stage_x,.02);step(h,1.);self.assertAlmostEqual(h.stage_x,.025);self.assertEqual(h.stage_y,.01) def test_20_common_reference_ring_drift_cancels_not_differential(self): a=setup();b=setup(plant={'common_drift_m_s':5e-9});c=setup(plant={'differential_drift_m_s':5e-9});ra=run(a);rb=run(b);rc=run(c) for x,y in zip(ra['rows'],rb['rows']): if x['depth_m'] is not None:self.assertAlmostEqual(x['depth_m'],y['depth_m'],places=19) self.assertNotEqual(ra['rows'][-1]['tip_indicated_m'],rb['rows'][-1]['tip_indicated_m']);self.assertGreater(abs(rc['points'][0]['analysis']['hardness_pa']-ra['points'][0]['analysis']['hardness_pa']),1e8) def test_21_frame_compliance_and_sensor_gain_change_observations(self): a=setup();b=setup(plant={'frame_compliance_m_n':3e-7},calibration={'frame_compliance_m_n':3e-7});c=setup(plant={'force_gain':.9,'depth_gain':1.03});ra=run(a)['points'][0]['analysis'];rb=run(b)['points'][0]['analysis'];rc=run(c)['points'][0]['analysis'];self.assertLess(abs(rb['hardness_pa']/ra['hardness_pa']-1),.002);self.assertGreater(abs(rc['hardness_pa']/ra['hardness_pa']-1),.05);self.assertAlmostEqual(a.plastic_work,b.plastic_work,places=20);self.assertAlmostEqual(a.plastic_work,c.plastic_work,places=20) def test_22_external_sensor_zero_no_free_truth(self): h=setup(plant={'force_offset_n':1e-5,'depth_offset_m':2e-9});park(h);call(h,'sensor.zero');self.assertAlmostEqual(h.calibration['force_zero_n'],1e-5,places=14);self.assertAlmostEqual(h.calibration['depth_zero_m'],2e-9,places=16);self.assertEqual(h.read()['depth.indicated_m'],None);self.assertNotIn('sample_modulus_pa',h.__dict__) def test_23_nanowatt_heat_stable_energy_and_defect_partition(self): h=setup(plant={'heat_loss_w_k':0.,'plastic_heat_fraction':.7});run(h);l=self.ledger(h);self.assertGreater(l['thermal_stored_j'],1e-11);self.assertAlmostEqual(l['thermal_stored_j'],.7*l['plastic_work_j'],delta=1e-23);self.assertAlmostEqual(l['defect_stored_j'],.3*l['plastic_work_j'],delta=1e-23) h=setup(plant={'thermal_capacity_j_k':1e-6,'heat_loss_w_k':1000.});run(h);self.assertGreaterEqual(h.temperature,296.15);self.assertLess(h.temperature,296.15001);self.ledger(h) def test_24_passive_cooling_tracks_nanojoules_without_absolute_T_loss(self): h=setup();run(h);e=h.thermal_excess_j;step(h,10.);self.assertAlmostEqual(h.thermal_excess_j,e*math.exp(-.1),delta=1e-23);self.ledger(h) def test_25_finite_thickness_failure_and_no_material_deletion(self): h=setup(sample={'thickness_m':1e-8});r=run(h);self.assertEqual(r['error_code'],'SPECIMEN_THICKNESS');self.assertLess(r['elapsed_s'],3.);self.assertLessEqual(h._depth(),1e-8+1e-16);self.assertEqual(r['completed_indents'],0);self.assertEqual(r['rows'][-1]['elapsed_s'],r['elapsed_s']);self.ledger(h) def test_26_force_sensor_overrange_and_tiny_thermal_domain(self): h=setup(plant={'depth_gain':10.,'depth_offset_m':.000199});r=run(h);self.assertEqual(r['error_code'],'SENSOR_OVER_RANGE');self.assertIsNone(r['rows'][-1]['depth_m']);self.ledger(h) h=setup(plant={'thermal_capacity_j_k':1e-6,'heat_loss_w_k':0.,'temperature_max_k':296.150001});r=run(h);self.assertEqual(r['error_code'],'THERMAL_MODEL_RANGE');self.assertLessEqual(h.temperature,296.150001);self.ledger(h) def test_27_cancel_partial_array_keeps_damage_and_force(self): h=setup(method={'x_positions_m':[.02,.022]});call(h,'acquisition.start');step(h,7.);self.assertEqual(h.completed,1);step(h,2.);call(h,'acquisition.stop');r=call(h,'acquisition.result');self.assertEqual(r['completed_indents'],1);self.assertEqual(r['points'][-1]['phase'],'cancelled');force=h.force;depth=h.damage[-1]['plastic_depth_m'];self.assertGreater(force,0);self.rejected(h,'contact.set','LOAD_NOT_RELEASED',engaged=False);step(h,3.);self.assertEqual(h.force,0.);self.assertEqual(h.damage[-1]['plastic_depth_m'],depth);self.assertEqual(r,call(h,'acquisition.result'));self.ledger(h) def test_28_emergency_timeout_and_explicit_no_auto_resume(self): h=setup();call(h,'acquisition.start');step(h,.5);call(h,'emergency.stop');self.assertEqual(h.error,'SOFTWARE_STOP');self.rejected(h,'emergency.reset','LOAD_NOT_RELEASED');step(h,3.);call(h,'emergency.reset');self.assertEqual(h.phase,'failed');self.ledger(h) h=setup(method={'timeout_s':.2});r=run(h);self.assertEqual(r['error_code'],'TIMEOUT');self.assertAlmostEqual(r['elapsed_s'],.2) def test_29_array_reject_prevalidated_later_damage_and_overlap(self): h=setup();run(h);park(h);call(h,'stage.move_x',position_m=.022,speed_m_s=.005);step(h,1.);call(h,'head.set_position',distance_m=0.);step(h,9.);call(h,'contact.set',engaged=True);call(h,'method.configure',**dict(h.method,x_positions_m=[.022,.02]));self.rejected(h,'acquisition.start','POSITION_ALREADY_DAMAGED');self.assertEqual(len(h.damage),1) def test_30_frozen_result_survives_sample_calibration_and_method(self): h=setup();r=run(h);op=r['operation_id'];cleanup(h);call(h,'sensor.calibrate',**dict(rt.CALIBRATION_EXAMPLE,area_c2=30.));call(h,'method.configure',**dict(h.method,peak_load_n=.001));call(h,'specimen.load',**dict(rt.SAMPLE_EXAMPLE,reference_id='soda_lime_glass_5mn_rep1'));self.assertEqual(r,call(h,'acquisition.result'));self.assertEqual(r,h.records[op]);self.assertEqual(r['reference_id'],'borofloat33_5mn_rep1') def test_31_pure_queries_and_owner_not_stolen(self): h=setup();s=h.session();op=s.invoke(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='start')['operation_id'];step(h,.3);before=state(h);h.read();h.describe();s.read(instance_id=h.instance_id);s.poll(op);call(h,'reference.query',reference_id=rt.SAMPLE_EXAMPLE['reference_id']);call(h,'ledger.read');self.assertEqual(state(h),before);q=s.invoke(instance_id=h.instance_id,capability_id='acquisition.result',arguments={},request_id='result');self.assertIsNone(q['operation_id']);self.assertEqual(h._owners[op],'agent');json.dumps(q,allow_nan=False) def test_32_session_identity_owner_and_request_idempotence(self): h=setup();h.register_principal('other');a=h.session();b=h.session('other');args=dict(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='start');r=a.invoke(**args);self.assertEqual(r,a.invoke(**args));op=r['operation_id'] for k in ['acquisition.result','acquisition.stop']:self.assertEqual(b.invoke(instance_id=h.instance_id,capability_id=k,arguments={},request_id=k)['error']['code'],'ACCESS_DENIED') for fn in [lambda:b.poll(op),lambda:b.cancel(op,'cancel')]: with self.assertRaises(rt.ActionRejected):fn() self.assertEqual(a.invoke(**dict(args,capability_id='power.set',arguments={'enabled':False}))['error']['code'],'REQUEST_CONFLICT');c=a.cancel(op,'cancel');self.assertEqual(c,a.cancel(op,'cancel')) def test_33_stale_cancel_retry_keeps_new_operation_running(self): h=setup();s=h.session();a=dict(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='one');op=s.invoke(**a)['operation_id'];c=s.cancel(op,'cancel');step(h,.1);op2=s.invoke(**dict(a,request_id='two'))['operation_id'];self.assertEqual(c,s.cancel(op,'cancel'));self.assertEqual(h.phase,'running');self.assertEqual(h.operation_id,op2) with self.assertRaisesRegex(rt.ActionRejected,'REQUEST_CONFLICT'):s.cancel(op2,'cancel') def test_34_agent_truth_recovery_and_writes_denied(self): h=setup();s=h.session();meta=s.describe(instance_id=h.instance_id);self.assertTrue(all(not k.startswith('truth.') for k in meta['state_slots']));self.assertNotIn('specimen.remove',meta['capabilities']);self.assertNotIn('ledger.read',meta['capabilities']);self.assertTrue(all(not k.startswith('truth.') for k in s.read(instance_id=h.instance_id)['observations'])) for k in ['specimen.remove','ledger.read','plant.configure','sim.step']: before=state(h);r=s.invoke(instance_id=h.instance_id,capability_id=k,arguments=rt.CAPS[k]['example_arguments'],request_id=k);self.assertEqual(r['error']['code'],'ACCESS_DENIED');self.assertEqual(before,state(h)) with self.assertRaises(rt.ActionRejected):s.read(instance_id=h.instance_id,state_ids=['truth.plastic_depth_m']) with self.assertRaises(rt.ActionRejected):s.write(instance_id=h.instance_id,state_id='force.target_n',value=.4,request_id='x') def test_35_two_instances_fractional_and_large_host_steps(self): a=setup('a');b=setup('b');call(a,'acquisition.start');call(b,'acquisition.start');step(a,1.3) for dt in [.03,.07,.25,.15,.4,.4]:step(b,dt) self.assertEqual(a.read(),b.read());self.assertEqual(a.rows,b.rows);before=state(b);step(a,.1);self.assertEqual(before,state(b));call(a,'sim.step',dt_s=0.) a=setup('a',plant={'force_response_tau_s':1e-5,'sensor_tau_s':1e-5});b=setup('b',plant={'force_response_tau_s':1e-5,'sensor_tau_s':1e-5});call(a,'acquisition.start');call(b,'acquisition.start');step(a,8.) for _ in range(80):step(b,.1) self.assertEqual(a.read(),b.read());self.assertEqual(a.rows,b.rows);self.assertEqual(a.phase,'succeeded') def test_36_reference_only_and_projection_acceptance(self): h=setup();park(h);call(h,'clamp.set',locked=False);call(h,'specimen.remove');records=rt.library()['substances'];rid=next(k for k,r in records.items() if not r.get('runtime_usable'));self.rejected(h,'specimen.load','INVALID_REFERENCE',**dict(rt.SAMPLE_EXAMPLE,reference_id=rid));self.rejected(h,'reference.query','INVALID_REFERENCE',reference_id='missing');r=copy.deepcopy(records[rt.SAMPLE_EXAMPLE['reference_id']]);r['values']['depth_m'][5]=-1e-9 with self.assertRaisesRegex(rt.ActionRejected,'PROJECTION_NOT_ACCEPTED'):rt.source_model(r,False) self.assertGreater(rt.source_model(r,True)['projection']['plastic_projection_nodes'],0) def test_37_no_agent_hidden_elastic_or_deformation_result_fields(self): h=setup();s=h.session();op=s.invoke(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='s')['operation_id'];step(h,8.);r=s.poll(op);json.dumps(r,allow_nan=False) def visit(v): if isinstance(v,dict): for k,x in v.items():self.assertFalse(k.startswith('truth.') or k in ['plastic_depth_m','elastic_depth_m','deformed_volume_m3','sample_present_kg']);visit(x) elif isinstance(v,list): for x in v:visit(x) visit(r);visit(s.read(instance_id=h.instance_id)) def test_38_laser_power_interlock_and_protocol_errors(self): h=setup();call(h,'laser.set',enabled=True);park(h);call(h,'power.set',enabled=False);self.assertFalse(h.laser);self.rejected(h,'laser.set','NOT_READY',enabled=True);s=h.session();self.assertEqual(s.describe(asset_type_id=rt.ASSET_TYPE_ID)['asset_type_id'],rt.ASSET_TYPE_ID) for fn in [lambda:s.describe(),lambda:h.session('unknown'),lambda:h.register_principal('agent'),lambda:s.read(instance_id='unknown')]: with self.assertRaises(rt.ActionRejected):fn() for cap,args in [('unknown',{}),('power.set',{'enabled':3}),('dynamic.acquire',{})]:json.dumps(s.invoke(instance_id=h.instance_id,capability_id=cap,arguments=args,request_id=cap),allow_nan=False) def test_39_analysis_incomplete_cancel_and_history_owner(self): h=setup();s=h.session();op=s.invoke(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='s')['operation_id'];step(h,1.);s.cancel(op,'cancel');result=s.poll(op);self.assertEqual(result['result']['completed_indents'],0);self.assertIsNone(result['result']['points'][0]['analysis']);self.assertEqual(result['result']['points'][0]['analysis_error'],'INCOMPLETE_UNLOADING');cleanup(h);self.assertEqual(s.poll(op),result);self.ledger(h) def test_40_zero_thermal_margin_rejects_sub_ulp_heat(self): h=setup(plant={'temperature_max_k':296.15});r=run(h);self.assertEqual(r['error_code'],'THERMAL_MODEL_RANGE');self.assertEqual(h.thermal_excess_j,0.);self.assertEqual(h.plastic_work,0.);self.assertEqual(r['completed_indents'],0);self.ledger(h) def test_zz_real_inputs_outputs_states_metadata_and_effects(self): spec=importlib.util.spec_from_file_location('hit_asset_tool',ROOT/'skills/chemistry-lab-assets/scripts/asset_tool.py');tool=importlib.util.module_from_spec(spec);spec.loader.exec_module(tool);meta=rt.export_antonpaar_hit300_contract_metadata();json.dumps(meta,allow_nan=False) for k,c in meta['capabilities'].items():self.assertEqual(tool.lint_schema(c['input_schema'],path=k+'.input'),[]);self.assertEqual(tool.lint_schema(c['output_schema'],path=k+'.output'),[]) covered=set() for k,a,r in OBSERVED: self.assertEqual(tool.validate_value(a,meta['capabilities'][k]['input_schema'],path=k+'.input'),[]);self.assertEqual(tool.validate_value(r,meta['capabilities'][k]['output_schema'],path=k+'.output'),[]);covered.add(k) self.assertEqual(covered,set(rt.CAPS)-set(rt.UNSUPPORTED)) for values in STATES: self.assertEqual(set(values),set(rt.SLOTS));json.dumps(values,allow_nan=False) for k,v in values.items():self.assertEqual(tool.validate_value(v,meta['state_slots'][k]['value_schema'],path=k),[]) for k,c in meta['capabilities'].items():self.assertTrue(set(rt.CAPS[k]['effects'])<={e['state_id'] for e in c['state_effects']})if __name__=='__main__':unittest.main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161"""CHEM137 tests: real templates, independent mechanics, ledgers and public protocol."""import copy,importlib.util,json,math,unittestfrom pathlib import Pathimport numpy as npfrom scipy.integrate import quadfrom scripts.asset_runtime import antonpaar_mcr503 as rROOT=Path(__file__).resolve().parents[1];spec=importlib.util.spec_from_file_location('mcr_asset_tool',ROOT/'skills/chemistry-lab-assets/scripts/asset_tool.py');asset_tool=importlib.util.module_from_spec(spec);spec.loader.exec_module(asset_tool)OBSERVED=[]class Checked(r.AntonpaarMcr503Runtime): def invoke(self,k,**a): before=self.read();out=super().invoke(k,**a);after=self.read();changed={x for x in after if after[x]!=before[x]} assert not changed-set(r.CAPS[k]['effects']),(k,changed-set(r.CAPS[k]['effects'])) assert not asset_tool.validate_value(out,r.CAPS[k]['output_schema']),(k,asset_tool.validate_value(out,r.CAPS[k]['output_schema'])) OBSERVED.append((k,copy.deepcopy(a),copy.deepcopy(out)));return out
def make(plant=None,sample=None,method=None,geometry=None): h=Checked();h.invoke('plant.configure',**dict(r.PLANT_EXAMPLE,**(plant or {})));h.invoke('geometry.configure',**dict(r.GEOMETRY_EXAMPLE,**(geometry or {})));h.invoke('sample.load',**dict(r.SAMPLE_EXAMPLE,**(sample or {})));h.invoke('power.set',enabled=True);h.invoke('geometry.set_gap',gap_m=.001);h.step(4.);h.invoke('thermal.set_temperature',temperature_k=298.15);h.invoke('method.configure',**dict(r.METHOD_EXAMPLE,**(method or {})));return h
def finish(h):h.invoke('acquisition.start');h.step(h.method['duration_s']);return h.invoke('acquisition.result')def remove(h): if h.phase=='running':h.invoke('acquisition.stop') h.invoke('geometry.set_gap',gap_m=.08);h.step(4.);h.invoke('sample.remove')def sessions(h): for name,role in [('student','agent'),('teacher','evaluator'),('other','agent')]:h.register_principal(name,role) return h.session('student'),h.session('teacher'),h.session('other')def call(s,c,a=None,rid='r1'):return s.invoke(instance_id=s._host.instance_id,capability_id=c,arguments=a or {},request_id=rid)
class McrTests(unittest.TestCase): def budget(self,h): d=h.invoke('ledger.read') for key,value in d.items(): if 'error' in key:self.assertLess(abs(value),1e-8,(key,value)) def test_01_targets_do_not_teleport(self): h=make();temp=h.temperature;h.invoke('thermal.set_temperature',temperature_k=310.);self.assertEqual(h.temperature,temp);h.invoke('geometry.set_gap',gap_m=.08);self.assertEqual(h.gap,.001);h.step(.1);self.assertAlmostEqual(h.gap,.003);self.assertGreater(h.temperature,temp) def test_02_read_describe_and_zero_are_pure(self): h=make();a,e,_=sessions(h);before=copy.deepcopy(h.__dict__) for _ in range(2):a.read(instance_id=h.instance_id);a.describe(instance_id=h.instance_id);e.describe(asset_type_id=r.ASSET_TYPE_ID);h.step(0.) self.assertEqual(h.__dict__,before) def test_03_real_water_viscosity(self): h=make();o=finish(h);self.assertEqual(o['phase'],'succeeded');self.assertEqual(len(o['rows']),201);self.assertLess(abs(o['mean_apparent_viscosity_pa_s']/r.library()['water']['viscosity_Pa_s']-1),.0002);self.assertIsNone(o['oscillation_fit']);self.assertEqual(h.angle,16.);self.budget(h) def test_04_sixtynine_real_references(self): lib=r.library();self.assertGreaterEqual(len(lib),50) for row in lib.values():self.assertGreater(row['viscosity_Pa_s'],0);self.assertTrue(row['source']);self.assertTrue(row['evidence']);self.assertIsNone(row['storage_modulus_Pa']) a=make();b=make(sample={'reference_id':'glycerol'});oa=finish(a);ob=finish(b);self.assertGreater(ob['mean_apparent_viscosity_pa_s']/oa['mean_apparent_viscosity_pa_s'],1000) def test_05_newtonian_torque_radial_integral(self): eta=.954;rate=100.;R=.0125 exact=quad(lambda radius:2*math.pi*eta*rate*radius/R*radius**2,0,R,epsabs=1e-15)[0] self.assertAlmostEqual(exact,r.pp_torque(rate,R,eta),14) def test_06_hb_radial_integral(self): radius=.0125;rate=100.;K=.4;n=.7;yield_stress=2. numerical=quad(lambda x:2*math.pi*(yield_stress+K*(rate*x/radius)**n)*x*x,0,radius,epsabs=1e-14)[0] self.assertAlmostEqual(numerical,float(r.hb_torque(rate,radius,yield_stress,K,n)),13) def test_07_external_hb_inverse(self): h=Checked();out=h.invoke('analysis.flow_curve',**r.FLOW_EXAMPLE);self.assertAlmostEqual(out['yield_stress_pa'],.2,7);self.assertAlmostEqual(out['consistency_pa_sn'],.3,7);self.assertAlmostEqual(out['flow_index'],.7,7);self.assertIsNone(h.sample) def test_08_hb_forward_apparent_viscosity(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'herschel_bulkley','yield_stress_pa':.2,'flow_index':.7});o=finish(h);expected=float(r.hb_torque(100,.0125,.2,.954,.7))*2/(math.pi*.0125**3*100) self.assertAlmostEqual(o['mean_apparent_viscosity_pa_s'],expected,6);self.assertNotAlmostEqual(expected,.954,2);self.budget(h) def test_09_external_oscillation_inverse(self): h=Checked();out=h.invoke('analysis.oscillation',**r.OSC_EXAMPLE);self.assertAlmostEqual(out['storage_modulus_pa'],2.,12);self.assertAlmostEqual(out['loss_modulus_pa'],3.,12);self.assertIsNone(h.sample) def test_10_newtonian_oscillation(self): h=make(sample={'reference_id':'glycerol'},method={'mode':'oscillation'});o=finish(h);self.assertEqual(o['phase'],'succeeded');self.assertLess(abs(o['oscillation_fit']['storage_modulus_pa']),1e-5);self.assertAlmostEqual(o['oscillation_fit']['loss_modulus_pa'],.954*2*math.pi*5,5);self.budget(h) def test_11_maxwell_gprime_gdoubleprime(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'},method={'mode':'oscillation'});o=finish(h);u=2*math.pi*5*.05;G=.954/.05 self.assertAlmostEqual(o['oscillation_fit']['storage_modulus_pa'],G*u*u/(1+u*u),4);self.assertAlmostEqual(o['oscillation_fit']['loss_modulus_pa'],G*u/(1+u*u),4);self.budget(h) def test_12_maxwell_startup_time_response(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'});h.invoke('acquisition.start');self.assertEqual(h.stress,0);h.step(.05);self.assertAlmostEqual(h.stress,.954*100*(1-math.exp(-1)),12);self.assertAlmostEqual(h.angle,.4,12);self.budget(h) def test_13_maxwell_work_independent_quadrature(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'},method={'mode':'oscillation'});h.invoke('acquisition.start');duration=.173 numerical=quad(lambda t:h._mechanical(t)['torque']*h._mechanical(t)['speed'],0,duration,epsabs=1e-16)[0];h.step(duration);self.assertAlmostEqual(h.mechanical_work,numerical,15);self.assertGreaterEqual(h.viscous_heat,0);self.budget(h) def test_14_cancel_preserves_and_relaxes_energy(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'});h.invoke('acquisition.start');h.step(.05);h.invoke('acquisition.stop');elastic=h.elastic;stress=h.stress;heat=h.viscous_heat;work=h.mechanical_work;rows=copy.deepcopy(h.rows);angle=h.angle;h.step(.05) self.assertAlmostEqual(h.stress,stress/math.e,12);self.assertAlmostEqual(h.elastic,elastic/math.e**2,15);self.assertAlmostEqual(h.viscous_heat-heat,elastic-h.elastic,15);self.assertEqual(h.mechanical_work,work);self.assertEqual(h.angle,angle);self.assertEqual(h.rows,rows);self.budget(h) def test_15_thermal_control_heat_balance(self): h=make();h.invoke('thermal.set_temperature',temperature_k=308.15);h.step(120);self.assertAlmostEqual(h.temperature,308.15,3);self.assertGreater(h.controller_input,1000);self.budget(h) h.invoke('thermal.set_temperature',temperature_k=288.15);h.step(180);self.assertAlmostEqual(h.temperature,288.15,3);self.budget(h);h.invoke('thermal.disable');T=h.temperature;h.step(5);self.assertGreater(h.temperature,T);self.budget(h) def test_16_thermal_saturation_partition(self): a=make(plant={'heater_max_w':2.,'cooler_max_w':1.});b=make(plant={'heater_max_w':2.,'cooler_max_w':1.}) for h in (a,b):h.invoke('thermal.set_temperature',temperature_k=300.15) a.step(600) for _ in range(120):b.step(5) self.assertAlmostEqual(a.temperature,b.temperature,10);self.assertAlmostEqual(a.controller_input,b.controller_input,8);self.budget(a);self.budget(b) def test_17_material_volume_and_remove_energy(self): h=make();mass=h._mass();volume=h.sample['volume_m3'];h.invoke('thermal.set_temperature',temperature_k=303.15);h.step(100);h.invoke('geometry.set_gap',gap_m=.08);h.step(4) self.assertEqual(h._mass(),mass);self.assertEqual(h.sample['volume_m3'],volume);h.invoke('sample.remove');d=h.invoke('ledger.read');self.assertEqual(d['mass_removed_kg'],mass);self.assertEqual(d['volume_removed_m3'],volume);self.assertGreater(d['sample_removed_heat_j'],0);self.assertEqual(d['mass_present_kg'],0);self.budget(h) def test_18_squeeze_and_fill_guards_atomic(self): h=make();before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'SQUEEZE_FLOW_UNSUPPORTED',h.invoke,'geometry.set_gap',gap_m=.0005);self.assertEqual(h.__dict__,before) h.invoke('geometry.set_gap',gap_m=.002);h.step(1);before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'GAP_FILL_MISMATCH',h.invoke,'acquisition.start');self.assertEqual(h.__dict__,before) def test_19_below_torque_range_null(self): h=make(method={'shear_rate_s_inv':1e-6});o=finish(h);self.assertEqual(o['phase'],'failed');self.assertEqual(o['error_code'],'TORQUE_BELOW_RANGE');self.assertIsNone(o['mean_apparent_viscosity_pa_s']);self.assertTrue(all(row['torque_nm'] is None for row in o['rows'])) def test_20_overload_and_angular_speed(self): h=make(sample={'reference_id':'glycerol','volume_m3':math.pi*.05**2*.001},geometry={'radius_m':.05},method={'shear_rate_s_inv':3000});before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'TORQUE_OVERLOAD',h.invoke,'acquisition.start');self.assertEqual(h.__dict__,before) h=make(method={'shear_rate_s_inv':4000});before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'ANGULAR_SPEED_RANGE',h.invoke,'acquisition.start');self.assertEqual(h.__dict__,before) def test_21_250hz_internal_grid(self): h=make(sample={'reference_id':'glycerol'},method={'mode':'oscillation','frequency_hz':250.,'duration_s':.04,'sample_interval_s':.0002,'discard_time_s':.02});o=finish(h);self.assertEqual(o['phase'],'succeeded');self.assertEqual(len(o['rows']),201);self.assertAlmostEqual(o['oscillation_fit']['loss_modulus_pa'],.954*2*math.pi*250,3) def test_22_sampling_and_frequency_rejection(self): h=make();before=copy.deepcopy(h.__dict__) for patch in [{'frequency_hz':251.},{'mode':'oscillation','frequency_hz':250.},{'sample_interval_s':.03},{'discard_time_s':2.}]:self.assertRaises(r.ActionRejected,h.invoke,'method.configure',**dict(r.METHOD_EXAMPLE,**patch));self.assertEqual(h.__dict__,before) def test_23_no_temperature_extrapolation(self): h=make(sample={'reference_id':'benzoic_acid'});before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'REFERENCE_TEMPERATURE_RANGE',h.invoke,'acquisition.start');self.assertEqual(h.__dict__,before) def test_24_reference_drift_stops_at_sample(self): h=make(plant={'ambient_k':303.15},method={'duration_s':10.,'sample_interval_s':.05});h.step(150);self.assertLess(abs(h.temperature-298.15),.001);h.invoke('thermal.disable');h.invoke('acquisition.start');h.step(10.) self.assertEqual(h.phase,'failed');self.assertEqual(h.error,'REFERENCE_TEMPERATURE_RANGE');self.assertLess(h.elapsed,10.);self.assertLess(len(h.rows),201);self.assertEqual(h.speed,0);self.budget(h) def test_25_independent_calibration(self): h=make(plant={'torque_gain':2.,'torque_offset_nm':1e-7});h.invoke('sensor.calibrate',torque_gain_correction=.5,torque_zero_nm=1e-7);o=finish(h);self.assertLess(abs(o['mean_apparent_viscosity_pa_s']/.0008949-1),.0002) def test_26_invalid_inputs_atomic(self): h=make();before=copy.deepcopy(h.__dict__) for patch in [{'strain_amplitude':True},{'shear_rate_s_inv':float('nan')},{'bad':1}]:self.assertRaises(r.ActionRejected,h.invoke,'method.configure',**dict(r.METHOD_EXAMPLE,**patch));self.assertEqual(h.__dict__,before) for dt in [-1,float('inf'),float('nan'),True]:self.assertRaises(r.ActionRejected,h.step,dt);self.assertEqual(h.__dict__,before) def test_27_busy_preconditions_atomic(self): h=make();h.invoke('acquisition.start');h.step(.1);before=copy.deepcopy(h.__dict__) for cap,args in [('sample.remove',{}),('geometry.set_gap',{'gap_m':.08}),('thermal.set_temperature',{'temperature_k':300.}),('method.configure',r.METHOD_EXAMPLE)]:self.assertRaisesRegex(r.ActionRejected,'BUSY',h.invoke,cap,**args);self.assertEqual(h.__dict__,before) def test_28_double_instance_isolation(self): a=make();b=make();before=copy.deepcopy(b.__dict__);finish(a);self.assertEqual(b.__dict__,before) def test_29_float_clock_partition_rows(self): a=make();b=make();a.invoke('acquisition.start');b.invoke('acquisition.start');a.step(2.) for _ in range(120):b.step(1/60) self.assertEqual(a.time_ns,b.time_ns);self.assertEqual(a.rows,b.rows);self.assertEqual(a.angle,b.angle);self.assertAlmostEqual(a.mechanical_work,b.mechanical_work,14);self.budget(b) c=Checked() for _ in range(3600):c.step(1/60) self.assertEqual(c.time_ns,60000000000) def test_30_identity_permissions(self): h=make();a,e,o=sessions(h);self.assertNotIn('sample.load',a.describe(instance_id=h.instance_id)['capabilities']);self.assertNotIn('truth.viscosity_pa_s',a.read(instance_id=h.instance_id)['observations']);self.assertIn('truth.viscosity_pa_s',e.read(instance_id=h.instance_id)['observations']);self.assertRaises(r.ActionRejected,a.read,instance_id=h.instance_id,state_ids=['truth.viscosity_pa_s']);self.assertEqual(call(a,'sim.step',{'dt_s':1.})['error']['code'],'ACCESS_DENIED');self.assertRaises(TypeError,a.read,instance_id=h.instance_id,role='evaluator') def test_31_idempotency_owner_cancel(self): h=make();a,e,o=sessions(h);start=call(a,'acquisition.start');revision=h.revision;self.assertEqual(call(a,'acquisition.start'),start);self.assertEqual(h.revision,revision);self.assertEqual(call(a,'power.set',{'enabled':False})['error']['code'],'REQUEST_CONFLICT');op=start['operation_id'];h.step(.5);self.assertRaises(r.ActionRejected,o.poll,op);self.assertEqual(call(o,'acquisition.result')['error']['code'],'ACCESS_DENIED');cancel=a.cancel(op,'cancel');self.assertEqual(a.cancel(op,'cancel'),cancel);self.assertEqual(a.poll(op)['status'],'cancelled') def test_32_privileged_public_provenance_is_safe(self): h=make();a,e,_=sessions(h);op=call(e,'acquisition.start')['operation_id'];h.step(2.) for data in [call(e,'acquisition.result',rid='result'),e.poll(op)]:text=json.dumps(data);self.assertNotIn('Viscosity',text);self.assertNotIn('PubChem',text);self.assertNotIn('locator',text);self.assertIn('rheology_library.json',text) raw=call(e,'provenance.read',rid='provenance');self.assertEqual(raw['result']['reference_id'],'water');self.assertTrue(raw['result']['template_source']);self.assertEqual(call(a,'provenance.read')['error']['code'],'ACCESS_DENIED') def test_33_poweroff_and_archive_residue(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'});a,e,_=sessions(h);op=call(a,'acquisition.start')['operation_id'];h.step(.1);h.invoke('power.set',enabled=False);self.assertEqual(h.phase,'cancelled');self.assertGreater(h.elastic,0);old=a.poll(op);h.step(1.);self.assertEqual(a.poll(op),old);self.assertFalse(h.thermal_enabled);self.budget(h) def test_34_restart_residual_maxwell(self): h=make(sample={'reference_id':'glycerol','constitutive_model':'maxwell'});h.invoke('acquisition.start');h.step(.02);h.invoke('acquisition.stop');initial=h.stress;h.invoke('acquisition.start');h.step(.01);expected=.954*100+(initial-.954*100)*math.exp(-.01/.05);self.assertAlmostEqual(h.stress,expected,11);self.budget(h) def test_35_model_acceptance_and_unsupported(self): h=Checked();h.invoke('plant.configure',**r.PLANT_EXAMPLE);h.invoke('geometry.configure',**r.GEOMETRY_EXAMPLE);before=copy.deepcopy(h.__dict__);self.assertRaisesRegex(r.ActionRejected,'ASSUMPTION_NOT_ACCEPTED',h.invoke,'sample.load',**dict(r.SAMPLE_EXAMPLE,accept_engineering_rheology=False));self.assertEqual(h.__dict__,before) h=make();a,_,_=sessions(h) for index,key in enumerate(r.UNSUPPORTED):self.assertEqual(call(a,key,rid='u'+str(index))['status'],'unsupported') h=make(sample={'constitutive_model':'herschel_bulkley'},method={'mode':'oscillation'});self.assertRaisesRegex(r.ActionRejected,'HB_OSCILLATION_UNSUPPORTED',h.invoke,'acquisition.start') def test_36_all_metadata_and_real_output_schemas(self): meta=r.export_antonpaar_mcr503_contract_metadata();self.assertEqual(set(meta['state_slots']),set(r.SLOTS)) for key,cap in meta['capabilities'].items():self.assertEqual(asset_tool.lint_schema(cap['input_schema']),[],key);self.assertEqual(asset_tool.lint_schema(cap['output_schema']),[],key);self.assertEqual(asset_tool.validate_value(cap['example_arguments'],cap['input_schema']),[],key) self.assertNotIn('含一阶响应',meta['state_slots']['thermal.indicated_k']['meaning_zh']);self.assertNotIn('含一阶响应',meta['state_slots']['torque.indicated_nm']['meaning_zh']);self.assertNotIn('样品瓶',meta['state_slots']['truth.temperature_k']['meaning_zh']);self.assertIn('thermal.set_temperature',meta['state_slots']['thermal.target_k']['meaning_zh']) h=make();h.invoke('sim.step',dt_s=.01);h.invoke('provenance.read') for key,args,result in OBSERVED:self.assertEqual(asset_tool.validate_value(result,meta['capabilities'][key]['output_schema']),[],key) for key,value in h.read().items():self.assertEqual(asset_tool.validate_value(value,meta['state_slots'][key]['value_schema']),[],key)
def test_37_real_host_session_all_implemented_entries(self): h=Checked();h.register_principal('host','evaluator');session=h.session('host') actions=[('plant.configure',r.PLANT_EXAMPLE),('geometry.configure',r.GEOMETRY_EXAMPLE),('sample.load',r.SAMPLE_EXAMPLE),('power.set',{'enabled':True}),('geometry.set_gap',{'gap_m':.001}),('sim.step',{'dt_s':4.}),('thermal.set_temperature',{'temperature_k':298.15}),('method.configure',r.METHOD_EXAMPLE),('sensor.calibrate',r.CALIBRATION_EXAMPLE),('acquisition.start',{}),('sim.step',{'dt_s':.5}),('acquisition.result',{}),('provenance.read',{}),('acquisition.stop',{}),('ledger.read',{}),('analysis.flow_curve',r.FLOW_EXAMPLE),('analysis.oscillation',r.OSC_EXAMPLE),('thermal.disable',{}),('geometry.set_gap',{'gap_m':.08}),('sim.step',{'dt_s':4.}),('sample.remove',{}),('power.set',{'enabled':False})] for index,(cap,args) in enumerate(actions): response=call(session,cap,args,str(index));self.assertIn(response['status'],['succeeded','accepted'],(cap,response));self.assertEqual(asset_tool.validate_value(response['result'],r.CAPS[cap]['output_schema']),[],cap) self.assertEqual(set(k for k,_ in actions),set(r.CAPS)-set(r.UNSUPPORTED));self.budget(h)
def test_38_multiturn_pose_representation(self): h=make();finish(h);first=h.read();self.assertAlmostEqual(first['rotor.angle_rad'],16.,12) self.assertAlmostEqual(first['rotor.orientation_rad'],math.atan2(math.sin(16.),math.cos(16.)),12);self.assertGreater(first['rotor.angle_rad'],4*math.pi) finish(h);second=h.read();self.assertAlmostEqual(second['rotor.angle_rad'],32.,12) self.assertAlmostEqual(math.sin(second['rotor.orientation_rad']),math.sin(second['rotor.angle_rad']),12);self.assertAlmostEqual(math.cos(second['rotor.orientation_rad']),math.cos(second['rotor.angle_rad']),12) self.assertGreaterEqual(second['rotor.orientation_rad'],-math.pi);self.assertLessEqual(second['rotor.orientation_rad'],math.pi) self.assertEqual(second['rotor.speed_rad_s'],0.);self.budget(h)
if __name__=='__main__':unittest.main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209"""CHEM129 finite scratch, observed pre/post profiles and protocol regressions."""import copy,hashlib,importlib.util,json,math,sys,unittestfrom pathlib import Pathimport numpy as npROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'))from asset_runtime import antonpaar_rst300 as rtOBSERVED=[];STATES=[]def canonical(v): if isinstance(v,dict):return {str(k):canonical(x) for k,x in v.items()} if isinstance(v,(list,tuple)):return [canonical(x) for x in v] if isinstance(v,np.ndarray):return v.tolist() return vdef state(h):return json.dumps(canonical(h.__dict__),sort_keys=True,allow_nan=False)def call(h,k,**a): before=h.read();r=h.invoke(k,**a);after=h.read();json.dumps(r,allow_nan=False);json.dumps(after,allow_nan=False);OBSERVED.append((k,copy.deepcopy(a),copy.deepcopy(r)));STATES.append(after) changed={x for x in before if before[x]!=after[x]} if not changed<=set(rt.CAPS[k]['effects']):raise AssertionError((k,'undeclared state effects',changed-set(rt.CAPS[k]['effects']))) return rdef step(h,t):h.step(t);STATES.append(h.read());json.dumps(h.read(),allow_nan=False)def setup(name='rst_test',plant=None,sample=None,stylus=None,method=None): h=rt.AntonpaarRst300Runtime(name) for k,a in [('plant.configure',dict(rt.PLANT_EXAMPLE,**(plant or {}))),('specimen.load',dict(rt.SAMPLE_EXAMPLE,**(sample or {}))),('stylus.load',dict(rt.STYLUS_EXAMPLE,**(stylus or {})))]:call(h,k,**a) call(h,'power.set',enabled=True);call(h,'clamp.set',locked=True);call(h,'sensor.zero');call(h,'head.set_position',distance_m=0.);step(h,4.);call(h,'contact.set',engaged=True);call(h,'method.configure',**dict(dict(rt.METHOD_EXAMPLE,length_m=.0002),**(method or {})));return hdef run(h,kind=None): if kind is not None:call(h,'method.configure',**dict(h.method,pass_kind=kind)) call(h,'acquisition.start') for _ in range(4000): step(h,.1) if h.phase!='running':break if h.phase=='running':raise AssertionError('operation never terminated') return call(h,'acquisition.result')def park(h,x=0.,y=0.): if h.phase=='running':call(h,'acquisition.stop') step(h,2.);call(h,'contact.set',engaged=False);call(h,'head.set_position',distance_m=.04);step(h,4.);call(h,'stage.move',x_m=x,y_m=y,speed_m_s=.01);step(h,10.)def at_start(h): park(h,h.method['start_x_m'],h.method['path_y_m']);call(h,'head.set_position',distance_m=0.);step(h,4.);call(h,'contact.set',engaged=True)def prescanned(**kwargs): h=setup(**kwargs);r=run(h,'prescan') if r['phase']!='succeeded':raise AssertionError(r['error_code']) at_start(h);call(h,'method.configure',**dict(h.method,pass_kind='scratch'));return hdef cleanup(h): park(h);call(h,'clamp.set',locked=False) for name in ['specimen','stylus']: if getattr(h,name) is not None:call(h,name+'.remove') call(h,'debris.collect');call(h,'power.set',enabled=False)def rows(values,channel='friction_force_n',loads=None): result=[] for i,v in enumerate(values): r=copy.deepcopy(rt._example_row);r.update(distance_m=i*.001,stage_x_m=i*.001,normal_force_n=(loads[i] if loads else 10.+i));r[channel]=v;result.append(r) return resultclass TestRST300(unittest.TestCase): def rejected(self,h,k,error='.',**a): before=state(h) with self.assertRaisesRegex(rt.ActionRejected,error):h.invoke(k,**a) self.assertEqual(before,state(h)) def ledger(self,h): l=call(h,'ledger.read') for n in ['coating','substrate','stylus']:self.assertLess(abs(l[n+'_error_kg']),1e-13) self.assertLess(abs(l['thermal_error_j']),1e-8);self.assertLess(abs(l['normal_error_j']),1e-12);self.assertAlmostEqual(l['heat_input_j']+l['wear_work_j'],l['tangential_work_j'],places=12);return l def test_01_raw_reference_command_load_negative_force_and_null_residual(self): lib=rt.library();r=lib['substances']['borofloat33_10n_r1'];before=json.dumps(r,sort_keys=True);x,mu,count=rt.curve(r,True) self.assertEqual(len(x),1763);self.assertGreater(count,0);self.assertLess(r['values']['tangential_force_n'][0],0);self.assertIsNone(r['values']['residual_depth_m']);self.assertTrue(all(v==0 for v in r['values']['raw_residual_depth_m']));self.assertAlmostEqual(r['values']['normal_force_n'][0],9.99999938964844);self.assertGreater(x[0],0);self.assertTrue(np.all(mu>=0));self.assertEqual(before,json.dumps(r,sort_keys=True));self.assertGreaterEqual(sum(bool(v.get('runtime_usable')) for v in lib['substances'].values()),16) with self.assertRaisesRegex(rt.ActionRejected,'NEGATIVE_SOURCE_FORCE'):rt.curve(r) def test_02_three_real_passes_residual_not_penetration(self): h=prescanned(method={'length_m':.002});scratch=run(h);self.assertEqual(scratch['phase'],'succeeded');s=[r for r in scratch['rows'] if r['phase']=='scanning'];self.assertTrue(all(r['residual_depth_m'] is None for r in s));self.assertGreater(s[-1]['penetration_depth_m'],h.local_groove);at_start(h);post=run(h,'postscan');p=[r for r in post['rows'] if r['phase']=='scanning'];self.assertEqual(post['phase'],'succeeded');self.assertTrue(all(r['penetration_depth_m'] is None for r in p));self.assertGreater(p[-1]['residual_depth_m'],0);self.assertLess(abs(p[-1]['residual_depth_m']-h.local_groove),1e-9);self.ledger(h) def test_03_force_ramp_endpoint_and_integral_moments(self): from scipy.integrate import quad for tau in [1e-5,.05,100.]: for dt in [.000001,.01,.1,1.]: f0,target,slope=3.,8.,2.;got=rt.force_ramp(f0,target,slope,tau,dt);f=lambda t:target+slope*(t-tau)+(f0-target+slope*tau)*math.exp(-t/tau);pts=sorted({v for v in [tau,5*tau,30*tau,60*tau] if v<dt});expected=[f(dt),quad(f,0,dt,points=pts,epsabs=1e-12)[0],quad(lambda t:t*f(t),0,dt,points=pts,epsabs=1e-12)[0]] for a,b in zip(got,expected):self.assertAlmostEqual(a,b,delta=max(1e-10,abs(b)*1e-9)) def test_04_target_is_not_force_and_motion_requires_host_step(self): h=setup();call(h,'method.configure',**dict(h.method,pass_kind='prescan'));call(h,'acquisition.start');self.assertEqual(h.force,0.);self.assertEqual(h.distance,0.);self.assertEqual(h.force_target,.1);t=h.time_s for _ in range(5):call(h,'acquisition.result');h.read() self.assertEqual(h.time_s,t);step(h,.1);self.assertGreater(h.force,0);self.assertLess(h.force,.1);self.assertEqual(h.distance,0.) def test_05_friction_work_uses_source_axis_and_actual_force(self): from scipy.integrate import quad h=prescanned(method={'length_m':.0005,'initial_force_n':2.,'final_force_n':12.});w=h.tangential_work;r=run(h);s=[v for v in r['rows'] if v['phase']=='scanning'];start=s[0]['time_s'];finish=s[-1]['time_s'];duration=finish-start;v=h.method['speed_m_s'];load0=h.plant['force_response_tau_s'];f0=2.-2.*math.exp(-(start-h.operation_start)/load0);slope=10/duration;x0=h.method['source_start_distance_m'];knots=[(x-x0)/v for x in h.ref_x if x0<x<x0+h.method['length_m']] f=lambda t:(2.+slope*(t-load0)+(f0-2.+slope*load0)*math.exp(-t/load0))*float(np.interp(x0+v*t,h.ref_x,h.ref_mu))*v expected=quad(f,0,duration,points=knots,epsabs=1e-12,limit=2000)[0];self.assertAlmostEqual(h.tangential_work-w,expected,delta=2e-10);self.assertAlmostEqual(r['distance_m'],.0005);self.ledger(h) def test_06_source_distance_and_condition_rejections_atomic(self): h=prescanned();call(h,'method.configure',**dict(h.method,source_start_distance_m=0.));self.rejected(h,'acquisition.start','REFERENCE_DISTANCE_RANGE');call(h,'method.configure',**dict(h.method,source_start_distance_m=float(h.ref_x[-1])-.00001));self.rejected(h,'acquisition.start','REFERENCE_DISTANCE_RANGE') h=prescanned(sample={'accept_condition_transfer':False},stylus={'cone_angle_rad':math.pi/2});self.rejected(h,'acquisition.start','REFERENCE_CONDITIONS') h=prescanned(sample={'accept_unknown_conditions':False});self.rejected(h,'acquisition.start','UNKNOWN_REFERENCE_CONDITIONS') def test_07_stage_head_access_and_software_microscope(self): h=setup();self.rejected(h,'stage.move','HEAD_NOT_CLEAR',x_m=.01,y_m=0.,speed_m_s=.001);self.rejected(h,'specimen.remove','HEAD_NOT_CLEAR');self.rejected(h,'head.set_position','CONTACT_ENGAGED',distance_m=.04);park(h);call(h,'tool.select',mode='microscope');self.assertTrue(h.clamped);call(h,'stage.move',x_m=.01,y_m=-.027,speed_m_s=.01);self.assertEqual(h.stage_x,0.);step(h,3.);self.assertAlmostEqual(h.stage_y,-.027);call(h,'tool.select',mode='stylus');self.ledger(h) def test_08_all_manufacturer_ranges_and_bad_inputs_are_atomic(self): h=setup() for field,value in [('initial_force_n',200.0001),('final_force_n',200.0001),('speed_m_s',rt.SPEED_MIN*.9),('speed_m_s',.01001),('length_m',.07001),('sample_interval_s',.15)]:self.rejected(h,'method.configure',**dict(h.method,**{field:value})) self.rejected(h,'method.configure','STAGE_PATH_RANGE',**dict(h.method,start_x_m=.0699,length_m=.002));self.rejected(h,'method.configure','DECREASING_LOAD_UNSUPPORTED',**dict(h.method,initial_force_n=20.,final_force_n=10.)) for value in [True,float('nan'),float('inf'),-.1]:self.rejected(h,'sim.step',dt_s=value) self.rejected(h,'power.set',enabled=1);self.rejected(h,'method.configure',**dict(h.method,extra=1));self.rejected(h,'head.set_position',distance_m=.04001) def test_09_baseline_required_calibration_and_probe_load_match(self): h=setup();self.rejected(h,'acquisition.start','PRESCAN_REQUIRED');h=prescanned();call(h,'sensor.calibrate',**dict(rt.CALIBRATION_EXAMPLE,depth_zero_m=1e-6));self.rejected(h,'acquisition.start','BASELINE_CALIBRATION_MISMATCH');call(h,'sensor.calibrate',**rt.CALIBRATION_EXAMPLE);call(h,'method.configure',**dict(h.method,scan_force_n=.2));self.rejected(h,'acquisition.start','BASELINE_LOAD_MISMATCH') def test_10_damaged_track_reuse_rejected_new_y_allowed(self): h=prescanned();run(h);at_start(h);self.rejected(h,'acquisition.start','TRACK_ALREADY_DAMAGED');call(h,'method.configure',**dict(h.method,pass_kind='prescan'));self.rejected(h,'acquisition.start','TRACK_ALREADY_DAMAGED');park(h,0.,.001);call(h,'method.configure',**dict(h.method,path_y_m=.001));call(h,'head.set_position',distance_m=0.);step(h,4.);call(h,'contact.set',engaged=True);self.assertEqual(run(h)['phase'],'succeeded');self.ledger(h) def test_11_finite_coating_then_substrate_and_segment_volume(self): h=prescanned(sample={'coating_thickness_m':1e-8});l0=h._ledger();r=run(h);self.assertEqual(r['phase'],'succeeded');l=self.ledger(h);self.assertGreater(l['coating_removed_m3'],0);self.assertGreater(l['substrate_removed_m3'],0);volume=sum((s['x1']-s['x0'])*s['depth_m']*h.specimen['track_width_m'] for s in h.active_track['segments']);self.assertAlmostEqual(volume,l['coating_removed_m3']+l['substrate_removed_m3'],places=23);self.assertAlmostEqual(l['coating_removed_m3']*1e9+l['substrate_removed_m3']*1e9+l['stylus_removed_m3']*1e10,l['wear_work_j']-l0['wear_work_j'],places=14) def test_12_tiny_stylus_exhaustion_exact_partial_and_ledger(self): h=prescanned(stylus={'volume_m3':1e-15,'removal_energy_j_m3':1e3,'wear_energy_fraction':.5});r=run(h);self.assertEqual(r['phase'],'failed');self.assertEqual(r['error_code'],'STYLUS_EXHAUSTED');self.assertGreater(r['distance_m'],0);self.assertLess(r['distance_m'],h.method['length_m']);self.assertGreaterEqual(h.volumes['stylus'],0);self.assertLess(h.volumes['stylus'],1e-23);self.assertEqual(r['rows'][-1]['elapsed_s'],r['elapsed_s']);self.ledger(h) def test_13_local_depth_force_and_temperature_finite_boundaries(self): cases=[({'contact_stiffness_n_m':1e3},None,None,'DEPTH_RANGE'),({'thermal_capacity_j_k':.001,'heat_loss_w_k':0.,'temperature_max_k':296.16},None,None,'THERMAL_MODEL_RANGE'),({}, {'substrate_thickness_m':1e-9},None,'LOCAL_SPECIMEN_THICKNESS')] for plant,sample,stylus,error in cases: h=prescanned(plant=plant,sample=sample,stylus=stylus);r=run(h);self.assertEqual(r['error_code'],error);self.assertLessEqual(h._depth(),rt.DEPTH_MAX+1e-15);self.assertLessEqual(h.temperature,h.plant['temperature_max_k']+1e-12);self.ledger(h) h=prescanned(method={'initial_force_n':1.,'final_force_n':150.});h.ref_mu=np.full_like(h.ref_mu,2.);r=run(h);self.assertEqual(r['error_code'],'FRICTION_FORCE_RANGE');self.assertLessEqual(h.force,100.+1e-10);self.ledger(h) def test_14_energy_fractions_reject_without_loading(self): h=setup(sample={'sample_wear_energy_fraction':.9},stylus={'wear_energy_fraction':.2});call(h,'method.configure',**dict(h.method,pass_kind='prescan'));self.rejected(h,'acquisition.start','ENERGY_FRACTIONS');self.assertEqual(h.force,0.) def test_15_heat_adiabatic_cooling_stiff_stability_and_spring_return(self): h=prescanned(plant={'heat_loss_w_k':0.,'thermal_capacity_j_k':.01});run(h);l=self.ledger(h);self.assertAlmostEqual(h.temperature,296.15+l['heat_input_j']/.01,places=8);self.assertEqual(h.force,0.);self.assertAlmostEqual(l['normal_loading_work_j'],l['normal_recovered_work_j'],places=13) h=prescanned(plant={'thermal_capacity_j_k':.001,'heat_loss_w_k':1000.});run(h);self.assertGreaterEqual(h.temperature,296.15);self.assertLess(h.temperature,296.16);self.ledger(h) def test_16_passive_cooling_and_hot_access(self): h=prescanned(plant={'thermal_capacity_j_k':.01,'heat_loss_w_k':0.,'safe_access_temperature_k':296.150001});run(h);park(h);call(h,'clamp.set',locked=False);self.rejected(h,'specimen.remove','HOT_SPECIMEN');self.ledger(h) h=prescanned(plant={'thermal_capacity_j_k':1.,'heat_loss_w_k':.1});run(h);start=h.temperature;step(h,3.);self.assertAlmostEqual(h.temperature,296.15+(start-296.15)*math.exp(-.3),places=9) def test_17_nondestructive_prescan_postscan_do_not_replenish_damage(self): h=setup();v=copy.deepcopy(h.volumes);run(h,'prescan');self.assertEqual(v,h.volumes);at_start(h);run(h,'scratch');v=copy.deepcopy(h.volumes);at_start(h);run(h,'postscan');self.assertEqual(v,h.volumes);self.ledger(h) def test_18_sensor_bias_coefficient_and_external_calibration(self): h=prescanned(plant={'force_gain':2.,'friction_gain':1.5});r=run(h);s=[v for v in r['rows'] if v['phase']=='scanning' and v['friction_coefficient'] is not None][-1];self.assertAlmostEqual(s['friction_coefficient'],abs(s['friction_force_n'])/s['normal_force_n']);self.assertAlmostEqual(s['normal_force_n'],20.,places=8);self.assertNotAlmostEqual(s['friction_coefficient'],float(np.interp(h.method['source_start_distance_m']+h.distance,h.ref_x,h.ref_mu)),places=4) h=setup(plant={'force_offset_n':.2,'friction_offset_n':.3,'depth_offset_m':1e-6});park(h);call(h,'sensor.zero');self.assertAlmostEqual(h.calibration['normal_zero_n'],.2);self.assertAlmostEqual(h.calibration['friction_zero_n'],.3);call(h,'sensor.calibrate',**rt.CALIBRATION_EXAMPLE) def test_19_sensor_overrange_unavailable_and_lowload_reason(self): h=prescanned(plant={'force_gain':10.},method={'initial_force_n':30.,'final_force_n':30.});r=run(h);self.assertEqual(r['error_code'],'SENSOR_OVER_RANGE');self.assertIsNone(r['rows'][-1]['normal_force_n']);self.ledger(h) h=setup(plant={'force_gain':.1},method={'pass_kind':'prescan','scan_force_n':.001});call(h,'acquisition.start');step(h,.2);self.assertEqual(h.read()['observation.unavailable_reason'],'LOW_LOAD');self.assertIsNone(h.read()['friction.coefficient']) def test_20_tilted_same_coordinate_baseline_cancels_surface_profile(self): a=prescanned();b=prescanned(sample={'surface_slope_x':.001});run(a);run(b);at_start(a);at_start(b);ra=run(a,'postscan');rb=run(b,'postscan');pa=[r for r in ra['rows'] if r['phase']=='scanning'];pb=[r for r in rb['rows'] if r['phase']=='scanning'];self.assertAlmostEqual(pa[-1]['residual_depth_m'],pb[-1]['residual_depth_m'],delta=1e-10);self.assertNotEqual(pa[-1]['raw_depth_m'],pb[-1]['raw_depth_m']) def test_21_critical_bracket_persistence_missing_and_leftcensor(self): a=rows([0.,1.,3.,4.]);r=rt.critical_load(a,'friction_force_n',2.,2);self.assertAlmostEqual(r['position_m'],.0015);self.assertAlmostEqual(r['critical_load_n'],11.5) for values in [[0.,None,3.,4.],[0.,1.,3.,None],[3.,4.,5.]]: r=rt.critical_load(rows(values),'friction_force_n',2.,2);self.assertIsNone(r['critical_load_n']) self.assertEqual(rt.critical_load(rows([3.,4.]),'friction_force_n',2.,1)['reason'],'LEFT_CENSORED') def test_22_postscan_lc_maps_scratch_load_never_probe_load(self): post=rows([0.,1e-6,3e-6,4e-6],'residual_depth_m',loads=[.1]*4);scratch=rows([0.,1.,2.,3.],loads=[5.,15.,25.,35.]);r=rt.critical_load(post,'residual_depth_m',2e-6,2,scratch);self.assertAlmostEqual(r['critical_load_n'],20.);self.assertNotEqual(r['critical_load_n'],.1) self.assertIsNone(rt.critical_load(post,'residual_depth_m',2e-6,2)['critical_load_n']);scratch[1]['normal_force_n']=None;self.assertIsNone(rt.critical_load(post,'residual_depth_m',2e-6,2,scratch)['critical_load_n']) h=setup();args=dict(rt.CAPS['analysis.critical_load']['example_arguments'],rows=post,load_rows=rows([0.,1.,2.,3.],loads=[5.,15.,25.,35.]),channel='residual_depth_m',threshold_m=2e-6,persistence=2);self.assertAlmostEqual(call(h,'analysis.critical_load',**args)['critical_load_n'],20.) def test_23_criterion_stop_preserves_partial_track_and_released_load(self): h=prescanned(method={'length_m':.002,'criterion_threshold_n':.5,'criterion_persistence':1});call(h,'method.configure',**dict(h.method,stop_on_criterion=True));r=run(h);self.assertEqual(r['phase'],'succeeded');self.assertGreater(r['distance_m'],0.);self.assertLess(r['distance_m'],.002);self.assertEqual(h.force,0.);self.assertEqual(h.active_track['distance'],r['distance_m']);self.ledger(h) def test_24_cancel_keeps_damage_and_force_relaxes_only_by_step(self): h=prescanned();call(h,'acquisition.start');step(h,.8);f=h.force;v=copy.deepcopy(h.volumes);call(h,'acquisition.stop');r=call(h,'acquisition.result');self.assertEqual(h.force,f);self.assertEqual(v,h.volumes);self.rejected(h,'contact.set','LOAD_NOT_RELEASED',engaged=False);step(h,2.);self.assertEqual(h.force,0.);self.assertEqual(v,h.volumes);self.assertEqual(r,call(h,'acquisition.result'));self.ledger(h) def test_25_timeout_and_software_stop_keep_partial_effects(self): h=setup(method={'pass_kind':'prescan','timeout_s':.1});r=run(h);self.assertEqual(r['error_code'],'TIMEOUT');self.assertAlmostEqual(r['elapsed_s'],.1) h=prescanned();call(h,'acquisition.start');step(h,.8);call(h,'emergency.stop');self.assertEqual(h.phase,'failed');self.assertEqual(h.error,'SOFTWARE_STOP');self.rejected(h,'emergency.reset','LOAD_NOT_RELEASED');step(h,2.);call(h,'emergency.reset');self.assertFalse(h.emergency);self.assertEqual(h.phase,'failed');self.ledger(h) def test_26_history_frozen_after_method_clean_and_new_sample(self): h=prescanned();r=run(h);op=r['operation_id'];frozen=copy.deepcopy(h.records[op]);cleanup(h);call(h,'method.configure',**dict(h.method,pass_kind='postscan',criterion_threshold_m=1e-4));call(h,'specimen.load',**rt.SAMPLE_EXAMPLE);self.assertEqual(h.records[op],frozen);self.assertEqual(call(h,'acquisition.result'),frozen);self.assertEqual(json.loads(frozen['method_json'])['pass_kind'],'scratch');self.assertIn('derived_nominal_load_ratio',frozen['evidence']);self.assertGreater(frozen['source_projection_count'],0) def test_27_queries_pure_and_owner_not_stolen(self): h=setup(method={'pass_kind':'prescan'});s=h.session();op=s.invoke(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='start')['operation_id'];step(h,.3);before=state(h);h.read();h.describe();s.read(instance_id=h.instance_id);s.poll(op);call(h,'reference.query',reference_id=rt.SAMPLE_EXAMPLE['reference_id']);call(h,'image.reference',reference_id=rt.SAMPLE_EXAMPLE['reference_id']);call(h,'ledger.read');self.assertEqual(state(h),before);q=s.invoke(instance_id=h.instance_id,capability_id='acquisition.result',arguments={},request_id='result');self.assertIsNone(q['operation_id']);self.assertEqual(h._owners[op],'agent');json.dumps(q,allow_nan=False) def test_28_session_owner_access_poll_cancel_and_idempotence(self): h=setup(method={'pass_kind':'prescan'});h.register_principal('other');a=h.session();b=h.session('other');args=dict(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='start');r=a.invoke(**args);self.assertEqual(r,a.invoke(**args));op=r['operation_id'];self.assertEqual(h._counter,1) for k in ['acquisition.result','acquisition.stop']:self.assertEqual(b.invoke(instance_id=h.instance_id,capability_id=k,arguments={},request_id=k)['error']['code'],'ACCESS_DENIED') for fn in [lambda:b.poll(op),lambda:b.cancel(op,'stop')]: with self.assertRaises(rt.ActionRejected):fn() c=a.cancel(op,'stop');self.assertEqual(c,a.cancel(op,'stop'));self.assertEqual(a.invoke(**dict(args,capability_id='power.set',arguments={'enabled':False}))['error']['code'],'REQUEST_CONFLICT') def test_29_stale_cancel_retry_cannot_cancel_new_operation(self): h=setup(method={'pass_kind':'prescan'});s=h.session();a=dict(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='one');op1=s.invoke(**a)['operation_id'];c=s.cancel(op1,'cancel');step(h,2.);op2=s.invoke(**dict(a,request_id='two'))['operation_id'];self.assertEqual(s.cancel(op1,'cancel'),c);self.assertEqual(h.phase,'running');self.assertEqual(h.operation_id,op2) with self.assertRaisesRegex(rt.ActionRejected,'REQUEST_CONFLICT'):s.cancel(op2,'cancel') def test_30_no_agent_truth_or_recovery_capabilities(self): h=setup();s=h.session();meta=s.describe(instance_id=h.instance_id);self.assertTrue(all(not k.startswith('truth.') for k in meta['state_slots']));self.assertNotIn('ledger.read',meta['capabilities']);self.assertNotIn('specimen.remove',meta['capabilities']);self.assertTrue(all(not k.startswith('truth.') for k in s.read(instance_id=h.instance_id)['observations'])) for k in ['ledger.read','specimen.remove','stylus.remove','debris.collect','sim.step','plant.configure']: args=rt.CAPS[k]['example_arguments'];before=state(h);r=s.invoke(instance_id=h.instance_id,capability_id=k,arguments=args,request_id=k);self.assertEqual(r['error']['code'],'ACCESS_DENIED');self.assertEqual(state(h),before) with self.assertRaises(rt.ActionRejected):s.read(instance_id=h.instance_id,state_ids=['truth.normal_force_n']) with self.assertRaises(rt.ActionRejected):s.write(instance_id=h.instance_id,state_id='load.target_n',value=100.,request_id='x') def test_31_two_instances_and_fractional_host_time_partition(self): a=setup('one',method={'pass_kind':'prescan'});b=setup('two',method={'pass_kind':'prescan'});call(a,'acquisition.start');call(b,'acquisition.start');step(a,1.3) for dt in [.03,.07,.25,.15,.4,.4]:step(b,dt) self.assertEqual(a.read(),b.read());self.assertEqual(a.rows,b.rows);snapshot=state(b);step(a,.2);self.assertEqual(state(b),snapshot);self.assertNotEqual(a.time_s,b.time_s);call(a,'sim.step',dt_s=0.) def test_32_extreme_dt_and_stiff_force_stable(self): a=setup('a',plant={'force_response_tau_s':1e-5,'sensor_tau_s':1e-5},method={'pass_kind':'prescan'});b=setup('b',plant={'force_response_tau_s':1e-5,'sensor_tau_s':1e-5},method={'pass_kind':'prescan'});call(a,'acquisition.start');call(b,'acquisition.start');step(a,10.) for _ in range(100):step(b,.1) self.assertEqual(a.read(),b.read());self.assertEqual(a.rows,b.rows);self.assertEqual(a.phase,'succeeded');self.ledger(a) def test_33_full_recovery_mass_ledger_and_no_resurrection(self): h=prescanned(sample={'coating_thickness_m':1e-8});run(h);cleanup(h);l=self.ledger(h) for n in ['coating','substrate','stylus']:self.assertEqual(l[n+'_remaining_kg'],0.);self.assertEqual(l[n+'_debris_kg'],0.) self.assertGreater(l['substrate_debris_recovered_kg'],0.);self.assertGreater(l['stylus_debris_recovered_kg'],0.);self.rejected(h,'specimen.remove','NOT_LOADED') def test_34_no_hidden_truth_in_agent_results(self): h=setup(method={'pass_kind':'prescan'});s=h.session();op=s.invoke(instance_id=h.instance_id,capability_id='acquisition.start',arguments={},request_id='start')['operation_id'];step(h,5.);r=s.poll(op);json.dumps(r,allow_nan=False) def visit(value): if isinstance(value,dict): for k,v in value.items():self.assertFalse(k.startswith('truth.') or k in ['local_groove_m','coating_remaining_kg','substrate_remaining_kg','stylus_remaining_kg']);visit(v) elif isinstance(value,list): for v in value:visit(v) visit(r);visit(s.read(instance_id=h.instance_id)) def test_35_declared_unsupported_and_reference_only_reject(self): h=setup() for k in rt.UNSUPPORTED:self.rejected(h,k,'UNSUPPORTED') park(h);call(h,'clamp.set',locked=False);call(h,'specimen.remove');lib=rt.library();rid=next(k for k,r in lib['substances'].items() if not r.get('runtime_usable'));self.rejected(h,'specimen.load','INVALID_REFERENCE',**dict(rt.SAMPLE_EXAMPLE,reference_id=rid));self.rejected(h,'reference.query','INVALID_REFERENCE',reference_id='missing');self.rejected(h,'specimen.load','NEGATIVE_SOURCE_FORCE',**dict(rt.SAMPLE_EXAMPLE,accept_negative_force_projection=False)) def test_36_protocol_describe_registration_errors_and_json(self): h=setup();s=h.session();self.assertEqual(s.describe(asset_type_id=rt.ASSET_TYPE_ID)['asset_type_id'],rt.ASSET_TYPE_ID) for fn in [lambda:s.describe(),lambda:s.describe(instance_id='bad'),lambda:h.session('bad'),lambda:h.register_principal('agent'),lambda:s.read(instance_id=h.instance_id,state_ids='bad')]: with self.assertRaises(rt.ActionRejected):fn() for capability,arguments in [('unknown',{}),('power.set',{'enabled':'yes'}),('acoustic_emission.acquire',{})]:json.dumps(s.invoke(instance_id=h.instance_id,capability_id=capability,arguments=arguments,request_id=capability),allow_nan=False) def test_37_failed_method_does_not_mutate_existing_results(self): h=prescanned();r=run(h);self.rejected(h,'method.configure','STAGE_PATH_RANGE',**dict(h.method,start_x_m=.07));self.assertEqual(r,call(h,'acquisition.result'));before=state(h);s=h.session();rejected=s.invoke(instance_id=h.instance_id,capability_id='stage.move',arguments={'x_m':.1,'y_m':0.,'speed_m_s':.01},request_id='bad');self.assertEqual(rejected['status'],'rejected');self.assertEqual(state(h),before) def test_38_phases_actual_sampling_time_and_endpoint_snapshot(self): h=prescanned(method={'length_m':.0005,'speed_m_s':.001,'sample_interval_s':.2});r=run(h);scan=[x for x in r['rows'] if x['phase']=='scanning'];self.assertAlmostEqual(scan[-1]['time_s']-scan[0]['time_s'],.5,places=9);self.assertAlmostEqual(scan[-1]['distance_m'],.0005);self.assertEqual(r['rows'][-1]['elapsed_s'],r['elapsed_s']);self.assertEqual(r['rows'][-1]['normal_force_n'],h.rows[-1]['normal_force_n']);self.assertGreater(r['elapsed_s'],.5);self.assertEqual(h.force,0.);self.assertTrue(all(y['time_s']>=x['time_s'] for x,y in zip(r['rows'],r['rows'][1:]))) def test_39_accepted_source_variants_change_actual_work(self): usable=[(k,r) for k,r in rt.library()['substances'].items() if r.get('runtime_usable') and k.startswith(('borofloat33_','b4c_','al2o3_'))];works=[] for rid,ref in usable[:2]: h=prescanned(sample={'reference_id':rid},method={'source_start_distance_m':ref['values']['distance_m'][0]});r=run(h);self.assertEqual(r['phase'],'succeeded');self.assertEqual(r['reference_id'],rid);works.append(h.tangential_work) self.assertEqual(len(works),2);self.assertNotEqual(*works) def test_zz_all_real_capability_returns_and_state_schemas(self): spec=importlib.util.spec_from_file_location('rst_asset_tool',ROOT/'skills/chemistry-lab-assets/scripts/asset_tool.py');tool=importlib.util.module_from_spec(spec);spec.loader.exec_module(tool);meta=rt.export_antonpaar_rst300_contract_metadata();json.dumps(meta,allow_nan=False) for k,c in meta['capabilities'].items(): self.assertEqual(tool.lint_schema(c['input_schema'],path=k+'.input'),[]);self.assertEqual(tool.lint_schema(c['output_schema'],path=k+'.output'),[]) covered=set() for k,a,r in OBSERVED: self.assertEqual(tool.validate_value(a,meta['capabilities'][k]['input_schema'],path=k+'.input'),[]);self.assertEqual(tool.validate_value(r,meta['capabilities'][k]['output_schema'],path=k+'.output'),[]);covered.add(k) self.assertEqual(covered,set(rt.CAPS)-set(rt.UNSUPPORTED)) for state_values in STATES: self.assertEqual(set(state_values),set(rt.SLOTS));json.dumps(state_values,allow_nan=False) for k,v in state_values.items():self.assertEqual(tool.validate_value(v,meta['state_slots'][k]['value_schema'],path=k),[]) for k,c in meta['capabilities'].items():self.assertTrue(set(rt.CAPS[k]['effects'])<={e['state_id'] for e in c['state_effects']})if __name__=='__main__':unittest.main()12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547"""tests for CHEM-153 antonpaar_saxspace: python3 -m unittest tests/test_asset_antonpaar_saxspace.py
Topics (pipeline.md): set points only write targets, read/describe are pure, rejected preconditions leave the state unchanged, two instancesare isolated, agent/evaluator truth isolation, conservation (photons, liquid volume, solute mass, tube energy), real return values validatedagainst the declared schemas (asset_tool lint_schema / validate_value), asynchronous completion and cancellation remnants, host-stepindependence, declared immediate and on_step effects covering what the process changes; plus the instrument behaviour (generator interlocks andramps, vacuum below 3 mbar, TCStage range and heating rate, q range 0.03-40.7 nm^-1 and SWAXS to 60 deg, MYTHEN2 R 1K strips) and the scatteringphysics (absolute scale from water cross-checked against the NIST SRM 3600 certified curve, Guinier Rg and molecular weight of SASBDB proteinsafter desmearing, Percus-Yevick concentration effect, silver behenate calibration, silicon Ka doublet, NIST gold nanoparticles, sample states,faults and the autosampler carry-over)."""import copyimport jsonimport mathimport randomimport sysimport unittestfrom pathlib import Path
import numpy as np
ROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT / "scripts"))sys.path.insert(0, str(ROOT / "skills/chemistry-lab-assets/scripts"))from asset_runtime import antonpaar_saxspace as rt # noqa: E402import asset_tool # noqa: E402
CHECKS, PROCESS_EVIDENCE = [], {}_META = {}RNGS = ('rng', 'rng_acq', 'rng_mount', 'rng_cal')LYS = 'sasbdb_sasdrm8_lysozyme_c'BSA = 'sasbdb_sasdeb5_bsa'GC = 'nist_srm3600_glassy_carbon'AU30 = 'nist_rm8012_gold_30nm'
def _meta(): if not _META: _META.update(rt.export_antonpaar_saxspace_contract_metadata()) return _META
_orig_invoke = rt.AntonpaarSaxspaceRuntime.invoke
def _instrumented_invoke(self, capability_id, **a): """Every successful call is checked against its declared output schema and immediate state effects (read does not advance time).""" before = self.read('evaluator') if capability_id != 'sim.step' else None t0 = self.time_ns out = _orig_invoke(self, capability_id, **a) meta = _meta()['capabilities'][capability_id] errs = asset_tool.validate_value(out, meta['output_schema']) if errs: raise AssertionError(f'{capability_id} output violates its schema: {errs[:3]}') if before is not None: assert self.time_ns == t0, capability_id after = self.read('evaluator') undeclared = {k for k in after if json.dumps(after[k], sort_keys=True, default=str) != json.dumps(before[k], sort_keys=True, default=str) and _changed(before[k], after[k])} - set(rt.CAPS[capability_id]['effects']) if undeclared and rt.EFFECTS: raise AssertionError(f'{capability_id} changed undeclared state immediately: {sorted(undeclared)}') PROCESS_EVIDENCE.setdefault(capability_id, []).append(dict(arguments=copy.deepcopy(a), result_keys=sorted(out))) return out
rt.AntonpaarSaxspaceRuntime.invoke = _instrumented_invoke
class QuietRng: """Noise-free stand-in for random.Random (gauges exact, fixed draws) so that two runs differ only by the process.""" def gauss(self, mu, sigma): return mu
def random(self): return 0.5
def uniform(self, a, b): return 0.5 * (a + b)
def getrandbits(self, k): return 12345
def seed(self, x): pass
def configured(seed=1, **plant): h = rt.AntonpaarSaxspaceRuntime() h.invoke('plant.configure', **dict(rt.PLANT_EXAMPLE, noise_seed=seed, **plant)) return h
def ready(seed=1, xray=True, **plant): """Powered, SAXSdrive up, chiller flowing, key at I and (optionally) X-rays at 40 kV / 50 mA.""" h = configured(seed, **plant) h.invoke('power.set', enabled=True) h.step(61.0) h.invoke('generator.set_key', on=True) if xray: h.invoke('generator.xray_on') h.step(21.0) return h
def liquid(h, sid, comps=(), volume=500e-9): h.invoke('sample.provide', sample_id=sid, form='solution', solvent='water', volume_m3=volume, thickness_m=None, components=[dict(template_id=t, concentration_kg_m3=c, model_parameters=None) for t, c in comps]) return sid
def solid(h, sid, tid, thickness, form='solid'): h.invoke('sample.provide', sample_id=sid, form=form, solvent='none', volume_m3=0.0, thickness_m=thickness, components=[dict(template_id=tid, concentration_kg_m3=None, model_parameters=None)]) return sid
def load(h, sid, holder='capillary_1mm', pump_s=220.0, temp=None, align=True): """Vent, open the door, exchange the holder, close, pump below 3 mbar, (optionally) set the temperature and TrueFocus-align.""" if not h.door_open: h.invoke('vacuum.set_pump', on=False) h.step(80.0) h.invoke('chamber.set_door', open=True) if h.holder is not None or h.holder_broken: h.invoke('sample.unload') h.invoke('sample.load', sample_id=sid, holder=holder) h.invoke('chamber.set_door', open=False) h.invoke('vacuum.set_pump', on=True) if temp is not None: h.invoke('stage.set_temperature', temperature_k=temp) h.step(pump_s) if align and holder in ('capillary_1mm', 'mu_cell') and sid is not None: h.invoke('stage.auto_align') h.step(rt.ALIGN_S + 2.0) return h
def acquire(h, exposure=300.0, frames=1): op = h.invoke('acquisition.start', exposure_s=exposure, frames=frames)['operation_id'] h.step(exposure + 1.0) rec = h.records[h.operations[op]['record_id']] assert rec['status'] == 'completed', (rec['status'], rec['error_code']) return rec['record_id']
def empty_beam(h, pump_s=220.0): """Vent, open the door, remove the holder, close and pump: the beam passes only air and the collimation (empty-beam background).""" if not h.door_open: h.invoke('vacuum.set_pump', on=False) h.step(80.0) h.invoke('chamber.set_door', open=True) if h.holder is not None or h.holder_broken: h.invoke('sample.unload') h.invoke('chamber.set_door', open=False) h.invoke('vacuum.set_pump', on=True) h.step(pump_s) return h
def calibrated(seed=1, collimation='line'): """Ready instrument with the zero angle and the SDD calibrated on silver behenate (paste cell).""" h = ready(seed) if collimation != 'line': h.invoke('collimation.set_mode', mode=collimation) solid(h, 'agbe', 'silver_behenate', 1e-3, form='powder') load(h, 'agbe', holder='paste_cell') r = acquire(h, 60.0 if collimation == 'line' else 600.0) h.invoke('calibration.zero_angle', record_id=r) h.invoke('calibration.q_scale', record_id=r, calibrant='silver_behenate') return h
def water_calibration(h, temp=293.15, exposure=600.0): liquid(h, 'water_std') load(h, 'water_std', temp=temp) rw = acquire(h, exposure) load(h, None, temp=temp) re_ = acquire(h, exposure) return h.invoke('calibration.absolute', record_id=rw, background_record_id=re_, standard='water', thickness_m=1e-3)['calibration_id']
def rejected(h, cap, code, **a): before = h.read('evaluator') rev = h.revision try: h.invoke(cap, **a) except rt.ActionRejected as exc: assert str(exc) == code, (cap, str(exc), code) assert json.dumps(h.read('evaluator'), sort_keys=True, default=str) == json.dumps(before, sort_keys=True, default=str), cap assert h.revision == rev, cap return True raise AssertionError(f'{cap} was not rejected (expected {code})')
def reduced_arrays(r): return np.asarray(r['q_per_m']) * 1e-9, np.asarray(r['intensity']) / 100.0, np.asarray(r['sigma']) / 100.0 # 1/nm, 1/cm
class ContractAndSchemas(unittest.TestCase): def test_module_identity(self): self.assertEqual(rt.ASSET_TYPE_ID, 'instrument.antonpaar_saxspace') self.assertEqual(rt.CATALOG_ID, 'CHEM-153')
def test_schemas_lint_and_examples_validate(self): meta = _meta() for k, c in meta['capabilities'].items(): self.assertEqual(asset_tool.lint_schema(c['input_schema']), [], k) self.assertEqual(asset_tool.lint_schema(c['output_schema']), [], k) if c['availability'] == 'implemented': self.assertEqual(asset_tool.validate_value(c['example_arguments'], c['input_schema']), [], k) for k, s in meta['state_slots'].items(): self.assertEqual(asset_tool.lint_schema(s['value_schema']), [], k)
def test_metadata_references_are_consistent(self): meta = _meta() slots = set(meta['state_slots']) for k, c in meta['capabilities'].items(): for e in c['state_effects']: self.assertIn(e['state_id'], slots, k) for x in c['observes']: self.assertIn(x, slots, k) for p in c['preconditions']: for x in p['state_ids']: self.assertIn(x, slots, k) for e in c['errors']: self.assertIn(e['code'], rt.ERROR_ZH, k) queries = {k for k, v in rt.CAPS.items() if v['kind'] in ('query', 'analysis')} self.assertEqual(set(rt.EFFECTS) | set(rt.UNSUPPORTED) | queries, set(rt.CAPS)) self.assertEqual(set(rt.CAP_SOURCES), set(rt.CAPS)) comps = {p['id'] for p in json.loads((rt.ASSET / 'geometry_manifest.json').read_text())['components']} for k, c in meta['capabilities'].items(): self.assertLessEqual(set(c['component_ids']) - {'monitor'}, comps, k) for k, s in meta['state_slots'].items(): self.assertLessEqual(set(s['component_ids']) - {'monitor'}, comps, k)
def test_every_rejection_code_is_declared(self): """Each ActionRejected code raised by a command method appears in that capability's declared errors.""" import inspect import re src = inspect.getsource(rt.AntonpaarSaxspaceRuntime) meta = _meta()['capabilities'] helpers = {'_need_plant': ['PLANT_REQUIRED'], '_need_power': ['PLANT_REQUIRED', 'POWER_OFF'], '_need_gen_power': ['PLANT_REQUIRED', 'POWER_OFF'], '_need_ready': ['PLANT_REQUIRED', 'POWER_OFF', 'NOT_READY', 'ERROR_PENDING'], '_need_idle': ['ACQUISITION_RUNNING'], '_need_door_open': ['DOOR_CLOSED'], '_need_stage': ['PLANT_REQUIRED', 'POWER_OFF', 'NOT_READY', 'ERROR_PENDING', 'ACQUISITION_RUNNING'], '_need_beam_ready': ['PLANT_REQUIRED', 'POWER_OFF', 'NOT_READY', 'ERROR_PENDING', 'ACQUISITION_RUNNING', 'DOOR_OPEN', 'XRAY_NOT_READY', 'VACUUM_NOT_READY', 'MOTION_IN_PROGRESS', 'RECORDS_FULL'], '_need_asx': ['PLANT_REQUIRED', 'POWER_OFF', 'NOT_READY', 'ERROR_PENDING', 'ASX_DOOR_OPEN', 'ASX_BUSY', 'ACQUISITION_RUNNING'], '_rec(': ['UNKNOWN_RECORD', 'RECORD_NOT_COMPLETED'], '_norm(': ['NO_PRIMARY_BEAM'], '_red(': ['UNKNOWN_REDUCED'], '_cmd_analysis_guinier(': ['UNKNOWN_REDUCED', 'GUINIER_FAILED']} for k in rt.CAPS: if k in rt.UNSUPPORTED: continue m = re.search(r' def _cmd_' + k.replace('.', '_') + r'\(.*?(?=\n def |\Z)', src, re.S) self.assertIsNotNone(m, k) body = m.group(0) codes = set(re.findall(r"ActionRejected\('([A-Z_]+)'\)", body)) for hname, hcodes in helpers.items(): if hname in body: codes |= set(hcodes) codes.discard('INVALID_ARGUMENT') declared = {e['code'] for e in meta[k]['errors']} self.assertLessEqual(codes, declared, (k, sorted(codes - declared)))
def test_unsupported_capabilities_report_unsupported(self): h = configured() h.register_principal('a', 'agent') s = h.session('a') for k in rt.UNSUPPORTED: r = s.invoke(instance_id=h.instance_id, capability_id=k, arguments={}, request_id='u-' + k) self.assertEqual(r['status'], 'unsupported', k) self.assertEqual(r['error']['code'], 'UNSUPPORTED')
class HostClockAndPurity(unittest.TestCase): def test_read_and_describe_do_not_advance_time(self): h = ready() h.register_principal('a', 'agent') t, rev = h.time_ns, h.revision h.read('evaluator') s = h.session('a') s.read(instance_id=h.instance_id) s.describe(instance_id=h.instance_id) self.assertEqual((h.time_ns, h.revision), (t, rev))
def test_step_zero_and_negative(self): h = configured() rev = h.revision h.step(0.0) self.assertEqual(h.revision, rev) with self.assertRaises(rt.ActionRejected): h.step(-1.0)
def test_host_step_chopping_does_not_change_the_result(self): def run(chunks): h = ready(seed=5) h.rng = QuietRng() liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys', temp=283.15) h.invoke('acquisition.swaxs_scan', arm_angles_rad=[0.0, 0.3], exposure_s=30.0) h.invoke('asx.set_door', open=True) h.invoke('asx.set_door', open=False) for dt in chunks: h.step(dt) rec = h.records['sx-%d' % h.seq['sx']] return h.read('evaluator'), h.ledger(), rec (a, la, ra), (b, lb, rb) = run([90.0]), run([0.37] * 243 + [0.09]) for k in ('truth.pressure_pa', 'truth.stage_temperature_k', 'detector.arm_angle_rad', 'stage.y_m', 'clock.time_s'): self.assertAlmostEqual(a[k], b[k], delta=1e-9 * max(abs(a[k]), 1e-12), msg=k) self.assertEqual(ra['status'], rb['status']) self.assertEqual(len(ra['segments']), len(rb['segments'])) for k in ('photons_incident', 'photons_scattered_detected', 'tube_energy_j'): self.assertAlmostEqual(la[k], lb[k], delta=1e-9 * max(la[k], 1.0), msg=k)
def test_reads_do_not_change_later_counts(self): """Reading (agent and evaluator, incl. detector.total_counts that evaluates the rate model) during an exposure leaves the record and the ledgers bit-identical to a run without reads (the rate cache holds values that depend on its quantised key only).""" h = ready(seed=4) liquid(h, 'w') load(h, 'w') h.invoke('acquisition.start', exposure_s=30.0, frames=1) a, b = copy.deepcopy(h), copy.deepcopy(h) for _ in range(70): a.step(0.5) a.read('agent') a.read('evaluator') b.step(0.5) ra, rb = a.records['sx-1'], b.records['sx-1'] self.assertEqual(ra['status'], 'completed') self.assertEqual(ra['primary_beam_counts'], rb['primary_beam_counts']) self.assertEqual(ra['segments'][0]['counts'], rb['segments'][0]['counts']) self.assertEqual(a.ledger(), b.ledger())
def test_set_points_only_write_targets(self): h = ready() h.invoke('detector.move_arm', angle_rad=0.5) self.assertEqual(h.arm, 0.0) h.step(1.0) self.assertAlmostEqual(h.arm, rt.ARM_SPEED_RAD_S, places=12) h.invoke('stage.set_temperature', temperature_k=333.15) t0 = h.t_stage self.assertEqual(h.t_set, 333.15) h.step(60.0) self.assertAlmostEqual(h.t_stage - t0, rt.HOT_STAGE_RAMP_K_S * 60.0, places=6) # 10 C/min while far from the set point h.invoke('generator.set_power', voltage_v=30000.0, current_a=0.02) self.assertEqual(h.kv, 40000.0) h.step(2.0) self.assertAlmostEqual(h.kv, 40000.0 - 2.0 * rt.HV_RAMP_V_S, places=6)
class GeneratorAndInterlocks(unittest.TestCase): def test_start_up_key_ramp_and_lamps(self): h = configured() rejected(h, 'generator.xray_on', 'POWER_OFF') h.invoke('power.set', enabled=True) h.step(rt.BOOT_S - 1.0) self.assertEqual(h.state, 'booting') rejected(h, 'generator.xray_on', 'NOT_READY') h.step(2.0) self.assertEqual(h.state, 'ready') rejected(h, 'generator.xray_on', 'KEY_OFF') h.invoke('generator.set_key', on=True) self.assertTrue(h.read()['panel.xray_off_lamp']) h.invoke('generator.xray_on') self.assertTrue(h.read()['panel.warning_lamp']) h.step(10.0) self.assertAlmostEqual(h.kv, 20000.0, places=6) self.assertAlmostEqual(h.ma, 0.05, places=9) h.step(11.0) self.assertEqual(h.read()['generator.voltage_indicated_v'], 40000.0) self.assertAlmostEqual(h.read()['generator.current_indicated_a'], 0.05, places=9) h.invoke('generator.set_key', on=False) self.assertFalse(h.xray_on) self.assertEqual(h.kv, 0.0)
def test_chiller_needs_30_s_and_its_failure_trips_the_tube(self): h = configured() h.invoke('power.set', enabled=True) h.step(20.0) self.assertFalse(h.read()['chiller.flow_ok']) h.step(45.0) h.invoke('generator.set_key', on=True) h.invoke('generator.xray_on') h.step(25.0) h.invoke('fault.inject', fault='chiller_failure', active=True) h.step(1.0) r = h.read() self.assertFalse(r['generator.xray_on']) self.assertEqual(r['generator.fault_code'], 'COOLING_WATER_LOW') self.assertTrue(r['panel.standby_lamp']) rejected(h, 'generator.xray_on', 'GENERATOR_FAULT') rejected(h, 'generator.acknowledge', 'COOLING_WATER_LOW') h.invoke('fault.inject', fault='chiller_failure', active=False) h.invoke('generator.acknowledge') h.invoke('generator.xray_on') self.assertTrue(h.xray_on)
def test_emergency_stop_fails_the_acquisition_and_latches(self): h = ready() liquid(h, 'w') load(h, 'w') op = h.invoke('acquisition.start', exposure_s=100.0, frames=1)['operation_id'] h.step(10.0) h.invoke('generator.emergency_stop') rec = h.records[h.operations[op]['record_id']] self.assertEqual((rec['status'], rec['error_code']), ('failed', 'XRAY_OFF')) self.assertEqual(rec['segments'], []) self.assertFalse(h.read()['shutter.open']) rejected(h, 'generator.xray_on', 'EMERGENCY_STOP') rejected(h, 'generator.acknowledge', 'EMERGENCY_STOP') h.invoke('generator.release_emergency_stop') h.invoke('generator.acknowledge') h.invoke('generator.xray_on') self.assertTrue(h.xray_on)
def test_mains_fault_and_power_cycle(self): h = ready() h.invoke('plant.configure', room_k=295.15, mains_voltage_v=180.0, noise_seed=9) r = h.read() self.assertFalse(r['power.enabled']) self.assertEqual(r['system.error_code'], 'MAINS_FAULT') rejected(h, 'power.set', 'MAINS_OUT_OF_RANGE', enabled=True) h.invoke('plant.configure', room_k=295.15, mains_voltage_v=230.0, noise_seed=9) h.invoke('power.set', enabled=True) self.assertIsNone(h.read()['system.error_code'])
class VacuumDoorAndStage(unittest.TestCase): def test_pump_down_below_3_mbar_and_door_interlock(self): h = ready() liquid(h, 'w') h.invoke('chamber.set_door', open=True) h.invoke('sample.load', sample_id='w', holder='capillary_1mm') rejected(h, 'vacuum.set_pump', 'DOOR_OPEN', on=True) h.invoke('chamber.set_door', open=False) h.invoke('vacuum.set_pump', on=True) rejected(h, 'chamber.set_door', 'PUMP_ON', open=True) h.step(20.0) rejected(h, 'chamber.set_door', 'CHAMBER_UNDER_VACUUM', open=True) t_ready = rt.V_VAC_M3 / rt.S_PUMP_M3_S * math.log((rt.P_ATM - rt.P_ULT_PA) / (rt.VACUUM_READY_PA - rt.P_ULT_PA)) h.step(t_ready - 25.0) self.assertFalse(h.read()['vacuum.ready']) rejected(h, 'acquisition.start', 'VACUUM_NOT_READY', exposure_s=10.0, frames=1) h.step(10.0) self.assertTrue(h.read()['vacuum.ready']) self.assertLess(h.p, rt.VACUUM_READY_PA) h.invoke('vacuum.set_pump', on=False) h.step(60.0) self.assertGreater(h.p, rt.DOOR_OPEN_MIN_PA) h.invoke('chamber.set_door', open=True)
def test_air_measurement_is_allowed_but_air_scatters(self): h = ready() liquid(h, 'w') load(h, 'w', align=False) r_vac = h.records[acquire(h, 60.0)] h.invoke('vacuum.set_pump', on=False) h.step(90.0) r_air = h.records[acquire(h, 60.0)] mid = slice(200, 400) self.assertGreater(sum(r_air['segments'][0]['counts'][mid]), 1.5 * sum(r_vac['segments'][0]['counts'][mid])) self.assertLess(r_air['primary_beam_counts'], r_vac['primary_beam_counts'])
def test_stage_temperature_range_ramp_and_mount(self): h = ready() rejected(h, 'stage.set_temperature', 'TEMPERATURE_OUT_OF_RANGE', temperature_k=473.15) h.invoke('stage.set_temperature', temperature_k=253.15) h.step(600.0) self.assertAlmostEqual(h.t_stage, 253.15, delta=rt.TEMP_ACCURACY_K) h.invoke('chamber.set_door', open=True) rejected(h, 'stage.mount', 'STAGE_NOT_AMBIENT', stage_type='tcstage_extended') h.invoke('stage.set_temperature', temperature_k=295.15) h.step(600.0) h.invoke('stage.mount', stage_type='tcstage_extended') h.invoke('stage.set_temperature', temperature_k=773.15) h.step(60.0) self.assertAlmostEqual(h.t_stage, 295.15 + 10.0, delta=0.01) self.assertEqual(h.read()['stage.type'], 'tcstage_extended')
class SamplesAndHolders(unittest.TestCase): def test_sample_validation(self): h = configured() bad = [dict(form='solution', solvent='none'), dict(form='solid', thickness_m=None), dict(form='powder', components=[dict(template_id=LYS, concentration_kg_m3=5.0, model_parameters=None)])] base = dict(sample_id='x', form='solution', solvent='water', volume_m3=1e-7, thickness_m=None, components=[]) for b in bad: a = dict(base, **b) if a['form'] != 'solution': a['solvent'], a['volume_m3'] = 'none', 0.0 if 'thickness_m' not in b: a['thickness_m'] = 1e-3 try: h.invoke('sample.provide', **a) raise AssertionError(b) except rt.ActionRejected as exc: self.assertIn(str(exc), ('SAMPLE_FORM_INVALID', 'CONCENTRATION_REQUIRED'), b) rejected(h, 'sample.provide', 'CONCENTRATION_REQUIRED', **dict(base, components=[dict(template_id=LYS, concentration_kg_m3=None, model_parameters=None)])) rejected(h, 'sample.provide', 'UNKNOWN_TEMPLATE', **dict(base, components=[dict(template_id='nope', concentration_kg_m3=1.0, model_parameters=None)])) rejected(h, 'sample.provide', 'SAMPLE_FORM_INVALID', **dict(base, form='solid', solvent='none', volume_m3=0.0, thickness_m=2e-3, components=[dict(template_id=GC, concentration_kg_m3=None, model_parameters=None)])) rejected(h, 'sample.provide', 'MODEL_PARAMETERS_INVALID', **dict(base, form='solid', solvent='none', volume_m3=0.0, thickness_m=1e-3, components=[dict(template_id='model_lamellar', concentration_kg_m3=None, model_parameters=dict(d_spacing_m=1e-6))]))
def test_load_volumes_holders_and_empty_capillary(self): h = ready(xray=False) liquid(h, 'lys', [(LYS, 5.0)], volume=100e-9) solid(h, 'gc', GC, 1.055e-3) rejected(h, 'sample.load', 'DOOR_CLOSED', sample_id='lys', holder='capillary_1mm') h.invoke('chamber.set_door', open=True) rejected(h, 'sample.load', 'HOLDER_UNSUITABLE', sample_id='lys', holder='solid_holder') rejected(h, 'sample.load', 'HOLDER_UNSUITABLE', sample_id='gc', holder='capillary_1mm') h.invoke('sample.load', sample_id='lys', holder='capillary_1mm') self.assertAlmostEqual(h.samples['lys']['bench_volume_m3'], 40e-9, places=18) rejected(h, 'sample.load', 'HOLDER_OCCUPIED', sample_id='gc', holder='solid_holder') h.invoke('sample.unload') rejected(h, 'sample.load', 'INSUFFICIENT_VOLUME', sample_id='lys', holder='capillary_1mm') h.invoke('sample.load', sample_id='lys', holder='mu_cell') h.invoke('sample.unload') h.invoke('sample.load', sample_id=None, holder='capillary_1mm') self.assertIsNone(h.read()['holder.sample_id']) self.assertEqual(h.read()['holder.type'], 'capillary_1mm')
def test_truefocus_finds_the_capillary_axis(self): h = ready(seed=4) liquid(h, 'w') load(h, 'w', align=False) off = h.cap_offset self.assertGreater(abs(off), 0.05e-3) g0 = h._geometry() h.invoke('stage.auto_align') h.step(rt.ALIGN_S + 1.0) h.step(2.0) self.assertAlmostEqual(h.stage['y'], off, delta=4e-5) g1 = h._geometry() self.assertGreater(g1['scat_path_m'], g0['scat_path_m']) self.assertLess(g1['t_total'], g0['t_total']) h.invoke('stage.move', y_m=5e-3, z_m=0.0) h.step(6.0) self.assertEqual(h._geometry()['pos'], 'between') h.invoke('stage.auto_align') h.step(rt.ALIGN_S + 1.0) op = [o for o in h.operations.values() if o['kind'] == 'align'][-1] self.assertEqual(op.get('reason'), 'NO_CAPILLARY_FOUND')
class ScatteringPhysics(unittest.TestCase): def test_water_scale_reproduces_the_nist_glassy_carbon(self): """Absolute scale from water (compressibility) applied to a measured SRM 3600 coupon reproduces the certified curve (line collimation, desmeared).""" h = calibrated(seed=2) cal = water_calibration(h) solid(h, 'gc', GC, 1.055e-3) load(h, 'gc', holder='solid_holder') rg = acquire(h, 300.0) empty_beam(h) rb = acquire(h, 300.0) red = h.invoke('data.reduce', record_id=rg, background_record_id=rb, calibration_id=cal, thickness_m=1.055e-3, desmear=True) q, i, s = reduced_arrays(red) t = rt.template(GC) m = (q > 0.1) & (q < 2.0) ratio = i[m] / rt.srm3600_cm(t, q[m]) self.assertAlmostEqual(float(np.median(ratio)), 1.0, delta=0.08) CHECKS.append(dict(id='water_scale_vs_srm3600', status='passed', median_ratio=float(np.median(ratio))))
def test_lysozyme_rg_and_molecular_weight(self): h = calibrated(seed=3) cal = water_calibration(h) liquid(h, 'buf') liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'buf', temp=283.15) rb = acquire(h, 900.0) load(h, 'lys', temp=283.15) rl = acquire(h, 900.0) red = h.invoke('data.reduce', record_id=rl, background_record_id=rb, calibration_id=cal, thickness_m=1e-3, desmear=True) g = h.invoke('analysis.guinier', reduced_id=red['reduced_id'], qrg_max=1.3) rg_true = rt.template(LYS)['rg_template_nm'] * 1e-9 self.assertAlmostEqual(g['rg_m'], rg_true, delta=max(3 * g['rg_sigma_m'], 0.06 * rg_true)) mw = h.invoke('analysis.molecular_weight', reduced_id=red['reduced_id'], concentration_kg_m3=5.0, drho_m_m_kg=rt.DRHO_M_PROTEIN_M_KG) self.assertAlmostEqual(mw['molecular_weight_kg_mol'], 14.3, delta=0.15 * 14.3) smeared = h.invoke('data.reduce', record_id=rl, background_record_id=rb, calibration_id=cal, thickness_m=1e-3, desmear=False) g2 = h.invoke('analysis.guinier', reduced_id=smeared['reduced_id'], qrg_max=1.3) self.assertLess(g2['i0'], 0.85 * g['i0']) # line-collimation data must be desmeared for I(0) CHECKS.append(dict(id='lysozyme_rg_mw', status='passed', rg_nm=g['rg_m'] * 1e9, mw_kda=mw['molecular_weight_kg_mol']))
def test_concentration_effect_and_template_scale(self): t = rt.template(BSA) q = np.array([0.02, 0.1, 0.3]) lo = rt.component_cm(dict(kind='curve', template_id=BSA, concentration_mg_ml=2.0), q, 293.15, 0.0) / 2.0 hi = rt.component_cm(dict(kind='curve', template_id=BSA, concentration_mg_ml=50.0), q, 293.15, 0.0) / 50.0 self.assertLess(hi[0], 0.8 * lo[0]) # repulsive structure factor lowers I(0)/c at 50 mg/mL self.assertAlmostEqual(lo[0] / t['_i0c'], 1.0, delta=0.02) self.assertAlmostEqual(t['_i0c'] / (t['abs_scale']['mass_da'] * 1e-3), 0.00080, delta=0.00008) # I(0)/c per kDa of a protein
def test_silver_behenate_orders_and_q_calibration(self): h = calibrated(seed=6, collimation='point') self.assertAlmostEqual(h.sdd_cal, h.sdd_true, delta=0.002 * h.sdd_true) self.assertAlmostEqual(h.zero_cal, h.zero_true, delta=2.5e-5) red = h.invoke('data.reduce', record_id='sx-1', background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False) peaks = [p['q_per_m'] * 1e-9 for p in h.invoke('analysis.peaks', reduced_id=red['reduced_id'])['peaks']] for n in (1, 2, 3): qn = 2 * math.pi * n / 5.838 self.assertTrue(any(abs(p - qn) < 0.01 * qn + 0.02 for p in peaks), (n, peaks))
def test_silicon_111_ka_doublet_in_waxs(self): h = ready(seed=7) h.invoke('collimation.set_mode', mode='point') solid(h, 'si', 'silicon_powder', 0.3e-3, form='powder') load(h, 'si', holder='paste_cell') tt111 = 2 * math.asin(rt.mean_wavelength_m() / (2 * 0.3135601e-9)) arm = tt111 - math.atan(0.030 / rt.SDD_NOMINAL_M) op = h.invoke('acquisition.swaxs_scan', arm_angles_rad=[0.0, arm], exposure_s=60.0)['operation_id'] h.step(200.0) rec = h.records[h.operations[op]['record_id']] self.assertEqual(rec['status'], 'completed') seg = rec['segments'][1] c = np.asarray(seg['counts'], float) tt = np.asarray(seg['two_theta_rad']) l1, l2, _ = rt.ka_lines() t1 = 2 * math.asin(l1 / (2 * 0.3135601e-9)) t2 = 2 * math.asin(l2 / (2 * 0.3135601e-9)) j1 = int(np.argmax(np.where(np.abs(tt - t1) < math.radians(0.03), c, 0))) j2 = int(np.argmax(np.where(np.abs(tt - t2) < math.radians(0.03), c, 0))) mid = int((j1 + j2) / 2) self.assertGreater(c[j1], c[j2]) # Ka1 : Ka2 = 2 : 1 self.assertLess(c[mid], 0.95 * c[j2]) # the doublet is resolved (0.07 deg apart) self.assertGreater(abs(j2 - j1), 3)
def test_gold_rm8012_guinier_radius(self): t = rt.template(AU30) q = np.geomspace(0.02, 0.2, 200) i = rt.component_cm(dict(kind='sphere_model', template_id=AU30, concentration_mg_ml=0.048), q, 293.15, 0.0) m = q < 0.08 a, b = np.polyfit(q[m] ** 2, np.log(i[m]), 1) rg = math.sqrt(-3 * a) r = t['mean_diameter_nm'] / 2 z = 1 / t['schulz_rel_sigma'] ** 2 - 1 mom = lambda k: math.exp(math.lgamma(z + 1 + k) - math.lgamma(z + 1)) / (z + 1) ** k * r ** k # noqa: E731 rg_expected = math.sqrt(0.6 * mom(8) / mom(6)) self.assertAlmostEqual(rg, rg_expected, delta=0.05 * rg_expected)
def test_swaxs_reaches_60_degrees_and_the_water_halo(self): h = ready(seed=8) liquid(h, 'w') load(h, 'w') op = h.invoke('acquisition.swaxs_scan', arm_angles_rad=[0.0, 0.2, 0.4, 0.6, rt.ARM_MAX_RAD], exposure_s=60.0)['operation_id'] h.step(600.0) rec = h.records[h.operations[op]['record_id']] self.assertEqual(rec['status'], 'completed') tt_max = max(max(s['two_theta_rad']) for s in rec['segments']) q_max = max(max(s['q_per_m']) for s in rec['segments']) self.assertAlmostEqual(math.degrees(tt_max), 60.0, delta=0.6) self.assertGreater(q_max, 40.0e9) red = h.invoke('data.reduce', record_id=rec['record_id'], background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False) q, i, _ = reduced_arrays(red) self.assertGreater(np.interp(20.0, q, i), 1.8 * np.interp(8.0, q, i)) # water structure peak near 20 nm^-1
def test_q_min_and_resolution(self): h = calibrated(seed=9) liquid(h, 'w') load(h, 'w') r = acquire(h, 60.0) red = h.invoke('data.reduce', record_id=r, background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False) self.assertLess(red['q_min_valid_per_m'], 0.035e9) self.assertGreater(red['q_min_valid_per_m'], 0.015e9)
class FaultsAndStates(unittest.TestCase): def test_vacuum_leak_keeps_the_path_above_3_mbar(self): h = ready() h.invoke('fault.inject', fault='vacuum_leak', active=True) liquid(h, 'w') load(h, 'w', align=False, pump_s=600.0) self.assertFalse(h.read()['vacuum.ready']) rejected(h, 'acquisition.start', 'VACUUM_NOT_READY', exposure_s=10.0, frames=1)
def test_aged_tube_and_misaligned_beamstop(self): h = ready(seed=2) liquid(h, 'w') load(h, 'w') p0 = h.records[acquire(h, 30.0)]['primary_beam_counts'] h.invoke('fault.inject', fault='tube_aged', active=True) p1 = h.records[acquire(h, 30.0)]['primary_beam_counts'] self.assertAlmostEqual(p1 / p0, 0.6, delta=0.02) h.invoke('fault.inject', fault='beamstop_misaligned', active=True) op = h.invoke('acquisition.start', exposure_s=30.0, frames=1)['operation_id'] rec = h.records[h.operations[op]['record_id']] self.assertEqual((rec['status'], rec['error_code']), ('failed', 'DETECTOR_OVEREXPOSURE')) self.assertFalse(h.read()['shutter.open'])
def test_capillary_bubble_lowers_the_signal(self): h = ready(seed=2) liquid(h, 'w') load(h, 'w') g0 = h._geometry() h.invoke('fault.inject', fault='capillary_bubble', active=True) g1 = h._geometry() self.assertLess(g1['scat_path_m'], 0.8 * g0['scat_path_m']) # path x transmission: 0.4 d exp(-0.4 mu d) against d exp(-mu d) self.assertGreater(g1['t_total'], g0['t_total'])
def test_freezing_boiling_burst_and_aggregation(self): h = ready(seed=3) liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys', temp=258.15, pump_s=300.0) self.assertTrue(h.content['frozen']) h.invoke('stage.set_temperature', temperature_k=343.15) h.step(700.0) self.assertFalse(h.content['frozen']) a = h.content['agg'][LYS] self.assertGreater(a, 0.1) led0 = h.ledger() h.invoke('stage.set_temperature', temperature_k=373.15) h.step(400.0) r = h.read('evaluator') self.assertTrue(r['holder.broken']) self.assertEqual(r['system.error_code'], 'SAMPLE_BURST') led = h.ledger() self.assertAlmostEqual(led['liquid_residual_m3'], 0.0, delta=1e-18) self.assertAlmostEqual(led['solute_residual_kg'], 0.0, delta=1e-18) self.assertGreater(led['liquid_waste_m3'], led0['liquid_waste_m3']) rejected(h, 'system.acknowledge', 'HOLDER_BROKEN')
def test_aggregation_raises_the_apparent_rg(self): q = np.geomspace(0.02, 0.5, 100) base = dict(kind='curve', template_id=LYS, concentration_mg_ml=5.0) i0 = rt.component_cm(dict(base, aggregated_fraction=0.0), q, 293.15, 0.0) i1 = rt.component_cm(dict(base, aggregated_fraction=0.2), q, 293.15, 0.0) self.assertGreater(i1[0], 5 * i0[0])
class Autosampler(unittest.TestCase): def test_injection_carry_over_cleaning_and_conservation(self): h = ready(seed=2) liquid(h, 'bsa', [(BSA, 10.0)], volume=200e-9) liquid(h, 'buf', volume=300e-9) rejected(h, 'asx.load_well', 'ASX_DOOR_CLOSED', sample_id='bsa', well='AA01', volume_m3=100e-9) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='bsa', well='AA01', volume_m3=100e-9) h.invoke('asx.load_well', sample_id='buf', well='AA02', volume_m3=100e-9) rejected(h, 'asx.inject', 'ASX_DOOR_OPEN', well='AA01') h.invoke('asx.set_door', open=False) h.invoke('asx.inject', well='AA01') self.assertEqual(h.read()['asx.busy'], 'inject') h.step(60.0) self.assertIsNone(h.read()['asx.busy']) self.assertAlmostEqual(h.flow_cell['conc'][BSA], 10.0, places=9) h.invoke('asx.inject', well='AA02') h.step(60.0) self.assertAlmostEqual(h.flow_cell['conc'][BSA], 10.0 * rt.ASX_CARRY_OVER, places=9) h.invoke('asx.clean') h.step(150.0) self.assertEqual(h.read()['asx.flow_cell_state'], 'rinsed') h.invoke('asx.inject', well='AA02') h.step(60.0) self.assertAlmostEqual(h.flow_cell['conc'][BSA], 10.0 * rt.ASX_CARRY_OVER * rt.ASX_CARRY_OVER_CLEAN, delta=1e-12) led = h.ledger() self.assertAlmostEqual(led['liquid_residual_m3'], 0.0, delta=1e-18) self.assertAlmostEqual(led['solute_residual_kg'], 0.0, delta=1e-18)
def test_flow_cell_measurement_and_cancel(self): h = ready(seed=2) liquid(h, 'bsa', [(BSA, 10.0)], volume=200e-9) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='bsa', well='BA01', volume_m3=100e-9) h.invoke('asx.set_door', open=False) h.register_principal('e', 'evaluator') s = h.session('e') op = s.invoke(instance_id=h.instance_id, capability_id='asx.inject', arguments=dict(well='BA01'), request_id='i1')['operation_id'] h.step(12.0) s.cancel(op, 'c1') self.assertEqual(h.operations[op]['phase'], 'cancelled') led = h.ledger() self.assertAlmostEqual(led['liquid_residual_m3'], 0.0, delta=1e-18) h.invoke('asx.inject', well='BA01') h.step(60.0) h.invoke('stage.select_position', position='flow_cell') h.step(10.0) self.assertEqual(h._beam_content()[0], 'flow_cell') h.invoke('vacuum.set_pump', on=True) h.step(220.0) r = h.records[acquire(h, 60.0)] self.assertEqual(r['sample_label'], 'BA01') self.assertEqual(r['sample_position'], 'flow_cell')
class LedgersIsolationSessions(unittest.TestCase): def test_photon_ledger_closes_and_scattering_comes_from_attenuation(self): h = ready(seed=2) liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys') acquire(h, 120.0) led = h.ledger() self.assertAlmostEqual(led['photons_residual'], 0.0, delta=1e-6 * led['photons_incident']) self.assertLess(led['photons_scattered_detected'], led['photons_attenuated_sample'] + led['photons_attenuated_windows'] + led['photons_attenuated_air']) self.assertAlmostEqual(led['tube_on_time_s'], h.time_s - 61.0, delta=1e-6) self.assertGreater(led['tube_energy_j'], 0.9 * 40000.0 * 0.05 * (h.time_s - 61.0 - 20.0))
def test_two_instances_are_isolated(self): a, b = ready(seed=1), ready(seed=1) a.invoke('detector.move_arm', angle_rad=0.3) a.step(10.0) self.assertEqual(b.arm, 0.0) self.assertNotEqual(a.arm, b.arm)
def test_agent_does_not_see_truth(self): h = ready() liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys') rid = acquire(h, 30.0) h.register_principal('a', 'agent') s = h.session('a') obs = s.read(instance_id=h.instance_id)['observations'] self.assertFalse([k for k in obs if k.startswith('truth.')]) r = s.invoke(instance_id=h.instance_id, capability_id='acquisition.result', arguments=dict(record_id=rid), request_id='r1') text = json.dumps(r) self.assertNotIn('lysozyme', text.lower()) self.assertNotIn(LYS, text) r = s.invoke(instance_id=h.instance_id, capability_id='provenance.read', arguments={}, request_id='r2') self.assertEqual(r['error']['code'], 'ACCESS_DENIED') d = s.describe(instance_id=h.instance_id) self.assertFalse([k for k in d['state_slots'] if k.startswith('truth.')])
def test_records_and_control_belong_to_their_agent(self): h = ready() liquid(h, 'w') load(h, 'w') for p in ('a', 'b'): h.register_principal(p, 'agent') sa, sb = h.session('a'), h.session('b') r = sa.invoke(instance_id=h.instance_id, capability_id='acquisition.start', arguments=dict(exposure_s=30.0, frames=1), request_id='x1') self.assertEqual(r['status'], 'accepted') rb = sb.invoke(instance_id=h.instance_id, capability_id='detector.move_arm', arguments=dict(angle_rad=0.2), request_id='y1') self.assertEqual(rb['error']['code'], 'ACCESS_DENIED') self.assertTrue(sb.read(instance_id=h.instance_id)['observations']['acquisition.started_by_other_agent']['value']) h.step(40.0) rid = h.operations[r['operation_id']]['record_id'] self.assertEqual(sb.invoke(instance_id=h.instance_id, capability_id='acquisition.result', arguments=dict(record_id=rid), request_id='y2')['error']['code'], 'ACCESS_DENIED') self.assertEqual(sb.invoke(instance_id=h.instance_id, capability_id='data.reduce', arguments=dict(record_id=rid, background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False), request_id='y3')['error']['code'], 'ACCESS_DENIED') self.assertEqual(sa.read(instance_id=h.instance_id)['observations']['result.last_record_id']['value'], rid) again = sa.invoke(instance_id=h.instance_id, capability_id='acquisition.start', arguments=dict(exposure_s=30.0, frames=1), request_id='x1') self.assertEqual(again['operation_id'], r['operation_id']) conflict = sa.invoke(instance_id=h.instance_id, capability_id='acquisition.start', arguments=dict(exposure_s=31.0, frames=1), request_id='x1') self.assertEqual(conflict['error']['code'], 'REQUEST_CONFLICT')
def test_cancel_keeps_finished_segments_and_power_off_fails(self): h = ready() liquid(h, 'w') load(h, 'w') h.register_principal('a', 'agent') s = h.session('a') r = s.invoke(instance_id=h.instance_id, capability_id='acquisition.swaxs_scan', arguments=dict(arm_angles_rad=[0.0, 0.4], exposure_s=30.0), request_id='s1') h.step(45.0) s.cancel(r['operation_id'], 'c1') rec = h.records[h.operations[r['operation_id']]['record_id']] self.assertEqual((rec['status'], rec['error_code'], len(rec['segments'])), ('cancelled', 'USER_CANCEL', 1)) self.assertEqual(h.arm_target, h.arm) op = h.invoke('acquisition.start', exposure_s=60.0, frames=1) h.step(5.0) h.invoke('power.set', enabled=False) rec = h.records[h.operations[op['operation_id']]['record_id']] self.assertEqual((rec['status'], rec['error_code']), ('failed', 'POWER_OFF')) led = h.ledger() self.assertAlmostEqual(led['photons_residual'], 0.0, delta=1e-6 * led['photons_incident'])
def test_tray_well_xray_off_result_and_ledger_calls(self): """Capabilities otherwise reached only through helpers: tray temperature, well removal (liquid to waste), X-RAY OFF, data.result and ledger.read, each through invoke with its declared output.""" h = ready(seed=11) liquid(h, 'w', volume=300e-9) h.invoke('asx.set_tray_temperature', temperature_k=277.15) h.step(1500.0) self.assertAlmostEqual(h.read('evaluator')['truth.tray_temperature_k'], 277.15, delta=0.2) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='w', well='AB03', volume_m3=100e-9) waste0 = h.invoke('ledger.read')['liquid_waste_m3'] h.invoke('asx.unload_well', well='AB03') led = h.invoke('ledger.read') self.assertAlmostEqual(led['liquid_waste_m3'] - waste0, 100e-9, delta=1e-15) self.assertLessEqual(abs(led['liquid_residual_m3']), 1e-18) self.assertEqual(h.read('evaluator')['asx.wells'], {}) h.invoke('asx.set_door', open=False) load(h, 'w') rid = acquire(h, 30.0) red = h.invoke('data.reduce', record_id=rid, background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False) again = h.invoke('data.result', reduced_id=red['reduced_id']) self.assertEqual(again, red) h.invoke('generator.xray_off') v = h.read('evaluator') self.assertFalse(v['generator.xray_on']) self.assertEqual(v['truth.voltage_v'], 0.0) self.assertFalse(v['panel.warning_lamp'])
def test_queries_and_bookkeeping(self): h = ready() self.assertEqual(h.invoke('records.list'), dict(records=[], reduced=[], calibrations=[])) ev = h.invoke('events.read', since_s=0.0) self.assertTrue(any(e['code'] == 'SOFTWARE_READY' for e in ev['events'])) self.assertEqual(h.invoke('provenance.read')['templates'], []) self.assertEqual(h.invoke('sim.step', dt_s=1.0)['time_s'], h.time_s)
# ---------------------------------------------------------------- declared effects (scenario states for the effect discovery)def _scenario(name): if name == 'fresh': return rt.AntonpaarSaxspaceRuntime() if name == 'off': h = configured() liquid(h, 'w') return h if name == 'booting': h = configured() h.invoke('power.set', enabled=True) h.step(10.0) liquid(h, 'w') return h if name == 'ready': h = ready(xray=False) liquid(h, 'w') liquid(h, 'lys', [(LYS, 5.0)]) return h if name == 'xray_ramping': h = ready(xray=False) liquid(h, 'w') h.invoke('generator.xray_on') h.step(3.0) return h if name == 'door_open_loaded': h = ready() liquid(h, 'w') liquid(h, 'lys', [(LYS, 5.0)]) solid(h, 'gc', GC, 1.055e-3) h.invoke('chamber.set_door', open=True) h.invoke('sample.load', sample_id='w', holder='capillary_1mm') return h if name == 'pumping': h = ready() liquid(h, 'w') h.invoke('chamber.set_door', open=True) h.invoke('sample.load', sample_id='w', holder='capillary_1mm') h.invoke('chamber.set_door', open=False) h.invoke('vacuum.set_pump', on=True) h.step(20.0) return h if name == 'loaded_vacuum': h = ready() liquid(h, 'w') liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys', temp=283.15) acquire(h, 5.0) return h if name == 'measuring': h = _scenario('loaded_vacuum') h.invoke('acquisition.start', exposure_s=60.0, frames=1) h.step(2.3) return h if name == 'scanning': h = _scenario('loaded_vacuum') h.invoke('acquisition.swaxs_scan', arm_angles_rad=[0.0, 0.3], exposure_s=4.0) h.step(5.5) return h if name == 'aligning': h = ready() liquid(h, 'w') load(h, 'w', align=False) h.invoke('stage.auto_align') h.step(3.0) return h if name == 'asx_loaded': h = ready() liquid(h, 'w') liquid(h, 'bsa', [(BSA, 10.0)]) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='bsa', well='AA01', volume_m3=100e-9) h.invoke('asx.load_well', sample_id='w', well='AA02', volume_m3=100e-9) h.invoke('asx.set_door', open=False) h.invoke('asx.inject', well='AA01') h.step(60.0) return h if name == 'asx_injecting': h = _scenario('asx_loaded') h.invoke('asx.inject', well='AA02') h.step(7.5) return h if name == 'estop': h = ready() liquid(h, 'w') h.invoke('generator.emergency_stop') return h if name == 'cooling_fault': h = ready() h.invoke('fault.inject', fault='chiller_failure', active=True) h.step(1.0) return h if name == 'hot_protein': h = ready() liquid(h, 'lys', [(LYS, 5.0)]) load(h, 'lys', temp=353.15, pump_s=500.0) return h if name == 'burst': h = _scenario('hot_protein') h.invoke('stage.set_temperature', temperature_k=378.15) h.step(300.0) return h if name == 'burst_cleared': h = _scenario('burst') h.invoke('vacuum.set_pump', on=False) h.step(700.0) h.invoke('chamber.set_door', open=True) h.invoke('sample.unload') h.invoke('system.acknowledge') h.invoke('stage.set_temperature', temperature_k=295.15) return h if name == 'door_open_empty': h = ready() liquid(h, 'w') liquid(h, 'lys', [(LYS, 5.0)]) solid(h, 'gc', GC, 1.055e-3) h.invoke('chamber.set_door', open=True) return h if name == 'asx_door_open': h = ready() liquid(h, 'w') h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='w', well='AA02', volume_m3=100e-9) return h if name == 'estop_released': h = ready() h.invoke('generator.emergency_stop') h.invoke('generator.release_emergency_stop') return h if name == 'measuring_air': h = ready() liquid(h, 'lys', [(LYS, 5.0)]) h.invoke('chamber.set_door', open=True) h.invoke('sample.load', sample_id='lys', holder='capillary_1mm') h.invoke('chamber.set_door', open=False) h.invoke('acquisition.start', exposure_s=60.0, frames=1) h.step(10.0) return h if name == 'door_open_pump_on': h = configured() h.invoke('power.set', enabled=True) h.step(65.0) h.invoke('vacuum.set_pump', on=True) h.invoke('power.set', enabled=False) h.invoke('chamber.set_door', open=True) h.invoke('power.set', enabled=True) h.step(65.0) return h if name == 'extended_hot_setpoint': h = ready() h.invoke('chamber.set_door', open=True) h.invoke('stage.mount', stage_type='tcstage_extended') h.invoke('stage.set_temperature', temperature_k=873.15) return h if name == 'vented_closed': h = ready() liquid(h, 'w') load(h, 'w', align=False) h.invoke('vacuum.set_pump', on=False) h.step(80.0) return h if name == 'solid_open': h = ready() solid(h, 'gc', GC, 1.055e-3) h.invoke('chamber.set_door', open=True) h.invoke('sample.load', sample_id='gc', holder='solid_holder') return h if name == 'burst_open': h = _scenario('burst') h.invoke('vacuum.set_pump', on=False) h.step(700.0) h.invoke('chamber.set_door', open=True) return h if name == 'burst_unloaded': h = _scenario('burst_open') h.invoke('sample.unload') return h if name == 'mains_fault_restored': h = ready() h.invoke('plant.configure', **dict(rt.PLANT_EXAMPLE, mains_voltage_v=180.0)) h.invoke('plant.configure', **dict(rt.PLANT_EXAMPLE)) return h if name == 'cooling_fault_cleared': h = _scenario('cooling_fault') h.invoke('fault.inject', fault='chiller_failure', active=False) return h if name == 'faults_measuring': h = ready() liquid(h, 'w') load(h, 'w') for f in ('vacuum_leak', 'tube_aged', 'capillary_bubble'): h.invoke('fault.inject', fault=f, active=True) h.invoke('acquisition.start', exposure_s=60.0, frames=1) h.step(5.0) return h if name == 'estop_unpowered': h = configured() h.invoke('generator.emergency_stop') return h if name == 'agbe_measured': h = ready() solid(h, 'agbe', 'silver_behenate', 1e-3, form='powder') load(h, 'agbe', holder='paste_cell') acquire(h, 30.0) return h raise KeyError(name)
SCENARIOS = ['fresh', 'off', 'booting', 'ready', 'xray_ramping', 'door_open_loaded', 'door_open_empty', 'pumping', 'loaded_vacuum', 'measuring', 'scanning', 'aligning', 'asx_loaded', 'asx_door_open', 'asx_injecting', 'estop', 'estop_released', 'cooling_fault', 'hot_protein', 'burst', 'burst_cleared', 'agbe_measured', 'measuring_air', 'door_open_pump_on', 'extended_hot_setpoint', 'vented_closed', 'solid_open', 'burst_open', 'burst_unloaded', 'mains_fault_restored', 'cooling_fault_cleared', 'faults_measuring', 'estop_unpowered']STEP_DTS = (0.4, 1.0, 3.0, 15.0, 120.0)
def _variants(cap): V = { 'plant.configure': [dict(rt.PLANT_EXAMPLE), dict(room_k=300.15, mains_voltage_v=180.0, noise_seed=2)], 'sample.provide': [dict(rt.SAMPLE_EXAMPLE, sample_id='new')], 'fault.inject': [dict(fault=f, active=True) for f in rt.FAULTS] + [dict(fault=f, active=False) for f in rt.FAULTS], 'power.set': [dict(enabled=True), dict(enabled=False)], 'system.acknowledge': [{}], 'generator.set_key': [dict(on=True), dict(on=False)], 'generator.xray_on': [{}], 'generator.xray_off': [{}], 'generator.acknowledge': [{}], 'generator.emergency_stop': [{}], 'generator.release_emergency_stop': [{}], 'generator.set_power': [dict(voltage_v=30000.0, current_a=0.03), dict(voltage_v=40000.0, current_a=0.05)], 'vacuum.set_pump': [dict(on=True), dict(on=False)], 'chamber.set_door': [dict(open=True), dict(open=False)], 'stage.mount': [dict(stage_type='tcstage_extended'), dict(stage_type='tcstage_peltier')], 'sample.load': [dict(sample_id='lys', holder='capillary_1mm'), dict(sample_id=None, holder='capillary_1mm'), dict(sample_id='gc', holder='solid_holder')], 'sample.unload': [{}], 'stage.set_temperature': [dict(temperature_k=313.15), dict(temperature_k=253.15)], 'stage.move': [dict(y_m=2e-3, z_m=1e-3)], 'stage.select_position': [dict(position='flow_cell'), dict(position='capillary')], 'stage.auto_align': [{}], 'collimation.set_mode': [dict(mode='point'), dict(mode='line')], 'detector.move_arm': [dict(angle_rad=0.4), dict(angle_rad=0.0)], 'acquisition.start': [dict(exposure_s=2.0, frames=2)], 'acquisition.swaxs_scan': [dict(arm_angles_rad=[0.0, 0.2], exposure_s=2.0)], 'asx.set_door': [dict(open=True), dict(open=False)], 'asx.load_well': [dict(sample_id='w', well='AB01', volume_m3=50e-9)], 'asx.unload_well': [dict(well='AA02')], 'asx.set_tray_temperature': [dict(temperature_k=277.15)], 'asx.inject': [dict(well='AA02')], 'asx.clean': [{}], 'calibration.zero_angle': [dict(record_id='sx-1')], 'calibration.q_scale': [dict(record_id='sx-1', calibrant='silver_behenate')], 'sim.step': [dict(dt_s=0.5), dict(dt_s=30.0)], } return V.get(cap, [])
def _num(x): return isinstance(x, (int, float)) and not isinstance(x, bool)
def _flat(v, prefix=''): out = {} if isinstance(v, dict): for k, x in v.items(): out.update(_flat(x, f'{prefix}.{k}')) elif isinstance(v, list) and len(v) <= 64: for i, x in enumerate(v): out.update(_flat(x, f'{prefix}[{i}]')) else: out[prefix] = json.dumps(v, sort_keys=True, default=str) if isinstance(v, list) else v return out
def _changed(a, b, scale=None): """Relative comparison (no absolute floor).""" if _num(a) and _num(b): return abs(a - b) > 1e-9 * (max(abs(a), abs(b)) if scale is None else scale) + 1e-300 return a != b
def _step_differs(v1, a2, v0, b2): """Does the step change the value differently with the call (v1 -> a2) than without it (v0 -> b2)? (leaf-wise, numeric increments)""" f1, fa, f0, fb = _flat(v1), _flat(a2), _flat(v0), _flat(b2) for leaf in set(f1) | set(fa) | set(f0) | set(fb): x1, xa, x0, xb = (f.get(leaf, '<absent>') for f in (f1, fa, f0, fb)) ca, cb = _changed(x1, xa), _changed(x0, xb) if not (ca or cb): continue if ca and cb and all(_num(x) for x in (x1, xa, x0, xb)) and not _changed(xa - x1, xb - x0, max(abs(x1), abs(xa), abs(x0), abs(xb))): continue if ca and cb and (x1, xa) == (x0, xb): continue return True return False
class ReviewRound1Regressions(unittest.TestCase): """Regression tests for the findings of the first independent runtime review (F01-F19)."""
def _session_invoke(self, h, principal, cap, args, rid): return h.session(principal).invoke(instance_id=h.instance_id, capability_id=cap, arguments=args, request_id=rid)
def test_f01_agent_events_hide_faults_and_the_frozen_state(self): h = ready(seed=21) h.register_principal('ag', 'agent') h.register_principal('ev', 'evaluator') h.invoke('fault.inject', fault='tube_aged', active=True) liquid(h, 's1') load(h, 's1', align=False) h.invoke('stage.set_temperature', temperature_k=253.15) h.step(900.0) self.assertTrue(h.read('evaluator')['truth.samples']['holder']['frozen']) ag = {e['code'] for e in self._session_invoke(h, 'ag', 'events.read', dict(since_s=0.0), 'e1')['result']['events']} ev = {e['code'] for e in self._session_invoke(h, 'ev', 'events.read', dict(since_s=0.0), 'e2')['result']['events']} self.assertFalse([c for c in ag if c.startswith('FAULT_')] + [c for c in ag if c == 'SAMPLE_FROZEN']) self.assertIn('FAULT_TUBE_AGED', ev) self.assertIn('SAMPLE_FROZEN', ev)
def test_f02_records_do_not_reveal_the_composition(self): h = ready(seed=22) liquid(h, 'buf') liquid(h, 'mix', [(LYS, 5.0), (BSA, 2.0)]) rs = [] for sid in ('buf', 'mix'): load(h, sid) rs.append(h.records[acquire(h, 10.0)]['template_source']) self.assertEqual(rs[0], rs[1]) self.assertEqual(set(rs[0]), {'library', 'note_zh'})
def test_f03_f04_ledger_split_by_optical_depth_and_real_closure(self): h = ready(seed=23) load(h, None) rid = acquire(h, 60.0) led = h.invoke('ledger.read') self.assertEqual(led['photons_attenuated_sample'], 0.0) # an empty capillary absorbs only in its quartz walls self.assertGreater(led['photons_attenuated_windows'], 0.0) self.assertLess(abs(led['photons_residual']), 1e-9 * led['photons_incident']) self.assertGreater(led['photons_direct_off_detector'], 0.0) # 20 mm line beam vs 8 mm strips self.assertGreater(led['photons_direct_stopped'], led['photons_direct_detected']) g = h._geometry() liquid(h, 'w') load(h, 'w') g = h._geometry() # 1 mm water in a 10 um quartz capillary: windows take ~14 % of the absorbed share at the beam centre, not a fixed 35 % share = g['att_window'] / (g['att_window'] + g['att_sample']) self.assertLess(share, 0.25) self.assertGreater(share, 0.05) self.assertTrue(rid)
def test_f05_water_calibration_in_air_equals_vacuum(self): """Air and collimator scattering pass through the sample: after normalising by the transmitted primary beam and subtracting the empty capillary, the water scale measured in air equals the one measured under vacuum.""" def measure(h, sid, vac): if h.pump_on: h.invoke('vacuum.set_pump', on=False) h.step(80.0) if not h.door_open: h.invoke('chamber.set_door', open=True) if h.holder is not None: h.invoke('sample.unload') h.invoke('sample.load', sample_id=sid, holder='capillary_1mm') h.invoke('chamber.set_door', open=False) if vac: h.invoke('vacuum.set_pump', on=True) h.step(220.0) h.invoke('stage.auto_align') h.step(rt.ALIGN_S + 4.0) return acquire(h, 600.0) f = {} for vac in (True, False): h = ready(seed=24) liquid(h, 'w') rw = measure(h, 'w', vac) re_ = measure(h, None, vac) f[vac] = h.invoke('calibration.absolute', record_id=rw, background_record_id=re_, standard='water', thickness_m=1e-3)['factor'] self.assertAlmostEqual(f[False] / f[True], 1.0, delta=0.05)
def test_f06_primary_normalisation_does_not_depend_on_the_zero_calibration(self): h = ready(seed=1) load(h, None) r_empty = acquire(h, 300.0) liquid(h, 'w') load(h, 'w') r_w = acquire(h, 300.0) before = h.invoke('calibration.absolute', record_id=r_w, background_record_id=r_empty, standard='water', thickness_m=1e-3)['factor'] h.invoke('calibration.zero_angle', record_id=r_empty) after = h.invoke('calibration.absolute', record_id=r_w, background_record_id=r_empty, standard='water', thickness_m=1e-3)['factor'] self.assertAlmostEqual(after / before, 1.0, delta=0.02)
def test_f07_overexposure_during_an_exposure_fails_the_acquisition(self): h = ready(seed=25) liquid(h, 'w') load(h, 'w') op = h.invoke('acquisition.start', exposure_s=300.0, frames=1)['operation_id'] h.step(10.0) h.invoke('fault.inject', fault='beamstop_misaligned', active=True) rid = h.operations[op]['record_id'] self.assertEqual(h.records[rid]['status'], 'failed') self.assertEqual(h.records[rid]['error_code'], 'DETECTOR_OVEREXPOSURE') self.assertFalse(h.read('evaluator')['shutter.open'])
def test_f08_model_spheres_carry_over_one_percent(self): h = ready(seed=26) sph = dict(radius_m=10e-9, rel_sigma=0.1, volume_fraction=0.01, material='silica', matrix='water') h.invoke('sample.provide', sample_id='sph', form='dispersion', solvent='water', volume_m3=200e-9, thickness_m=None, components=[dict(template_id='model_spheres', concentration_kg_m3=None, model_parameters=sph)]) liquid(h, 'buf', volume=200e-9) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='sph', well='AA01', volume_m3=100e-9) h.invoke('asx.load_well', sample_id='buf', well='AA02', volume_m3=100e-9) h.invoke('asx.set_door', open=False) for well in ('AA01', 'AA02'): h.invoke('asx.inject', well=well) h.step(60.0) comps = [c for c in h.flow_cell['components'] if c['kind'] == 'model_spheres'] self.assertEqual(len(comps), 1) self.assertAlmostEqual(comps[0]['parameters']['volume_fraction'], 0.01 * rt.ASX_CARRY_OVER, delta=1e-12)
def test_f09_stage_mount_on_step_effects_are_declared(self): h = ready(seed=27) h.invoke('chamber.set_door', open=True) h.invoke('stage.mount', stage_type='tcstage_extended') h.invoke('stage.set_temperature', temperature_k=773.15) a, b = copy.deepcopy(h), copy.deepcopy(h) a.invoke('stage.mount', stage_type='tcstage_peltier') a.step(1500.0) b.step(1500.0) va, vb = a.read('evaluator'), b.read('evaluator') changed = {k for k in ('truth.stage_temperature_k', 'stage.temperature_indicated_k') if va[k] != vb[k]} self.assertEqual(changed, {'truth.stage_temperature_k', 'stage.temperature_indicated_k'}) self.assertLessEqual(changed, set(rt.ON_STEP['stage.mount']))
def test_f13_emergency_stop_pressed_unpowered_needs_standby(self): h = configured(seed=28) h.invoke('generator.emergency_stop') h.invoke('power.set', enabled=True) h.step(61.0) h.invoke('generator.set_key', on=True) h.invoke('generator.release_emergency_stop') self.assertTrue(rejected(h, 'generator.xray_on', 'GENERATOR_FAULT')) h.invoke('generator.acknowledge') h.invoke('generator.xray_on')
def test_f14_zero_angle_from_silver_behenate_is_unbiased(self): h = ready(seed=29) solid(h, 'agbe', 'silver_behenate', 1e-3, form='powder') load(h, 'agbe', holder='paste_cell') z = h.invoke('calibration.zero_angle', record_id=acquire(h, 60.0))['zero_m'] self.assertLess(abs(z - h.zero_true), 3e-6)
def test_f17_point_collimation_desmear_and_molecular_weight(self): h = ready(seed=30) h.invoke('collimation.set_mode', mode='point') liquid(h, 'bsa', [(BSA, 5.0)]) liquid(h, 'buf') load(h, 'bsa') rs = acquire(h, 1800.0) load(h, 'buf') rb = acquire(h, 1800.0) liquid(h, 'water_std') load(h, 'water_std') rw = acquire(h, 1800.0) load(h, None) re_ = acquire(h, 1800.0) cal = h.invoke('calibration.absolute', record_id=rw, background_record_id=re_, standard='water', thickness_m=1e-3)['calibration_id'] smeared = h.invoke('data.reduce', record_id=rs, background_record_id=rb, calibration_id=cal, thickness_m=1e-3, desmear=False) self.assertTrue(rejected(h, 'analysis.molecular_weight', 'DESMEAR_REQUIRED', reduced_id=smeared['reduced_id'], concentration_kg_m3=5.0, drho_m_m_kg=rt.DRHO_M_PROTEIN_M_KG)) red = h.invoke('data.reduce', record_id=rs, background_record_id=rb, calibration_id=cal, thickness_m=1e-3, desmear=True) mw = h.invoke('analysis.molecular_weight', reduced_id=red['reduced_id'], concentration_kg_m3=5.0, drho_m_m_kg=rt.DRHO_M_PROTEIN_M_KG) m_template = rt.template(BSA)['abs_scale']['mass_da'] / 1000.0 self.assertAlmostEqual(mw['molecular_weight_kg_mol'] / m_template, 1.0, delta=0.12)
def test_f18_truefocus_finds_the_empty_flow_cell(self): h = ready(seed=31) h.invoke('stage.select_position', position='flow_cell') h.step(10.0) op = h.invoke('stage.auto_align')['operation_id'] h.step(rt.ALIGN_S + 4.0) self.assertEqual(h.operations[op]['phase'], 'completed') self.assertIsNone(h.operations[op].get('reason')) self.assertAlmostEqual(h.stage['y'], rt.FLOW_CELL_Y_M + h.fc_offset, delta=3e-5)
def test_f19_room_temperature_change_is_not_cache_dependent(self): h = ready(seed=32) load(h, None) h.invoke('vacuum.set_pump', on=False) h.step(80.0) h.invoke('acquisition.start', exposure_s=60.0, frames=1) h.step(20.0) a, b = copy.deepcopy(h), copy.deepcopy(h) for x in (a, b): x.invoke('plant.configure', room_k=305.15, mains_voltage_v=230.0, noise_seed=1) b.invoke('fault.inject', fault='chiller_failure', active=False) # a no-op call that used to clear the rate cache a.step(45.0) b.step(45.0) self.assertEqual(a.records['sx-1']['segments'][0]['counts'], b.records['sx-1']['segments'][0]['counts'])
class ReviewRound2Regressions(unittest.TestCase): """Regression tests for the second independent runtime review (F20-F22)."""
def _spheres_solid(self, h, sid, radius, phi, thick): h.invoke('sample.provide', sample_id=sid, form='solid', solvent='none', volume_m3=0.0, thickness_m=thick, components=[dict(template_id='model_spheres', concentration_kg_m3=None, model_parameters=dict(radius_m=radius, rel_sigma=0.1, volume_fraction=phi, material='silica', matrix='polystyrene'))])
def test_f20_primary_peak_is_found_or_refused_never_misplaced(self): for seed, radius, phi, thick in ((51, 50e-9, 0.02, 1e-3), (52, 10e-9, 0.3, 2e-3)): h = ready(seed=seed) self._spheres_solid(h, 's', radius, phi, thick) load(h, 's', holder='solid_holder') rid = acquire(h, 30.0) pc = h.records[rid]['primary_beam_counts'] g = h._geometry() expected = h._flux() * g['t_total'] * rt.detector_efficiency() * rt.STRIP_LENGTH_M / rt.LINE_LENGTH_M * rt.BEAMSTOP_T * 30.0 self.assertIsNotNone(pc) # the attenuated peak is beam-shaped even when weaker than the scattering outside self.assertAlmostEqual(pc / expected, 1.0, delta=0.05) z = h.invoke('calibration.zero_angle', record_id=rid)['zero_m'] self.assertLess(abs(z - h.zero_true), 10e-6)
def test_f20_ordinary_samples_keep_their_primary_beam(self): h = ready(seed=54) solid(h, 'gc', GC, 1.055e-3) load(h, 'gc', holder='solid_holder') rid = acquire(h, 60.0) self.assertIsNotNone(h.records[rid]['primary_beam_counts']) z = h.invoke('calibration.zero_angle', record_id=rid)['zero_m'] self.assertLess(abs(z - h.zero_true), 5e-6)
def test_f23_zero_beyond_three_sigma_is_still_found(self): """Instruments whose true zero lies 0.15-0.21 mm from nominal (seeds 1377 and 129 of the review) still find their primary beam before the first zero calibration, and after it the normalisation uses the calibrated zero.""" for seed in (1377, 129): h = ready(seed=seed) self.assertGreater(abs(h.zero_true), 0.14e-3) empty_beam(h) rid = acquire(h, 60.0) self.assertIsNotNone(h.records[rid]['primary_beam_counts']) z = h.invoke('calibration.zero_angle', record_id=rid)['zero_m'] self.assertLess(abs(z - h.zero_true), 5e-6) h.invoke('data.reduce', record_id=rid, background_record_id=None, calibration_id=None, thickness_m=1e-3, desmear=False)
def test_f24_far_zero_with_steep_scatterers(self): """Far-zero instruments before the zero calibration with steeply scattering solids (review round 4): the attenuated primary, not a scatter maximum near the hint, is found.""" for seed, radius, phi in ((129, 100e-9, 0.003), (129, 80e-9, 0.01), (1377, 100e-9, 0.003)): h = ready(seed=seed) self._spheres_solid(h, 's', radius, phi, 1e-3) load(h, 's', holder='solid_holder') rid = acquire(h, 30.0) g = h._geometry() expected = h._flux() * g['t_total'] * rt.detector_efficiency() * rt.STRIP_LENGTH_M / rt.LINE_LENGTH_M * rt.BEAMSTOP_T * 30.0 self.assertAlmostEqual(h.records[rid]['primary_beam_counts'] / expected, 1.0, delta=0.05) z = h.invoke('calibration.zero_angle', record_id=rid)['zero_m'] self.assertLess(abs(z - h.zero_true), 5e-6)
def test_f21_alignment_is_protected_against_overexposure(self): h = ready(seed=53) liquid(h, 'l', [(LYS, 5.0)]) load(h, 'l', align=False) h.invoke('fault.inject', fault='beamstop_misaligned', active=True) op = h.invoke('stage.auto_align')['operation_id'] h.step(2.0) self.assertEqual(h.operations[op]['phase'], 'failed') self.assertEqual(h.operations[op]['reason'], 'DETECTOR_OVEREXPOSURE') self.assertFalse(h.read('evaluator')['shutter.open'])
def test_f22_model_spheres_leave_the_rinse_residue(self): h = ready(seed=55) h.invoke('sample.provide', sample_id='sph', form='dispersion', solvent='water', volume_m3=200e-9, thickness_m=None, components=[dict(template_id='model_spheres', concentration_kg_m3=None, model_parameters=dict(radius_m=10e-9, rel_sigma=0.1, volume_fraction=0.01, material='silica', matrix='water'))]) liquid(h, 'buf', volume=200e-9) h.invoke('asx.set_door', open=True) h.invoke('asx.load_well', sample_id='sph', well='AA01', volume_m3=50e-9) h.invoke('asx.load_well', sample_id='buf', well='AA02', volume_m3=50e-9) h.invoke('asx.set_door', open=False) h.invoke('asx.inject', well='AA01') h.step(60.0) h.invoke('asx.clean') h.step(130.0) h.invoke('asx.inject', well='AA02') h.step(60.0) comps = [c for c in h.flow_cell['components'] if c['kind'] == 'model_spheres'] self.assertEqual(len(comps), 1) self.assertAlmostEqual(comps[0]['parameters']['volume_fraction'], 0.01 * rt.ASX_CARRY_OVER_CLEAN, delta=1e-15)
class DeclaredEffects(unittest.TestCase): def test_on_step_effects_cover_what_the_process_changes(self): """For every capability accepted in any scenario state: the slots it changes at once are declared effects, the slots whose change during the following step differs from an identical run without the call are declared on_step effects, and the step itself only changes slots declared as on_step effects of sim.step (noise-free and noisy runs; both runs draw identical noise during the step).""" missing_imm, missing_step = {}, {} states = {n: _scenario(n) for n in SCENARIOS} for noisy in (False, True): for n, S in states.items(): for i, name in enumerate(RNGS): setattr(S, name, random.Random(7 + i) if noisy else QuietRng()) for cap in rt.CAPS: if cap in rt.UNSUPPORTED or rt.CAPS[cap]['kind'] in ('query', 'analysis'): continue for sname, S in states.items(): for args in _variants(cap): A = copy.deepcopy(S) v0 = A.read('evaluator') try: _orig_invoke(A, cap, **args) except rt.ActionRejected: continue v1 = A.read('evaluator') if cap == 'sim.step': for k in v0: if _changed(v0[k], v1[k]) and k not in rt.ON_STEP['sim.step'] + rt.EFFECTS['sim.step']: missing_step.setdefault('sim.step', set()).add(k) continue for k in v0: if json.dumps(v0[k], sort_keys=True, default=str) != json.dumps(v1[k], sort_keys=True, default=str) and _changed(v0[k], v1[k]) \ and k not in rt.EFFECTS[cap]: missing_imm.setdefault(cap, set()).add(k) for dt in STEP_DTS: A2, B2 = copy.deepcopy(A), copy.deepcopy(S) for name in RNGS: setattr(A2, name, copy.deepcopy(getattr(B2, name))) A2.step(dt) B2.step(dt) a2, b2 = A2.read('evaluator'), B2.read('evaluator') for k in v0: if k not in rt.ON_STEP.get(cap, []) and _step_differs(v1[k], a2[k], v0[k], b2[k]): missing_step.setdefault(cap, set()).add(k) if k not in rt.ON_STEP['sim.step'] + ['clock.time_s'] and _changed(v0[k], b2[k]): missing_step.setdefault('sim.step', set()).add(k) self.assertEqual(missing_imm, {}) self.assertEqual(missing_step, {}) self.assertFalse([s for v in rt.ON_STEP.values() for s in v if rt.SLOTS[s]['origin'] == 'setpoint'])
def test_units_and_sampling(self): meta = _meta() si = {'1', 's', 'm', 'rad', 'Pa', 'V', 'A', 'K', 'J', 'W', 'kg', 'm^3', '1/s', 'Pa*m^3/s', 'm^3/s', 'm/s', 'V/s', 'A/s', 'K/s', 'rad/s', '1/m', 'kg/m^3', 'kg/mol', 'm^2/kg', 'm/kg', '1/sr'} units = {v['unit'] for v in meta['state_slots'].values()} for mech in meta['mechanisms'].values(): units |= {p_['unit'] for p_ in mech['parameters'].values()} self.assertEqual(units - si, set(), units - si) h = ready() h.register_principal('e', 'evaluator') h.invoke('detector.move_arm', angle_rad=0.3) h.step(0.5) obs = h.session('e').read(instance_id=h.instance_id)['observations'] self.assertIsNone(obs['detector.arm_indicated_rad']['sample_window_s']) self.assertGreater(obs['detector.arm_indicated_rad']['value'], 0.0) self.assertEqual(obs['vacuum.pressure_indicated_pa']['sample_window_s'], rt.CYCLE_S) g0 = h.read()['vacuum.pressure_indicated_pa'] h.step(0.2) self.assertEqual(h.read()['vacuum.pressure_indicated_pa'], g0)
if __name__ == '__main__': unittest.main()LICENSES/Biopython.rstAdded+68
LICENSES/COGNI-CC0-1.0.txtAdded+121
LICENSES/CoolProp-MIT.txtAdded+21
LICENSES/KiMoPack-GPL-3.0.txtAdded+674
LICENSES/OPERA-MIT.txtAdded+21
LICENSES/XrayDB.txtAdded+18
LICENSES/chemicals-MIT.txtAdded+21
LICENSES/openpoly-MIT.txtAdded+21
LICENSES/srsinst-rga-MIT.txtAdded+21
LICENSES/teMatDb-MIT.txtAdded+20
catalog/catalog.csvAdded+199
catalog/catalog.jsonAdded
examples/quickstart_fume_hood.pyAdded+48
outputs/expansion_batch03/t4_measure/antonpaar_litesizerdia/example_setup.pyAdded+14
outputs/expansion_batch03/t4_measure/antonpaar_litesizerdls/example_setup.pyAdded+19
outputs/expansion_batch03/t4_measure/antonpaar_poremaster60/example_setup.pyAdded+37
outputs/expansion_batch03/t4_measure/antonpaar_psa1190/example_setup.pyAdded+26
outputs/expansion_batch03/t4_measure/biolin_sigma700/example_setup.pyAdded+10
outputs/expansion_batch03/t4_measure/biolin_thetaflex/example_setup.pyAdded+25
outputs/expansion_batch03/t4_measure/biorad_miniprotean/migration_chart_digitized.jsonAdded+741
outputs/expansion_batch04/t1_thermal/ametek_oxtran/independent_permeation_source_validation.jsonAdded+79
outputs/expansion_batch04/t1_thermal/ametek_oxtran/interface_definition.pyAdded+161
outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/interface_definition.pyAdded+177
outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/source_cache/rc1e_curves_digitized.jsonAdded
outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/template_validation.jsonAdded
outputs/expansion_batch04/t1_thermal/mt_rc1mxhfcal/thermal_calibration.jsonAdded+213
outputs/expansion_batch04/t1_thermal/netzsch_mmc315/interface_definition.pyAdded+92
outputs/expansion_batch04/t1_thermal/netzsch_mmc315/template_validation.jsonAdded+3201
outputs/expansion_batch04/t1_thermal/zwick_mflow/interface_definition.pyAdded+142
outputs/expansion_batch04/t3_analytical/evident_bx53p/source_cache/cvrl_ciexyz31_1.csvAdded+471
outputs/expansion_batch04/t3_analytical/jeol_jsmit200/optics_fit.jsonAdded+87
scripts/asset_runtime/ametek_oxtran.pyAdded
scripts/asset_runtime/lakeshore_8604vsm.pyAdded+518
scripts/asset_runtime/lakeshore_measurereadym91.pyAdded+495
scripts/asset_runtime/novocontrol_alphat.pyAdded+431
scripts/asset_runtime/shimadzu_ags10knxd.pyAdded+494
scripts/asset_runtime/signatone_quadpro2.pyAdded+543
scripts/asset_runtime/zwick_hit5p.pyAdded+418
scripts/asset_runtime/zwick_mflow.pyAdded+1350
tests/conftest.pyAdded+24
tests/test_asset_ametek_oxtran.pyAdded+916
tests/test_asset_antonpaar_hit300.pyAdded+179
tests/test_asset_antonpaar_mcr503.pyAdded+161
tests/test_asset_antonpaar_rst300.pyAdded+209
tests/test_asset_antonpaar_saxspace.pyAdded+1547
tests/test_asset_antonpaar_trb.pyAdded
tests/test_asset_bd_facsariaiii.pyAdded
tests/test_asset_binder_fd056.pyAdded
tests/test_asset_binder_kbf115.pyAdded
tests/test_asset_biolin_mediuml.pyAdded