Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Energy calculation for a single trip (with current)

Energy calculation for a single trip (with current)

In this notebook, we set up a basic simulation where one vessel moves over a 1D network path. We add the ConsumesEnergy and VesselProperties mixins to the vessel object. Based on the vessel and network properties, now also an estimate of the energy that is required to pass the edge at the set speed can be made. This noteboook investigates the effect of adding a current on the overall emission performance.

0. Import libraries

This notebook is executed with OpenTNSim version 1.3.7

1. Define object classes

2. Create graph

Next we create a network (a graph) along which the vessel can move. This case we create a single edge of 100 km exactly.

Loading...
Loading...

3. Run simulation

4. Inspect output

We can now inspect the simulation output by inspecting the vessel.logbook. Note that the Log mix-in was included when we added Movable. The vessel.logbook keeps track of the moving activities of the vessel. For each discrete event OpenTNSim logs an event message, the start/stop time and the location. The vessel.logbook is of type dict. For convenient inspection it can be loaded into a Pandas dataframe.

Loading...

The inspection of the logbook data shows that Vessel moved from its origin (Node 0) to its destination (Node 1). The print statements show that the length of the route from Node 0 to Node 1 is exactly 100 km. At a given speed of 1 m/s the trip duration should be exactly 100000 seconds, as is indeed shown to be the case.

Loading...
Loading...
Loading...
Loading...
Loading...
Sailing from node 0 to node 1 (current 0 m/s): average P_tot 302.9 kW, CO2 emission per m 34.2 g/m, CO2 emissions per s 68.5 g/s
Sailing from node 1 to node 0 (current 0 m/s): average P_tot 302.9 kW, CO2 emission per m 17.1 g/m, CO2 emissions per s 68.5 g/s

The results in the event table, and the graph above, show the effect of current on the overall performance. The same distance obviously takes longer to complete when the current is against, then when it comes from behind. At a fixed speed the vessel emits the same emissions per second no matter if the current is from behind or against. But because it takes longer to pass an edge, the emissions per m are higher with an adverse current than a current from behind.

Loading...