I wish to do some analytical tensor / linear algebra equations, where, for example, the order of multiplication matters.
I am familiar with the Sympy package, but could not find any analytical way to derive solutions to linear algebra problems.
Is there a way to do this?
Related
I am trying to numerically solve a continuous replicator partial differential equation in order to model evolution in a competitive system. The equation takes the form of a second-order nonlinear integral PDE, with the specific PDE in the attached image.
Do you know of any tools in MATLAB or Python that can help in solving these forms of equations? I've looked at MATLAB's built-in solver and PDE toolbox, but neither can do second-order integral PDEs.
My problem is stationary combustion equations (BVP) with temperature and concentration-dependent equations with a form similar to that:
d(Lambda(C_i, T)dT/dx)/dx-C_eff(C_i, T)*dT/dx+Q(C_i,T)=0,
d(D(C_i, T)dC_i/dx)/dx-u*dC_i/dx+G(C_i,T)=0
i=1
These equations are pretty stiff and very non-linear because the source term exponentially depends on T.
Is there a Python or MATLAB package or solver or something that could help me? Standard MATLAB solvers are not suitable for such tasks. I have not tried Python yet, but I think it should be the same.
I am trying to find eigenvalues and eigenvector in python without Numpy but I don't know how to calculate det(A-lemda*I) for finding eigenvalue.
If you really want to avoid using numpy.linalg (why? This must be some sort of a learning problem, surely), you can e.g. implement a variant of a qr algorithm: factorize A into the product of Q#R, multiply R#Q, repeat until convergence.
However, if it's indeed a learning exercise, your best bet is to pick a textbook on numerical linear algebra.
And if it is not, then keep in mind that you are very unlikely to outperform (in any definition of performance) the tried-and-tested lapack routines that numpy.linalg wraps.
I'm on the lookout for a numerical method that can solve both a deterministic and stochastic equation. In the deterministic case, I know that a fourth order RK method is a valuable one, very effective. Unfortunately, there has not been applied to stochastic equations successfully (at least as far as I know).
Now what I want to know is if a numerical method that can solve both equations (roughly I mean, in comparison to the analytic solutions) exists and, in that case, what would be. A stochastic equation analytically solvable would be the Black-Scholes one, for instance.
There are methods for solving these kinds of equations in DifferentialEquations.jl. Stochastic differential equations are a form of mixed deterministic and stochastic equation and solving them is shown in the SDE tutorial. Mixing discrete stochasticity with deterministic equations is shown in the jump equation tutorial. While written naively in Julia, it is accessible in Python via the package diffeqpy. Notice that this has some example stochastic differential equations in the README.
Just curious if it uses Gaussian elimination or some other equivalent?
From the numpy docs:
solve is a wrapper for the LAPACK routines dgesv and zgesv, the former
being used if a is real-valued, the latter if it is complex-valued.
The solution to the system of linear equations is computed using an LU
decomposition [R40] with partial pivoting and row interchanges.
More details on dgesv and zgesv