Releases: Hopsan/hopsan
Releases · Hopsan/hopsan
2.23.1
Enhancements
- When exporting log data to Matlab, the generation is now only appended to the variable names when there are multiple generations of the same variable in the export data
- Time measurement tool now scales the measured time consistently when changing from component-wise and type-wise view
Bug
- Fix offset in value references of exported FMUs with FMI 3
- The SymHop expression "1*1" is now correctly simplified to "1" (used to be "")
General
- Change from QtWebKit to QtWebEngine for displaying HTML on Linux (Windows still uses QtWebKit)
2.23.0
New Features
- Support for DCP (Distributed Co-simulation Protocol) standard, both in slave and master mode
- Re-enabled support for saving and loading plot window specifications to XML
Enhancements
-
Graphical Interface
- Optimization log files now store start time and duration
- System parameters are now applied before simulation even if they are still being edited
- Improved scaling on high DPI monitors
- Plot markers are now automatically updated when changing plot data
-
FMI import/export:
- Added unit definitions, model structure and time variable to exported FMUs
- Added FMI compatibility information
- Option to reload FMU using right-click menu
- Option to reinstantiate an FMU before each simulation
- Imported FMUs now read variable units from specifications
- Support for port names for power ports in FMIWrapperQ component
- FMIWrapepr components now supports (and ignores) whitespaces in the "portspec" parameter
- Exported FMUs now use flat variable naming convention
- Dangling connectors are now remembered and reconnected when changing FMIWrapper path or portspecs
-
HCOM scripting:
- New function: count(typename): count number of components with specified type name that exists in the model
- New function: log10(x) - 10-base logarithm function
- New command: clear: Clears the terminal output
- New command: pwvl: Toggle plot window variable list visibility
- New command: pwcc: Toggle plot window curve controls visibility
- New command: pwle: Toggle plot window legends visibility
Bugs
- Fix lost mapping when pasting components with system parameters
- Fix crash when calling HCOM exists() with no model open
- Remove annoying debug outputs to the terminal
- HCOM commands with string arguments can now handle semicolons
Release 2.22.1
Bug Fixes
- HopsanGUI
- Fixed problem with workspace size
- Animation mode now keeps worksapce size
- FMIWrapper components now appear at the center of the model
- "adco" command in terminal will now add components on correct place
- Fixed minor problems with splash screen
- Model can no longer be edited during simulation
Release 2.22.0
Enhancements
-
HopsanGUI
- Option to log results during simulation (experimental)
- Image widgets
- Changes to simulation time settings are now supported by undo/redo
- New HCOM command: "dipa" - display components
- Weird multicache error was clarified and converted to a warning
- Existing log data is now automatically removed at startup if no other instance of Hopsan is running
- "log2" function is now supported by HCOM/SymHop
- New HCOM function: "r2d()" - radians to degrees
- New HCOM function: "d2r()" - degrees to radians
- FMIWrappers are now automatically renamed to the FMU base file name
- Real variable names are now used in Matlab (.m) export
- Variable aliases are now shown in Bode plot dialog
- Local HCOM functions can now be used in temporary expression evaluations
-
HopsanGenerator
- Timestep can now be controlled in exported FMUs
- Recompilation of a library can now be prevented with XML flag
Bug Fixes
- HopsanCore
- Fixed crash in clustered fork-join parallel algorithm
- Fix crash when using non-existing variables in FMIWrapper port specifications
- Fix bugs with collecting log data during multithreaded simulations
- Added missing call to finalize after measuring simulation time
- Multiple variables with same value reference is now supported by FMIWrapper
- Added missing quotation marks around include directories in FMI export Makefile
- Fixed broken pi() function in HCOM/SymHop
- Correct typenames are now used when regenerating component libraries
- Fixed problem with merging divisors after removing factor in SymHop
- Fixed crash when connecting non-existing ports in HCOM
- Fix mixup between system parameters and local variables in HCOM
- Fix FMI export of models without .hmf extension
Release 2.21.1
Bug Fixes
- DefaultComponentLibrary:
- Remove external library file for the included ActivityDiagram sub directory
This prevents compilation error of non-existing external library when the Windows version of Hopsan starts
The library has been embedded into the default component library
- Remove external library file for the included ActivityDiagram sub directory
Release 2.21.0
Important Changes
- From this version onward, 32-bit releases are no longer built by default. If you need a 32-bit version, you will need to build it yourself or ask kindly in the issue tracker.
- This version replaces the FMI import functionality, so instead of compiling a specific FMU wrapper on import, an existing FMIWrapper component shall be used instead. It is available in the default library under the Connectivity category. This means that any model that included a generated FMI component from previous versions will not longer work. You need to replace that generated component with the new FMIWrapper component.
Enhancements
-
Packaging:
- Hopsan was added to Chocolatey, a package manager for Windows, see https://community.chocolatey.org/packages/hopsan for details
Note! This package was added by an external contributor and is not directly built by the developers of Hopsan.
- Hopsan was added to Chocolatey, a package manager for Windows, see https://community.chocolatey.org/packages/hopsan for details
-
HopsanCore:
- Added connection-not-required argument to addSystemPort() function. This will only affect hand-coded "subsystem components"
Default behavior is to require a connection - Extend pneumatic node type with density, density wave variable and density characteristic impedance
This is required for correct computation of temperature and heat flow
- Added connection-not-required argument to addSystemPort() function. This will only affect hand-coded "subsystem components"
-
HopsanGenerator:
- Support inline transformation of Laplace operator
- FMI: Added FMI 3.0 import and export support
- FMI: All FMI import is now handled through the FMIWrapper component (instead of regenerating and compiling a custom wrapper every time)
- FMI: Added fmi4c dependency (FMILibrary is still kept for backwards compatibility)
- FMI: Harmonized FMI export for 1.0, 2.0 and 3.0 and removed unused template files
-
HopsanGUI:
- Improved find widget behavior when pressing Ctrl-F
- Home button will now move to beginning of line if there are only spaces before cursor in the text editor
- Do not add closing parenthesis when it has already been added in the text editor
- HCOM: New function ans() returns the answer from the previous computation. Only works for scalars
- HCOM: New command rpco() which replaces a component by specified type. Replacement type must be specified in component appearance XML
- HCOM: Support decimal number without decimal part bwfore e in expressions such as in x=14.e-3
Bug Fixes
-
SymHop:
- Only expand powers for integer exponents in SymHop
-
HopsanGUI
- Fix text editor parenthesis crash
- Fix text file constant warnings that file has changed on disk, even if it was saved by Hopsan
- Fix severe delays when saving text files
- Fix crashes when attempting to view the source of a missing component
- Fix crash when replacing subtype components with missing component
- FMU Export would fail on Linux when using deb package installation as the required zip was not in the dependency list
- Saving XML models and other XML data to Windows network drive share would take an extremely and unreasonably long time, it is now significantly faster
- Remember original data when saving models with missing components
This both eliminates the problem of accidentally saving a model with missing components and thereby losing data, and with the backup models being damaged during a failed library recompilation - HCOM: Fix undesired abort of script when using if statement without else
Component Libraries
- The component Q-type ground in the Electric->Sources was actually a C-type ground, it has been renamed
- A new component which is actually a Q-type ground has been added
- Fixed several potential "free of dangling uninitialized pointers" in generated components
They apparently worked fine when built with GCC, but other compilers may have behaved differently - Add activity diagram components to the default library
- Replaced old cavitation check i variable Q-type machine with a new check. Essentially, pressures are limited to zero implicitly by first limiting the flows to values required to get positive pressures. This solves problems with very large negative wave variables.
Release 2.20.0
Enhancements
-
HopsanCore
- Move real-time simulation main loop into HopsanCore (from GUI) resulting in much better performance (animation mode)
- Temporary files created by lookup components are now deleted on Linux systems when the model is closed
(On Windows they will remain in the temp directory)
-
HopsanGUI
- Show HTML description in FMIWrapper component (extension library) if available in FMU
- Replace functionality added to FindWidget for text files
- Import/export parameter data to/from SSV format
- Support SSV parameter sets for components (can be specified in component xml)
- Add 'Energy Density Spectrum', 'Power Density Spectrum' and 'Root Mean Square' of vector to frequency analysis
- Added "Open model file" option in right-click menu for subsystem components in library widget
- Hide "Open source code" option for components that have no source code specified
- Double-clicking on subsystem components opens model file
- HCOM: Add steady-state identification, function ssi()
- HCOM: New function: cut()
- HCOM: Support elseif and nested if-statements
- Make GUI fall back to empty port icon graphics for unknown node types
This makes it possibly to register and use custom node types in custom component libraries
Note! Custom nodes may not yet work in all cases, such as in code generation
-
Ops
- Support for surrogate models in Ops algorithms
Surrogate models are fast numerical approximations of the objective functions.
The implementation is based on polynomial response surfaces, as described by: https://doi.org/10.1007/s11081-014-9247-9
To active surrogate models, add the command surrogatemodel in the HCOM script.
The interval setting specifies how many evaluations the surrogate model is used before it is updated.
- Support for surrogate models in Ops algorithms
Bug Fixes
-
HopsanGUI
- Update default parameters when changing FMU in FMIWrapper component
- Ignore file change warning after saving a file. At least on Windows the file would otherwise be reported as modified
- Loading HMF components as internal subsystems was forgotten when saving the model
- HCOM: Fix SymHop evaluation of model parameters ending with 'e'
- HCOM: Fix symhop evaluation of power if variable contains underscore, ex: a_b^2
- HCOM: Fix hg() (highest generation) function, it did always return 0
- Fix crash when adding new component to library
- Ensure that error and warning messages about missing files when loading libraries actually contain the missing path
- Spectrum/FFT dialog Crashes GUI if simulation was stopped by stop component
time data was not truncated to actual number of simulated samples
-
HopsanCore
- Fix signal component sorting when a ReadMultiPort with multiple connections is present
Component Libraries
- Standard Component Library: MechanicTranslationalLosslessConnector XML file error
- Standard Component Library: SignalSteadyStateIdentifier
Release 2.19.1
Bug Fixes
-
HopsanGenerator
- FMU, S-Function and EXE export all failed to compile due to missing default library source code files
They were not included due to a bug in packaging in 2.19.0 - FMI ModelExchange import would not compile due to errors in the template code parameter type handling
- FMU, S-Function and EXE export all failed to compile due to missing default library source code files
-
HopsanGUI
- Energy loss calculation showed wrong value for domain-specific losses, and alternated between runs
Also clarified added energy text - HopsanGUI would crash when a connected input variable port was disabled (removed)
The checkbox is now disabled for connected ports
- Energy loss calculation showed wrong value for domain-specific losses, and alternated between runs
Release 2.19.0
Important Change
The HoLC (Hopsan Library Creator) application has been removed.
Its functionality has been built into HopsanGUI for some time, and can be accessed from the context menu (right-click)
in the library widget.
Enhancements
-
HopsanC:
- Make it possible to get data vectors by alias name in Python, Julia and Matlab
-
HopsanGUI:
- Make it possible to view XML and source code for default library components by right-clicking in library widget
- Highlight connected connectors when hovering a component
- HCOM: Support orphan variables in the chpvx command
- HCOM: Enables defining and evaluating SymHop expressions
Example:
>> a=expr(sin(x)+y)
sin(x)+y
>> b=der(a,expr(x))
cos(x) - HCOM: Convert SymHop expressions to LaTeX
Example:
>> f=expr((a+b)/(c+d))
(a+b)/(c+d)
>> latex(f)
\dfrac{a+b}{c+d} - Monitor text files in editor tabs for external changes
- Add "Always visible" setting for GUI components
Use the context menu (right-click) on a component
-
HopsanGenerator:
- Various improvements in Simulink generator
Hopsan S-functions now also support the "fast restart" option in Simulink - Various fixes and improvements to Modelica generator
- Statically link to MinGW libraries for FMI export on Windows
Removing dependency to correct version of MinGW DLLs in exported FMUs more
- Various improvements in Simulink generator
Bug Fixes
- HopsanGUI:
- Use interpolation-based down sampling to reduce vector size
There was an error in reduceVectorSize function due to integer division
The fix will affect all frequency analysis plots (spectrum, bode and nyquist) - Preserve rotation and flipping of replaced components
- Use interpolation-based down sampling to reduce vector size
Component Libraries
- Enable end of stroke limitation in all C-type pistons
- Add moment of inertia quantity and make use of it in components
- PID2 component, changed the meaning of the 'de' input signal
It is now expected to be a derivative input rather then a "error" delta
If you have models using this component they may need to be updated - Added markdown descriptions with equations for many commonly used default library components
Note! Due to the large amount of added documentation, it has not yet been reviewed
If you find something that looks odd, take a look at the component source code
Release 2.18.0
Enhancements
- HopsanCore:
- New "filepath" parameter type (variable class HFilePath). It is basically a string, but will enable a browse dialog button in
the component properties dialog. File paths will be added relative to the model, if you want absolute paths, you will have to
copy paste the path into to file path text field (like before)
- New "filepath" parameter type (variable class HFilePath). It is basically a string, but will enable a browse dialog button in
Bug Fixes
-
HopsanGUI:
- Due to the random bug described below, starting optimization would instantly freeze the program
-
Ops:
- On the Windows version build with MinGW the random generator would return the same value on each call. It now returns actual random values
- Due to this random bug, optimization would freeze during initialization (get stuck in an infinite loop)
Component Libraries
- Various improvements and fixes to the experimental FMI wrapper component (Extension library)
- LookupTable components now use the filepath parameter type to allow browsing for files