[Python] Determining Triangle and Calculating Loss Using Delaunay Triangulation and...

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    x1 y1 z1 x2 y2 z2 x3 y3 z3 15 18900 1063.952697 5 18900 1069.478545 15 16800 1064.647503 55 8400 973.9298405 45 8400 1021.397344 55 6300 977.7152267 25 16800 1062.942534 25 18900 1062.441473 15 18900 1063.952697 15 21000 1060.2029 15 18900 1063.952697 25 18900 1062.441473 65 15750 1053.946865 65 12600 958.5607489 75 12600 1120.727868 25 10500 1066.723837 15 12600 1066.793667 15 10500 1067.138918 25 2100 1072.249754 15 2100 1071.014366 25 1050 1071.602364 45 8400 1021.397344 45 6300 1021.804616 55 6300 977.7152267 25 1050 1071.602364 15 2100 1071.014366 15 1050 1072.376083 I have Delaunay triangulation data in the form of vertices like this: This Delaunay triangulation has been generated from my measured data points of SOC, power, and loss in MATLAB. I have extracted this data into a Delaunay triangle file and want to integrate this into my Python optimization code.

    In my Python code, I have SOC and power values, and I want to determine in which triangle these two points lie. After identifying the triangle, I want to calculate the loss using the barycentric method.

    So, I want to confirm if I am taking the correct approach and whether there are any specific functions in Python or other methods that can help me determine the triangle in which the points fall and subsequently calculate the loss. Could you please guide me if this approach is valid or if there is a more efficient method available? as i am doing multiple data point for each period so is it possible that this points are falling more than one tringle

    I am expecting the code with logic eventhough i have tried but i got wrong result

    Continue reading...

Compartilhe esta Página