Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Minimize[{If[x > 0, 3 x, x^2 - x - 4]}, x]
- Minimize[{If[x > 0, 3 x, x^2 - x - a], -2 < a < 2}, x]
- If a < 0 min = 0, If a > 0 min = - a
- Minimize[{If[x > 0, 3 x, x^2 - x - a], -2 < a < 2}, x]
- Minimize[{If[x > 0, 3 x, x^2 - x - a], -2 < a < 2}, x]
- $Version
- (* "10.0 for Mac OS X x86 (64-bit) (December 4, 2014)" *)
- Clear[f]
- f[x_, a_] = PiecewiseExpand@If[x > 0, 3 x, x^2 - x - a]
- (* Piecewise[{{3*x, x > 0}}, -a - x + x^2] *)
- Plot3D[f[x, a], {x, -3, 3}, {a, -2, 2}]
- Minimize[{f[x, a], -2 < a < 2}, {x, a}]
- (* Minimize::wksol: Warning: there is no minimum in the region in which the
- objective function is defined and the constraints are satisfied; returning a
- result on the boundary. >>
- {-2, {x -> 0, a -> 2}} *)
Add Comment
Please, Sign In to add comment