@extends('layouts.app') @section('center')

Neutral Current Losses Graph

@php function haversineDistance($lat1, $lon1, $lat2, $lon2, $earthRadius = 6371) { $latFrom = deg2rad($lat1); $lonFrom = deg2rad($lon1); $latTo = deg2rad($lat2); $lonTo = deg2rad($lon2); $latDelta = $latTo - $latFrom; $lonDelta = $lonTo - $lonFrom; $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2))); return $earthRadius * $angle; } $previousDevice = null; $totalDistance = 0; $firstpooldistance = null; $i = 1; $graphData = []; @endphp {{-- --}} {{--transformers--}} @foreach($devices as $device) @php $previousDevice = null; @endphp @foreach($device->children as $child) {{-- --}} @php $previousDevice = $child; @endphp @endforeach @php // Number of conductors $nc = $device->nc; // -------------------------- // ANT Conductor Calculation // -------------------------- $area_ant = 54.6 * pow(10, -6); // 54.6 mm² → m² $resistivity_ant = 3.2 * pow(10, -8); // Ω·m for ANT $r_ant = $resistivity_ant * ($totalDistance * 1000 / $area_ant); // Resistance $ncl_ant = pow($nc, 2) * $r_ant; // NCL = NC² × R // -------------------------- // WASP Conductor Calculation // -------------------------- $area_wasp = 100 * pow(10, -6); // 100 mm² → m² $resistivity_wasp = 3.1 * pow(10, -8); // Ω·m for WASP $r_wasp = $resistivity_wasp * ($totalDistance * 1000 / $area_wasp); // Resistance $ncl_wasp = pow($nc, 2) * $r_wasp; // NCL = NC² × R $graphData[$device->global_device_id] = [ 'ant_ncl' => round($ncl_ant, 3), 'wasp_ncl' => round($ncl_wasp, 3), ]; @endphp {{-- Resistance and NCL display --}} {{-- ANT Resistance --}} {{-- WASP Resistance --}} {{-- ANT NCL --}} {{-- WASP NCL --}} @endforeach
@php $deviceLabels = array_keys($graphData); $antNclValues = array_column($graphData, 'ant_ncl'); $waspNclValues = array_column($graphData, 'wasp_ncl'); @endphp

ANT Neutral Current Loss (NCL)

{{--
--}} {{--

WASP Neutral Current Loss (NCL)

--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} @push('scripts') @endpush @endsection()