Road elevations from Latitudes and Longitudes

4 views (last 30 days)
I have a list of Latitudes, longitudes and Altitudes for a few hundred data points. I need a code to find the road elevations at this particular position and also calculate the energy the vehicle requires/ consumes to make this climb or descent.

Answers (1)

Aishwarya
Aishwarya on 10 Oct 2023
Hi Arcot,
As per my understanding, you have latitude, longitude, and altitude data of some points and from this data you want to calculate road elevation at each point and calculate the total energy required by the vehicle to climb to or to descent from this point.
Please find below an example implementation of the required code. However, I would like to note a few assumptions made during the implementation:
  • The weight of the vehicle is assumed to be 1000kg.
  • The vehicle engine is considered to be 100% efficient.
  • The minimum altitude is used as the reference point for calculating the elevation.
latitudes = [37.7749, 37.7749, 37.7749]; % Replace with your actual latitudes data
longitudes = [-122.4194, -122.4194, -122.4194];% Replace with your actual longitudes data
altitudes = [50, 100, 200]; % Replace with your actual altitude data
% Elevation calculation at each point
elevation = altitudes - min(altitudes);
% Compute energy required for climb/descent
weight = 1000; % kg (vehicle weight)
efficiency = 1; % efficiency factor (adjust as needed)
g = 9.81; % m/s^2
delta_alt = diff(altitudes); % calculating difference between adjacent altitudes.
energy_change = weight * g * delta_alt / efficiency;
total_energy_consumption = sum(energy_change);
disp("Total energy consumption: "+total_energy_consumption+" Joules")
Total energy consumption: 1471500 Joules
Please note that the provided links below contain documentation that you may find helpful for further reference:
Hope this help!
Regards,
Aishwarya Palli

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!