Skip to content

Commit

Permalink
fixed cross chekcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Nov 10, 2023
1 parent 2ad2296 commit 4f2c14e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[![Run PkgEval](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml)
[![Coverage](https://codecov.io/gh/ThummeTo/FMI.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ThummeTo/FMI.jl)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![FMI Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/FMI)](https://pkgs.genieframework.com?packages=FMI).
[![FMI Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/FMI)](https://pkgs.genieframework.com?packages=FMI)


## How can I use FMI.jl?
Expand Down Expand Up @@ -89,7 +89,7 @@ To keep dependencies nice and clean, the original package [*FMI.jl*](https://git
- [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl): C-code wrapper for the FMI-standard
- [*FMISensitivity.jl*](https://github.com/ThummeTo/FMISensitivity.jl): Static and dynamic sensitivities over FMUs
- [*FMIBuild.jl*](https://github.com/ThummeTo/FMIBuild.jl): Compiler/Compilation dependencies for FMIExport.jl
- [*FMIFlux.jl*](https://github.com/ThummeTo/FMIFlux.jl): Machine Learning with FMUs (differentiation over FMUs)
- [*FMIFlux.jl*](https://github.com/ThummeTo/FMIFlux.jl): Machine Learning with FMUs
- [*FMIZoo.jl*](https://github.com/ThummeTo/FMIZoo.jl): A collection of testing and example FMUs

## What Platforms are supported?
Expand Down
1 change: 1 addition & 0 deletions cross_checks/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
FMI = "14a09403-18e3-468f-ad8a-74f8dda2d9ac"
Expand Down
2 changes: 2 additions & 0 deletions cross_checks/cross_check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ using DelimitedFiles
using Tables
using Statistics

import Base64

include("cross_check_config.jl")
include("cross_check_lib.jl")

Expand Down
6 changes: 6 additions & 0 deletions test/FMI2/sim_ME.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ dataLength = length(solution.states.u)
@test solution.values.t[1] == t_start
@test solution.values.t[end] == t_stop

# value/state getters
@test solution.states.t == fmi2GetSolutionTime(solution)
@test collect(s[1] for s in solution.values.saveval) == fmi2GetSolutionValue(solution, 1; isIndex=true)
@test collect(u[1] for u in solution.states.u ) == fmi2GetSolutionState(solution, 1; isIndex=true)
@test isapprox(fmi2GetSolutionState(solution, 2; isIndex=true), fmi2GetSolutionDerivative(solution, 1; isIndex=true); atol=1e-4)

# reference values from Simulation in Dymola2020x (Dassl)
@test sum(abs.(solution.states.u[1] - [0.5, 0.0])) < 1e-4
@test sum(abs.(solution.states.u[end] - [1.05444, 1e-10])) < 0.01
Expand Down

0 comments on commit 4f2c14e

Please sign in to comment.