TUDelft-CITG / halem

HALEM is a python package for optimizing shipping routes. This package provides an algorithm for optimizing the route for a given hydrodynamic model.
https://halem.readthedocs.io
MIT License
12 stars 4 forks source link

HALEM with ROMS model in simple setup #8

Closed Pietervanhalem closed 2 years ago

Pietervanhalem commented 4 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Pietervanhalem commented 4 years ago

Hi Pieter, I am trying to use HALEM to optimize swim route using ROMS ocean currents ;) To do that I wrote class flow_ROMS that is reading model nodes, currents etc from the opendap roms server taking into account mask. All looks fine, structure etc, till the actual optimization part where it is not working. I think I have more/less reading and pre-processing right. From the swimming optimization I do not need all functionality of halem, so wondering if it is possible to disable those computations (i.e. under keel clearance, vessel draft etc.). I put them to something but sill complaining about computations and overflow.

Any comment is more than welcome! Thanks for your time in advance. Attached is example I tried. Regards, Ivica


Hi @ivicajan,

How nice to hear you want to use my model! One remark concerning versions. Please use version 0.3.1. This is the version distributed to PyPi and this is the last version for which the tests passes.

The source code of the package is available at https://github.com/TUDelft-CITG/HALEM. This repository only contains the scripts I used for my graduation. I just gave you read accesses so you can fork (version 0.3.1) the HALEM repo and change it according to your wishes.

If you want to exclude the vessel behaviour you can exclude the squat function in halem/Functions.py line 31-60 and line 118. This is the only vessel-specific property that is added in HALEM. If you remove this function you don't need water depth, WWL, ukc, WVPI, and WD_min anymore.

Your script looks really nice! I think if you exclude squat form the calculation you can really use my package for some route optimisation. If you want more detail behind the development of the HALEM package you can look into my graduation thesis.

If you have any further questions please let me know!

ivicajan commented 4 years ago

Hi Pieter, That's exactly what I did, commented Squat call and using vship as it is. One thing that is strange is using x and y as lat and lon, while intuitively in my head it is the opposite i.e. lat=y and lon=x direction. When I changed that as well I got the shortest route which make sense (ocean currents were small anyway). Will try with smaller vship to see the diffs.

It is cool that is all based on fem, triangulation makes all more physical and in mathematical sense better. The another "feature" what would be nice is if you are using finite element or finite volume model output you would like to use triangulation from the model grid and not delaunay call from scipy. I know you are using find_neigh from it, but think it would be cool to use original nodes and triangles and from that compute inside the code neighbours matrix (for as many layers you want) and do not use delaunay scipy call which can introduce funny things over the land i.e. not using land as hole but creating convex hull...

I will pull new version tmrw.

Cheers, Ivica

BTW I read your dissertation, nice piece of work!

Sent from my mobile, possible typos


From: Pietervanhalem notifications@github.com Sent: Monday, March 9, 2020 5:09:51 PM To: TUDelft-CITG/HALEM HALEM@noreply.github.com Cc: Ivica Janekovic ivica.jan@gmail.com; Mention mention@noreply.github.com Subject: Re: [TUDelft-CITG/HALEM] HALEM with ROMS model in simple setup (#8)

Hi Pieter, I am trying to use HALEM to optimize swim route using ROMS ocean currents ;) To do that I wrote class flow_ROMS that is reading model nodes, currents etc from the opendap roms server taking into account mask. All looks fine, structure etc, till the actual optimization part where it is not working. I think I have more/less reading and pre-processing right. From the swimming optimization I do not need all functionality of halem, so wondering if it is possible to disable those computations (i.e. under keel clearance, vessel draft etc.). I put them to something but sill complaining about computations and overflow.

Any comment is more than welcome! Thanks for your time in advance. Attached is example I tried. Regards, Ivica


Hi @ivicajanhttps://github.com/ivicajan,

How nice to hear you want to use my model! One remark concerning versions. Please use version 0.3.1. This is the version distributed to PyPi and this is the last version for which the tests passes.

The source code of the package is available at https://github.com/TUDelft-CITG/HALEM. This repository only contains the scripts I used for my graduation. I just gave you read accesses so you can fork (version 0.3.1) the HALEMhttps://github.com/TUDelft-CITG/HALEM repo and change it according to your wishes.

If you want to exclude the vessel behaviour you can exclude the squathttps://en.wikipedia.org/wiki/Squat_effect function in halem/Functions.py line 31-60 and line 118. This is the only vessel-specific property that is added in HALEM. If you remove this function you don't need water depth, WWL, ukc, WVPI, and WD_min anymore.

Your script looks really nice! I think if you exclude squat form the calculation you can really use my package for some route optimisation. If you want more detail behind the development of the HALEM package you can look into my graduation thesishttps://repository.tudelft.nl/islandora/object/uuid%3A5d34d333-34fe-4181-95b6-d8d82f72d979?collection=education.

If you have any further questions please let me know!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/TUDelft-CITG/HALEM/issues/8?email_source=notifications&email_token=AEN4TMCGPPWGYTSQDHRQLKLRGSW57A5CNFSM4LEEDO4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOGIAIY#issuecomment-596410403, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEN4TMA46G53K7RU4LTENI3RGSW57ANCNFSM4LEEDO4A.

Pietervanhalem commented 4 years ago

Hi Ivica,

It is indeed a bit of a weird feature the lat., lon. are described with x,y. Maybe in a future refactoring this will be solved. However, lat. should be x and lon. should be y (see link). If you mix them up the Haversine function will give a wring result.

During my graduation, I thought a lot about the point you made. I chose for the for the Delauney triangulation because the orriginal grid will be mixed up when you increase the directional resolution. For cases with nb > 1 the algorithm will create edges between more points than the original grid. Even if you would use the original FM grid It would still create edges over land (for cases with nb>1). Since, computations with nb=1 are almost never reliable I choose to make the model simpler and use a TIN instead of a FM.

For the funny things over land I suggest added nodes on land with u,v,wd = 0. This will prevent the bugs.

Pieter