Symbolic toolbox doesn't work with abs() and max()?

4 views (last 30 days)
Tao
Tao on 3 Jun 2015
Commented: Tao on 3 Jun 2015
I am using fmincon dealing with a nonlinear constraint optimization problem, one function contain abs(a) and another function contains max(Z, 0), both "a" and "Z" are scalar values. I want to create symbolic Jacobians for my constraint function to fmincon to make the whole algorithm more robust and faster, but it shows these "abs()" and "max()" cannot be used in symbolic toolbox. I used "max(Z, 0)" because one of the function is not defined and not physically meaningful once its value becomes negative.
Thanks a lot for helping.

Answers (1)

Walter Roberson
Walter Roberson on 3 Jun 2015
X * Heaviside(X) is 0 if x is negative
  1 Comment
Tao
Tao on 3 Jun 2015
Thank you for your reply. I tried to modify my code this way, but MATLAB works very very very slow to generate the symbolic things (actually unsuccessful).

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!