Message Boards Message Boards

Find Point {x,y,z} for which 2 functions as minimal as possible?

Posted 8 years ago

I am trying to find a Point where the (total RegionDistance) is minimal AND the (total differences of the RegionDistance) is minimal. My Region is described as a Point{x,y,z}. The RegionDistance is calculated from that Point, to coordinates from an Imported datalist.

I imported a list of data (coordinates). These coordinates where extracted using other software. I called the datalist "datalist".

datalist = {{-266.975, -383.042, 480.292}, {-263.628, -368.277, 503.074}, {-268.106, -361.465, 518.117}, {-273.482, -358.017, 528.332}, {-277.5, -355.811, 535.792}, {-280.85, -354.289, 542.026}, {-283.956, -353.106, 547.833}, {-286.787, -352.202, 552.935}, {-289.385, -351.552, 557.265}, {-292.226, -351.178, 561.871}, {-295.844, -351.121, 567.954}, {-300.344, -351.496, 575.58}, {-305.578, -352.461, 584.15}, {-311.314, -354.212, 593.386}, {-317.218, -357.001, 603.47}, {-323.004, -361.026, 614.404}, {-328.593, -366.278, 625.437}, {-333.965, -372.712, 635.733}, {-339.221, -380.354, 645.198}, {-344.533, -389.274, 654.145}, {-350.098, -399.67, 662.712}, {-356.138, -411.914, 670.792}, {-362.658, -426.03, 678.156}, {-368.941, -440.873, 684.229}, {-374.197, -455.25, 688.379}, {-378.292, -469.645, 690.048}, {-381.435, -485.358, 688.75}, {-383.785, -501.49, 685.078}, {-385.436, -514.414, 680.955}, {-386.494, -522.204, 677.427}, {-387.126, -528.599, 672.622}, {-387.474, -537.811, 664.42}, {-387.416, -549.139, 653.169}, {-386.702, -559.515, 640.41}, {-385.16, -567.224, 627.042}, {-382.709, -572.144, 613.204}, {-379.319, -574.336, 599.06}, {-375.085, -574.124, 584.975}, {-370.151, -571.886, 571.369}, {-364.849, -568.068, 558.858}, {-359.59, -563.151, 548.131}}

I calculated the minimal total regiondistance by:

totalregiondistace=NMinimize[Total[Abs[RegionDistance[Point[{x, y, 
z}], datalist]]], {x, y, z}]

I calculated the minimal total difference of the regiondistance by:

totaldiffregiondistance = NMinimize[Total[Abs[
Differences[RegionDistance[Point[{x,y,z}],datalist]]]],{x,y,z}]

These calculations both give a points in space {x,y,z} and a value of the function. I want to find 1 point in space where the two functions are as minimal as possible.

Hi,

I have difficulty to understand the "Total Region Distance" here. RegionDistance is just a unique value that minimally sets an outer point apart from a region. Do you mean the following code? I use Manipulate function to try a set of values for {x,y,z} to locate a possible minimum:

enter image description here

enter image description here

POSTED BY: Shenghui Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract