sundials | Official development repository for SUNDIALS - a SUite
kandi X-RAY | sundials Summary
kandi X-RAY | sundials Summary
SUNDIALS is a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. This is a mirror of current releases, and development will move here eventually. Pull requests are welcome for bug fixes and minor changes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sundials
sundials Key Features
sundials Examples and Code Snippets
Community Discussions
Trending Discussions on sundials
QUESTION
About FMPy which is a python package for FMU simulation. I need one clarification : What is the purpose of cswrapper code, sundials solver or functions? Is it only required for ModelExchange type FMU simulation and not for Co-simulation type FMU simulation? https://github.com/CATIA-Systems/FMPy
...ANSWER
Answered 2021-Apr-06 at 09:38With the cswrapper code you can "wrap" a ME FMU as a CS FMU by adding a (sundials) solver, see https://github.com/CATIA-Systems/FMPy/issues/127. So you get from a ME a CS FMU. Additionally, the CVODE solver can be used to simulate ME FMUs in fmpy.
QUESTION
I am trying to compile a Modelica model (built in Dymola) using Jmodelica, but got the following error:
Compiler arguments: Generating code...
====== Model compiled successfully ======= OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x24): undefined reference to 'ModelicaStandardTables_CombiTable1D_minimumAbscissa'
OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0xbc): undefined reference to 'ModelicaStandardTables_CombiTable1D_maximumAbscissa' OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x1e7): undefined reference to 'ModelicaStandardTables_CombiTable1D_init2'
collect2.exe: error: ld returned 1 exit status
mingw32-make1: *** [fmume20_] Error 1
mingw32-make: *** [fmume20] Error 2
"C:/Users/taoy/AppData/Roaming/JModelica.org-2.14/MinGW/bin/mingw32-make" -f "C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile" "PLATFORM_FLAG=-m64" "RUNTIMELIBRARY_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib/RuntimeLibrary64" "MINPACK_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/Minpack/lib64" "SUNDIALS_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/lib64" "WINPTHREADS_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/winpthreads/lib/winpthreads64" fmume20_
mingw32-make1: Entering directory
'C:/Users/taoy/AppData/Local/Temp/1/jmc7241264750773945049out' "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse -O1 "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_funcs.o" sources/OU44_ZoneR2C2_funcs.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_init_independent.o" sources/OU44_ZoneR2C2_init_independent.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_init_dependent.o" sources/OU44_ZoneR2C2_init_dependent.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_base.o" sources/OU44_ZoneR2C2_base.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_equ.o" sources/OU44_ZoneR2C2_equ.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_equ_init.o" sources/OU44_ZoneR2C2_equ_init.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2.o" sources/OU44_ZoneR2C2.c
mkdir binaries\win64 "C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\MinGW\bin\g++" -m64 -shared -m64 -o "binaries/win64/OU44_ZoneR2C2.dll" OU44_ZoneR2C2_funcs.o OU44_ZoneR2C2_init_independent.o OU44_ZoneR2C2_init_dependent.o OU44_ZoneR2C2_base.o OU44_ZoneR2C2_equ.o OU44_ZoneR2C2_equ_init.o OU44_ZoneR2C2.o "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib/RuntimeLibrary64" -lfmi2 -static-libstdc++ -static-libgcc -ljmi "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib" -L"C:\Users\taoy\Documents\Modelica Standard Library 3.2.3\Modelica 3.2.3\Resources\Library/win64/gcctdm510" -L"C:\Users\taoy\Documents\Modelica Standard Library 3.2.3\Modelica 3.2.3\Resources\Library/win64" -L"C:\Users\taoy\Documents\Modelica Standard Library 3.2.3\Modelica 3.2.3\Resources\Library" -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -lModelicaExternalC -ljmi_get_set_default -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -lModelicaExternalC -ljmi_get_set_default -llapack -lblas -l:libgfortran.a -l:libquadmath.a -lModelicaExternalC -lzlib -ljmi "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/lib64" -l:libsundials_kinsol.a -l:libsundials_nvecserial.a -l:libsundials_cvode.a "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/Minpack/lib64" -l:libcminpack.a "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/winpthreads/lib/winpthreads64" -l:libwinpthread.a C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile:214: recipe for target 'fmume20_' failed mingw32-make1: Leaving directory 'C:/Users/taoy/AppData/Local/Temp/1/jmc7241264750773945049out' C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile:210: recipe for target 'fmume20' failed
Unknown program error, org.jmodelica.util.exceptions.CcodeCompilationException: Compilation of generated C code failed.
C file location: C:\Users\taoy\AppData\Local\Temp\1\jmc7241264750773945049out\sources\OU44_ZoneR2C2.c
It says model compiled successfully, but the error occurs afterwards. I looked into model, if I delete the model component "CombiTable1D from Modelica standard Library", then the error is fixed. Seems likt something is wrong with this component. However, this component is necessasy in my model.
How can this problem be solved?
...ANSWER
Answered 2021-Feb-22 at 13:46ModelicaStandardTables_CombiTable1D_minimumAbscissa
was added in 2017, but JModelica uses a 2016 version of the MSL C-sources:
https://github.com/JModelica/JModelica/blob/8982e1f4e7ca33b01b398f389b73d2398761ee9c/ThirdParty/MSL/Modelica/Resources/C-Sources/ModelicaStandardTables.c
You likely need to use an earlier version of the Modelica Standard Library (3.2.2 is included with JModelica), or a different Modelica tool since JModelica is discontinued.
QUESTION
I want to implement the adjoint sensitivity analysis in python, in order to determine the gradient of my objective function with respect to some parameters. In specific the objective function depends on the solution of a differential equation which in turn depends on said parameters which I am looking to find the optimum of.
To perform this there are numerous good packages both in Julia (see here), as well as CVODES from SUNDIALS, however the latter which does apparently have a wrapper made for python, does not include sensitivity analysis capabilities according to this link. Furthermore, I have looked into SALib for sensitivity analysis, but as far as I understand this refers to some other type of 'sensitivity analysis' and therefore adjoint or even forward sensitivity analysis is not included (correct me if I am wrong on this one).
Thus my question is, does a version of CVODES exist in python with sensitivity analysis capabilities, or is there there any other package where one can use in order to perform adjoint sensitivity analys?
...ANSWER
Answered 2020-Dec-15 at 12:08You can easily call Julia code / packages from Python with pyjulia. https://github.com/JuliaPy/pyjulia
QUESTION
My goal was to build shared libraries from SUNDIALS 2.7.0 - these are solvers of ordinary differential equations, written in C.
I've downloaded the source, and followed the installation guide:
- run Cmake (with GUI), checked options "CVODE" (this is one of the available solvers - the only one I wanted), "build shared libraries" and "use generic (std-c) math libraries" and generated the Makefile.
- run
make && make install
in the Linux console and my shared libraries got generated, with no error messages at all. Here is the output:
ANSWER
Answered 2020-Sep-21 at 09:16You have undefined symbol with ldd because the so files were created without the -lm
option. However it will not be a problem as long as the final executable is linked with -lm
option. It is what is done for tests like test_nvector_serial
which is linked with -lm -lrt
.
You can see all this by running the make in a verbose mode with make VERBOSE=1
.
If you try to generate the executable without -lm
you will have collect2: error: ld returned 1 exit status
and the linker complaining about exp, pow and sqrt.
if you add -lm
when creating the so files ( I did it ). you will see :
QUESTION
I have C source files and header files from the first version(1.0) of Sundials numerical solver.
https://computing.llnl.gov/projects/sundials
In the makefile information for IDA solver, it looks like this.
...ANSWER
Answered 2020-Sep-01 at 17:55"I would like to do the same thing in Windows 10 and visual studio (2019)..."
Here are example steps using Visual Studio 2019:
Note, because Visual Studios is by definition an IDE, it removes much of the the responsibility from the developer to know as much about make-files and command line-compile instructions. These things are done within the Visual Studios application via menus and buttons on a GUI.
On the menu bar, choose File > New > Project to open the Create a New Project dialog box.
At the top of the dialog, set Language to C++ [or C], set Platform to Windows, and set Project type to Library.
From the filtered list of project types, select [Console App], then choose Next.
In the Configure your new project page, enter some [Name] in the Project name box to specify a name for the project. Enter [StaticNameLib] in the Solution name box. Choose the Create button to open the Windows Desktop Project dialog.
In the Windows Desktop Project dialog, under Application type, select Static Library (.lib).
Under Additional options, uncheck the Precompiled header check box if it's checked. Check the Empty project box.
Choose OK to create the project.
Note: Content within italicized square brackets ( [...] ) is mine. See link below for original.
QUESTION
I'm trying to switch from GNU Make to CMake on a C++ project. My plan is to distribute alongside the source code of my library, also the code of two external libraries that are needed.
The project is structured as follows
...ANSWER
Answered 2020-Jun-15 at 09:25Try to use target_link_options
instead of target_link_libraries
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sundials
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page