We are developing a website tool that, given some parameters by the user, solves the following optimal control problem online: $$\boxed{\begin{array}{cl} \displaystyle \min_{u\in\mathcal{U}} & \displaystyle L(u) := \frac{1}{T} \int_0^T v^\top x(t; x_0, \theta, u) dt \\ \text{subject to} & \left\{\begin{array}{l} \dot{x} = f_\theta (x,u), \quad x(0) = x_0 \\ w^\top x(t) \leq b \end{array}\right. \end{array}}$$ where $\theta$ is the vector of model parameters provided by the user, $w,v\in\mathbb{R}^n$ are vectors, $x(t)\in\mathbb{R}^n$ is the state, and $u(t)\in\mathbb{R}^p$ is the control function to be optimized. The dimension $n$ is on the order of $10^3$. Each time the user changes the model parameters, he/she runs the optimization and wait for the result. However, it may take too long to finish.
Question 1: Which optimization solvers are best in terms of computation time for solving this problem in real-time on the website?
Question 2: Which language (C++, Python, etc.) should be used to code the optimization?
Question 3: I have coded the algorithm in MATLAB using fmincon function. There is a MATLAB toolbox (MATLAB Coder) to convert MATLAB code to a C++ code. Do you have a recent experience (good/bad) about this?