Any tool to differentiate a tensor wrt another tensor? [closed] - matlab

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have been dealing with continuum mechanics, and there are a lot of operations where I need to get the derivative of a tensor with respect to another tensor. I'd love to try to do that symbolically, on computers.
For example, the elasticity tensor c = d(2nd PK stress) / d(strain tensor), while both 2nd PK stress tensor and strain tensor are 3x3 matrices, and the resulting elasticity tensor is 3x3x3x3 4th order tensor.
I tried to use sympy, but it seems that the most it would support is a matrix (tensor of order 2). The ndarray in numpy is simply not in sympy.
I used to use matlab, and am now aware of any way that it would work in matlab either.
Therefore, I was wondering that, is there any tool that is available for this purpose? Can mathematica do that?
Thanks a lot in advance!
-Shawn

A way to do this in python would be to use numpy arrays using dtype=object so that you can fill them with sympy expressions instead of numbers. However you will have to write all the convenience methods yourself (but they would be extremely simple, just looping already implemented sympy function over the numpy arrays).
This obviously can be done in Mathematica as well or in Matlab if you install the necessary symbolic packages.
Mathematica also has packages for tensor analysis, but they would be an overkill for the problem that you are describing. In the same way, there are various packages for differential geometry and tensor analysis in SymPy, but again, they would be an overkill.

Related

Mixed Integer Programming with Large number of constraints [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
I have a lot of constraints(in millions) and want to solve a mixed integer problem. Tried using PuLP and OR-Tools(with SCIP solver), but they failed to solve the problem. I tried using DuaLip for parallel/distributed computing using spark, but it doesn't seem to have good documentation for usage. How should I proceed further?
AFAIK there do not exist continuous LP solvers that do distributed computing. That would require some decomposition scheme. As LPs solve very fast we don't use those techniques anymore. An LP with a few million constraints is not very large these days. Quite often interior-point algorithms do quite well on these large problems (relative to Simplex algorithms). We solve LPs of this size on a completely routine basis on fairly standard hardware.
Your PuLP problem is likely more related to PuLP having problems generating the problem than the solver solving it. (Note that PuLP is not a solver). Python based modeling tools may be slower in generating easy LPs than the solver needs to solve it.
Note: the situation for MIP solvers is very different.

Large Scale Quadratic Programming [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a scalable quadratic programming problem which has around 50-1000 variables with linear constraints. I am trying to find an effective solver for this. The matlab qp solver can only solve to optimality for 100 variables for my problem. Will cplex be any better? Are there any other tools which I can use.
CPLEX will definitely be better. Everything depends on the environment you are working in. If it's not a problem for you to write a C++ program you can try COIN-OR projects, in particular Couenne http://www.coin-or.org/projects/Couenne.xml for nonlinear MIP's and IPOPT http://www.coin-or.org/projects/Ipopt.xml; for Python lovers they have Coopr, DilPy, GrumPy and other projects. You can also try GAMS https://www.gams.com/, it's great for any optimization problem. It's not a solver, more like modeling system with a large number of built in commercial and open-source solvers. It's free as long as your problem has no more than 50 variables and 50 constraints (as far as I remember).
You can try the Opti Toolbox: http://www.i2c2.aut.ac.nz/Wiki/OPTI/
It has an interface to different solvers which you can use in Matlab. (Precompiled mex files.) It can solve quadratic problems.

Support vector machine or back propagation for stock market prediction [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What should I use for stock market prediction and why? comparison if you can please.
Udpated: I wanted to use it for stock market movement (up,down) for 1 day.Also,Thank you for your answer it halped
It's not easy to say you which ML algo will give you best perfomance. Especially if not to see which market you want to predict. I recommend you to implement different algorithms and try to train them, because in my practice changing of layers gave different results. SVM sometime was also flexible enough. Also try to implement and check how your training will work on trained and untrained data in order to have really good results. Also analyze how machine learning will work on more predictable sequences ( aka sin, cos, polinomials, randow walks)
Additional field of investigation can be some technical analisis additions: moving averages, stochastics, candle chart patterns, Fibonacci levels.
And finally in order to get money don't rely only on neural network or SVM but use them in conjunction with some trading strategy. For example you can use some trading strategy which has perfomance 30 % and use ML in order to rise perfomance to 60 %

software for non linear dynamic system simulation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for a software package (free better) that can be used for stochastic dynamic system simulation with minimal coding. For example it should allow me to model a system by specifying:
Xn = AXn−1 + Vn,
Yn = BXn + α Wn
where X is the state, Y observation, A,B matrices and Vn and Wn are noise sources with different pdf's such as normal, T, etc.
I've already tried scilab and R. Although they seem to be very powerful, it does not seem to provide direct support to create models by specifying above equations.
If the noise is Gaussian, what you have is a stochastic differential equation (SDE) written as a recurrence relation. If you're looking for something with "direct support" such systems you should specify what they represent physically – economic models, neural models, Kalman filtering, etc. – rather than just the abstract equations because such packages are generally written with an application in mind.
Matlab does have the Econometrics toolbox which is usually not included with most installs but can solve general SDE problems outside of finance as well. For a free option, you can also look at my SDETools which is a Matlab toolbox for the numerical solution of SDEs that works very similarly to Matlab's own ODE solvers such as ode45. You will need to transform your recurrence relations to differential equations. And of course if you want the fastest code possible (stochastic simulations can be slow) it will always be better to code up the Euler-Maruyama method for your particular problem.
If you're looking for something that will do what you want without having to learn much about the underlying math you will most likely be out of luck. Also, if your noise is not Gaussian then the rules are different and you may need to learn about jump processes and the family of alpha-stable distributions.
"Open modellica" (https://www.openmodelica.org) might be what you are looking for.

How to find the solution space (x,y,z) for a function f(x,y,z)=0 in MATLAB [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a function, dependant on a vector k=(x,y,z) and a function f(x,y,z)=0, I would like to find the solution space for (x,y,z).
Can this even be done analytically in matlab? I imagine it can be done numerically because my initial thought was to plot the surface created by this function, however this is of no use to me as I have 9 other constants in my equation with no numerical value assigned to them. Many thanks in advance for any help.
EDIT: This is for a polynomial degree 4.
There are no generic, analytical solvers for given function f(x,y,z) neither in matlab, nor in any other language. If such solution would exist, the Riemann hypothesis (and dozens others) would be solved ;)
For simple problems you could use symbolic math toolbox and a solve function:
http://www.mathworks.com/help/symbolic/solve.html
And obbiously there are numerical solvers, which you can use like vpasolve and others
http://www.mathworks.com/help/symbolic/vpasolve.html