Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a minimisation problem, to minimise the integral over possible $0\leq t \leq T$, $T$ is free,

$$J = \text{min} \int_0^T (\alpha + \beta_1\cdot v \cdot R_T \cdot q+ \beta_2 \cdot \frac{M}{1000} \cdot v \cdot a^2 \cdot p \cdot q)\,dt$$


$$R_T = b_1 + b_2 \cdot v^2 + \frac{M}{1000}\cdot a$$

$$ p = \text{sgn}(a) = \begin{cases} 1, & \text{if $a > 0$} \\ 0, & \text{otherwise} \end{cases} $$

$$ q = \text{sgn}(R_T) = \begin{cases} 1, & \text{if $R_T > 0$} \\ 0, & \text{otherwise} \end{cases} $$

$s$ is travel distance, $v$ is velocity, $a$ is acceleration and subject to dynamics, $$ \begin{cases} \dot s(t)= v(t)\text{;}\ v(0) = 0\text{,}\ s(T) = D \\ \dot v(t)= a(t)\text{;}\ a(0) = 0 \end{cases} $$

In the above expressions, $\alpha$, $\beta_1$, $\beta_2$, $b_1$, $b_2$, $M$, $D$ are constants.

Any suggestions about computing the minimum $J$ are greatly appreciated. (Is there any routine in matlab that solves this problem?)

share|cite|improve this question

One option is APM MATLAB that allows differential and algebraic equations with either continuous or mixed integer variables. You'll need to define the differential of the objective function and include it as a constraint. You can then include the integral of that variable in the objective function declaration.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.