diffeq | reboot of differential equations thing | Incremental Backup library
kandi X-RAY | diffeq Summary
kandi X-RAY | diffeq Summary
reboot of differential equations thing
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 diffeq
diffeq Key Features
diffeq Examples and Code Snippets
Community Discussions
Trending Discussions on diffeq
QUESTION
I'm trying to write an integrator which uses long doubles for very high precision. I know that my system architecture has long double support, but for some reason, the precision of my integrator maxes out at 16 significant digits. Here's some code which recreates what I'm seeing. The integrator for this example was adapted from this source. In this test case, I am using it to calculate Euler's number (I apologize for the length of the code block but I can't recreate the behavior any other way):
...ANSWER
Answered 2021-May-20 at 04:04but for some reason, the precision of my integrator maxes out at 16 significant digits.
At a minimum, use more correct values of long double
initialization with long double
quotients rather than double
quotients.
QUESTION
Let's suppose the example 1 of the bouncing ball with multiple walls in the page:
https://diffeq.sciml.ai/stable/features/callback_functions/
And consider the condition:
...ANSWER
Answered 2021-Feb-08 at 08:30Consider the code later on on the same page you listed:
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
I am trying to get the differential equation y'=sin(x) however my differential equation will not run any further as I get the error "can't convert expression to float". If I use numpy with np.sin(x), I get another error "loop of ufunc does not support argument 0 of type Symbol which has no callable sin method". Here is the code:
...ANSWER
Answered 2020-Sep-30 at 21:01You are calling sin()
with an argument that it doesn't support. math.sin()
must take a numerical value as its only argument.
I think to fix the problem, you just need to pass the function's name instead of calling it:
QUESTION
I want to solve the matrix-form time-dependent Schrodinger equation on 3d lattice with DifferentialEquations.jl,
i.e., (∂/∂t)ψ = -iHψ ,where ψ is a vector and H is a (time-independent) matrix.
I tried to write the code like this.
ANSWER
Answered 2020-Aug-30 at 15:31ψ0 = [] # Initial conditions
QUESTION
I am trying to compare the ODE-solver of GSL with odeint from boost for multi-dimensional systems, and therefore wrote a short test program:
...ANSWER
Answered 2020-Feb-12 at 12:09Define in the class solving function x_0
like so:
QUESTION
SinceSympy
version 1.2, python Sympy
has implemented the ability to solve for the constants in a simple differential equation, given some initial conditions. I was trying to test out this feature, but keep getting an error that I don't know how to solve.
The documentation indicates the following format for initial conditions, and I tried to follow what was specified in the actual pull request that implemented the feature. Here is the code and the error.
...ANSWER
Answered 2019-Sep-20 at 20:46I am not a heavy user of sympy, but I got that to work -
the problem is that when you define x = sp.Function('x')(t)
you already got
the parameter t
to it, and can no longer pass 0
for it at the line
res = sp.dsolve(diffeq, t, ics={x(0): 0, sp.diff(x(t), t).subs(t,0): 0})
-
The call of x
with (t) makes it a "defined function".
So, leaving x
as an undefined function, and just passing t
for it in the points it is needed when creating the differential equation is the way to go:
QUESTION
I am trying to understand how scipy.odeint works, but I have some problems. For exampe:
...ANSWER
Answered 2018-Sep-11 at 17:20In Python, when you execute the line
QUESTION
I added the Vega package and tried rerunning some DiffEq code and am now getting the following
...ANSWER
Answered 2018-Sep-04 at 18:17The answer is in https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/342
Pinning an older version of Parameters resolved the issue for now.
QUESTION
Here is the content of my script:
...ANSWER
Answered 2018-May-19 at 16:17Short explanation: the logic of SymPy ODE module is often naive and sometimes incorrect.
As written originally, with
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install diffeq
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