odeintw | odeintw provides a wrapper of scipy.integrate.odeint | Build Tool library
kandi X-RAY | odeintw Summary
kandi X-RAY | odeintw Summary
odeintw provides a wrapper of scipy.integrate.odeint that allows it to handle complex and matrix differential equations. That is, it can solve equations of the form. where t is real and Z is a real or complex array. Since odeintw is just a wrapper of scipy.integrate.odeint, it requires scipy to be installed. odeintw is available on PyPI:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Wrapper around odeintW
- Convert Jacobian to real representation
- Transforms a banded adjacency matrix
- Checks for Odeintw arguments
- Convert a complex128 array to a float64 view
- Calculate the dot product of y
- Returns the OINTW version number
- R Compute the z - value of the covariance matrix
odeintw Key Features
odeintw Examples and Code Snippets
name: nbdev
channels:
- fastai
- defaults
- conda-forge
dependencies:
- _r-mutex
- _tflow_select
- absl-py
- alabaster
name: nbdev
channels:
- fastai
- defaults
- conda-forge
dependencies:
- p
x'' + 2*c*x' + x = F*cos(W*t)
x(t)=A*cos(W*t)+B*sin(W*t)+exp(-c*t)*(C*cos(w*t)+D*sin(w*t))
w^2=1-c^2
-W^2*(A*cos(W*t)+B*sin(W*t))
+2*c*W*(B*cos(W*t)-A*sin(W*t))
+ (A*cos(W*t)+B*sin(W
from odeintw import odeintw
import numpy as np
Y0_test=np.array([[0,1],[0,1]])
tmin, tmax, tstep = (0., 200., 1)
t_test=np.arange(tmin, tmax, tstep) #time vector
dydt_testm=np.array([[0.,1.],[2.,3.]])
def dydt_test(y,t):
return dydt
Community Discussions
Trending Discussions on odeintw
QUESTION
I had just installed Anaconda from anaconda.com. The installation proceeded smoothly. After that, I was trying to create a new environment from this environment.yml file. (nbdev.yml)
...ANSWER
Answered 2021-Aug-04 at 05:11After a lot of research, I stumbled on to Mamba doesn't find a solution when mixing conda forge defaults and not specifying Python explicitly 1102. So I just edited nbdev.yml from
QUESTION
In most of the below answers for complex matrix differential equations, the odeintw package has been suggested. https://stackoverflow.com/a/45970853/7952027
https://stackoverflow.com/a/26320130/7952027
https://stackoverflow.com/a/26747232/7952027
https://stackoverflow.com/a/26582411/7952027
I want to know the theory behind the manipulations done in the code of odeintw. Like why one has to build that banded jacobian, the idea behind the functions _complex_to_real_jac, _transform_banded_jac, etc.
...ANSWER
Answered 2021-Apr-03 at 14:32The answer is in the comments.
A complex matrix space is a real vector space, so a complex matrix can be represented by an array of real numbers preserving this linear structure. All odeintw has to do is to wrap odeint or better the function given to it with this basis transformation, forward and backward.
Now if you want to speed up the computation by providing the Jacobian, it also needs to be translated into the real form. In the method of lines as example you get banded Jacobians, the translation has to keep that property for efficiency reasons.
M-o-L is a common method in solving PDE of the heat or wave equation type. Essentially, it discretizes the space dimension(s) while leaving the time dimension continuous, resulting in a large-dimensional ODE system in time direction. The resulting Jacobians only are non-zero at nearest-neighbor interactions, thus very sparse, and have a banded structure if the discretization is via a regular grid.
The nontrivial part arises when you want to specify the Jacobian via the Dfun argument. The complex Jacobian requires that the right-hand side of the equation be complex differentiable (i.e. holomorphic). For example, the function f(z) = z* (the complex conjugate) is not complex differentiable, so you can't specify a complex Jacobian for the equation dz/dt = z*. You would have to rewrite it as a system of real equations. (This example is in the docstring of odeintw.)
If the right-hand side is complex differentiable, then you can give a complex Jacobian via Dfun.
QUESTION
I try to solve the Duffing equation using odeint
:
ANSWER
Answered 2021-Jan-24 at 21:01Inserting the constants, the equation becomes
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install odeintw
You can use odeintw like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
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