Implementing GJK algorithm with SymPy - sympy

I am trying to implement GJK alg, entirely in symbolic form with Sympy,
but I am not sure it is possible/computationally feasible.
Did anyone tried this?

Related

Can Pyomo solve non-convex MIQCP (bilinear problems) using Gurobi?

I want to model an optimization problem that contains quite some bilinear terms. As such, I want to make use of the functionality of Gurobi 9.0 to solve bilinear problems. Clearly, I can use the GurobiPy API. However, I might want to compare other solvers (like BARON). So, I wonder whether it is possible to use Pyomo to formulate the problem and then solve it using Gurobi? Will there be any problems?
As far as I can tell, there should not be a problem. The same Gurobi solver will be used. Your problem will just be modelled in a somewhat different syntax (PYOMO) which is easily portable for solving with a wider range of solvers.
If still in doubt, I suggest you try a very simple problem with a bilinear term.
Note however that BARON requires a commercial license unlike Gurobi which offers free academic licenses.
Best of luck!

Generalizing a non linear model in pyomo

I would like to know if there is a way to take a non linear model in pyomo format from the user, and load it into the pyomo optimization code. I'm asking this since i'm dealing with non linear models, and need to develop a generic code to implement a particular type of optimization using these models. Kindly help me out.
Thank you

How to find out whether the equations have solutions effectively?

I want to know whether equation set has a solution, and I use solve(f)!=[] (python sympy) to achieve it. But I only need to know that whether there is a solution so I do not need to find all the solutions which will consume a lot of time. Is there any way to do it efficiently?
Be aware that sympy.solve giving [] doesn't necessarily mean the equation has no solution. It only means it could not find any. Some equations have solutions but they cannot be expressed in closed form (like cos(x) = x). sympy.solveset will give you the full solutions but in cases where it can't tell it will just return a generic solution set.
As to the original question I don't know if there's a way to do it in general. If you are only dealing with real continuous functions you could check if it is strictly positive or strictly negative on its domain. Sympy doesn't have the strongest tools for checking this, without some user assistance.

C++ Newton-Raphson algo?

I have a huge problem. I need to solve a non linear sistem of 3 equations in 3 variables with a C++ function or class. I thought about using Newton-Raphson method to perform the solution. Unlukily I didn't find a source code that can do that for me. There would be someone that knows a program like that? I'm near deciding to build it myself. Thanks
A 3x3 system is not huge; it's actually a very small problem. People routinely solve nonlinear systems of equations with thousands (and more) of variables and constraints.
Given that your system is 3x3 and possibly nasty, a more appropriate choice of method would be a line search method. You get global convergence to a local minimum of the residual this way; it's very easy to make straight Newton's method diverge.
Steepest descent with backtracking line search is the simplest line search method possible. You might try implementing it first.
First, see related questions What good libraries are there for solving a system of non-linear equations in C++? and https://stackoverflow.com/questions/4914967/could-you-explain-how-newton-raphson-for-a-set-of-equations-works-code-inside. Also, try to use boost.
Consider this cozy C++ library

How to write gaussian mixture model in c++ and Opencv

I want to track an object in a video. So i suppose that I could use "Gaussian Mixture Models" in Opencv and C++ . I want to know how to write Gaussian Mixture Models in C++ . Are there any better algorithms for this than GMM?
Sorry to not answer the question directly but:
Reading research papers is a great thing to do, but to be honest, you will get much more knowledge at this point by trying your own ideas on your specific data and getting a better understanding of the problem.
If you know the shapes, it's probably better to use a generalized Hough transform or matched filter for position estimates, combined with a Kalman filter for tracking. These will be relatively easy to implement. Or maybe you can find existing implementations.
Also, I'd prototype your idea in Matlab or Octave instead of C++ if you are not a very good C++ programmer as you'll wind up wasting most of your time with problems in C++ when the problem itself is what you really want to focus on.
As I said in the comment, I'd skip out on using GMM's for now until you get a better understanding of the problem and how you are going to use them. (Unless of course you already have a good idea of how you will use them.)