Skip to main content
edited tags
Link
Became Hot Network Question
Tweeted twitter.com/StackMma/status/1216736868911460356
edited tags
Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375
deleted 9 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

Defining Maximizing over a 1D region in 1d

Why does the following not compute?

MaxValue[-y^2, y \[Element] Interval[{-1, 1}]]

I expect it to compute the maximum value of the funtion over the interval from -1 to 1 but I instead get the error: MaxValue::objfs: The objective function {-Subscript[y, 1]^2} should be scalar-valued.

MaxValue::objfs: The objective function {-Subscript[y, 1]^2} should be scalar-valued.

What should I be using instead?

Defining a region in 1d

Why does the following not compute?

MaxValue[-y^2, y \[Element] Interval[{-1, 1}]]

I expect it to compute the maximum value of the funtion over the interval from -1 to 1 but I instead get the error: MaxValue::objfs: The objective function {-Subscript[y, 1]^2} should be scalar-valued. What should I be using instead?

Maximizing over a 1D region

Why does the following not compute?

MaxValue[-y^2, y  Interval[{-1, 1}]]

I expect it to compute the maximum value of the funtion over the interval from -1 to 1 but I instead get the error:

MaxValue::objfs: The objective function {-Subscript[y, 1]^2} should be scalar-valued.

What should I be using instead?

Source Link
Chris
  • 1k
  • 5
  • 8
Loading