Skip to content

Commit

Permalink
Updated docs and some static files
Browse files Browse the repository at this point in the history
  • Loading branch information
iSOLveIT committed Jun 9, 2023
1 parent d96b05f commit 79585fd
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 23 deletions.
14 changes: 14 additions & 0 deletions carculator_truck/driving_cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@


def get_driving_cycle(size: list, name: str) -> np.ndarray:
"""
Get driving cycle.
:param size: List of vehicle sizes.
:param name: The name of the driving cycle.
:return: :meth:`ndarray` object
"""
return get_standard_driving_cycle_and_gradient(
vehicle_type="truck",
vehicle_sizes=size,
Expand All @@ -11,6 +18,13 @@ def get_driving_cycle(size: list, name: str) -> np.ndarray:


def get_road_gradient(size: list, name: str) -> np.ndarray:
"""
Get road gradient data.
:param size: List of vehicle sizes.
:param name: The name of the driving cycle.
:return: :meth:`ndarray` object
"""
return get_standard_driving_cycle_and_gradient(
vehicle_type="truck",
vehicle_sizes=size,
Expand Down
Binary file modified docs/_static/resources/examples.zip
Binary file not shown.
22 changes: 12 additions & 10 deletions docs/structure.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.. _structure:

Structure
=========

.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/coarse.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/coarse.png?raw=true
:width: 900
:alt: Alternative text

Modules
-------

Composed of eight modules to build the car models:
Composed of eight modules to build the truck models:

* Driving cycle module
* Mass module
Expand All @@ -24,31 +26,31 @@ Additionally, three modules are used to:
* configure energy systems for the background model (background systems module)
* build and solve the life cycle inventory of cars (inventory module)
* export the life cycle inventory of cars (export module)

Driving cycle module
--------------------

.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/driving_cycle.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/driving_cycle.png?raw=true
:width: 400
:alt: Alternative text

Mass module
-----------

.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/mass_module.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/mass_module.png?raw=true
:width: 900
:alt: Alternative text

Auxiliary energy module
-----------------------

.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/aux_energy.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/aux_energy.png?raw=true
:width: 900
:alt: Alternative text

Motive energy module
--------------------

.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/motive_energy.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/motive_energy.png?raw=true
:width: 900
:alt: Alternative text
5 changes: 3 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.. _usage:

Using Carculator truck
Using Carculator Truck
======================

Static vs. Stochastic mode
--------------------------

.. note::

Many examples are given in this `notebook <https://github.com/romainsacchi/carculator_truck/blob/master/examples/Examples.ipynb>`_ which you can run directly on your computer.
Many examples are given in this :download:`examples.zip file <_static/resources/examples.zip>` which contains a Jupyter notebook
you can run directly on your computer.

The inventories can be calculated using the most likely value of the given input parameters ("static" mode), but also using
randomly-generated values based on a probability distribution for those ("stochastic" mode).
Expand Down
29 changes: 18 additions & 11 deletions docs/validity.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _validity:

Validity tests
==============

Expand Down Expand Up @@ -46,7 +48,7 @@ Manually, such parameters can be obtained the following way:
acceleration = np.zeros_like(velocity)
acceleration[1:-1] = (velocity[2:] - velocity[:-2])/2
Using `carculator`, these parameters can be obtained the following way:
Using ``carculator``, these parameters can be obtained the following way:

.. code-block:: python
Expand Down Expand Up @@ -84,7 +86,9 @@ And the acceleration returned by carculator should equal the values given by the
True
Which can be also be verified visually::
Which can be also be verified visually:

.. code-block:: python
plt.plot(driving_cycle['m/s²'].values, label='UNECE')
plt.plot(acceleration, label='Manually calculated')
Expand All @@ -95,9 +99,10 @@ Which can be also be verified visually::
plt.savefig('comparison_driving_cycle.png')
plt.show()
.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/comparison_driving_cycle.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/comparison_driving_cycle.png?raw=true
:width: 400
:alt: Alternative text
:alt: Comparison driving cycle
:align: center

Car and components masses
-------------------------
Expand Down Expand Up @@ -142,9 +147,10 @@ However, most of the driving mass is explained by the curb mass:
parameter=['total cargo mass', 'curb mass']).values).tolist(), labels=['Total cargo mass', 'Curb mass'])
plt.show()
.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/pie_total_mass.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/pie_total_mass.png?raw=true
:width: 400
:alt: Alternative text
:alt: Pie Total Mass
:align: center

Here is a split between the components making up for the curb mass.
One can see that, in the case of a battery electric SUV, most of the weight comes from the glider as well as the battery cells.
Expand Down Expand Up @@ -204,17 +210,18 @@ On an equivalent diesel powertrain, the mass of the glider base is comparatively
plt.subplots_adjust(wspace=1)
plt.show()
.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/pie_mass_components.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/pie_mass_components.png?raw=true
:width: 900
:alt: Alternative text

:alt: Pie Mass Components
:align: center


The `curb mass` returned by ``carculator`` for the year 2010 and 2020 is further calibrated against manufacturers' data, per vehicle size class and powertrain technology.
For example, we use the car database `Car2db <https://car2db.com/>`_ and load all the vehicles produced between 2015 and 2019 (11,500+ vehicles) to do the curb mass calibration for 2020 vehicles.
The same exercise is done with vehicles between 2008 and 2012 to calibrate the curb mass of given by carculator for vehicles in 2010.


.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/mass_comparison.png
.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/mass_comparison.png?raw=true
:width: 900
:alt: Alternative text
:alt: Mass Comparison
:align: center

0 comments on commit 79585fd

Please sign in to comment.