Dandeliion Client documentation

The Dandeliion client provides a pybamm-like python interface to run and access simulations on a remote Dandeliion server instance.

Installation

The Dandeliion client can be installed directly from pypi using pip with the following command:

pip install dandeliion-client

Example

The following code is an example for how to write a python script to run a simulation:

import dandeliion.client as dandeliion
import numpy as np
import matplotlib.pyplot as plt
from pybamm import Experiment

credential = ("juser", "dandeliion")
simulator = dandeliion.Simulator(credential)

params = 'example_bpx.json'
experiment = Experiment(
  [
      (
          "Discharge at 10 A for 100 seconds",
          "Rest for 10 seconds",
          "Charge at 6 A for 100 seconds",
      )
  ]
  * 2,
  termination="250 s",
  period="1 second",
)

var_pts = {"x_n": 16, "x_s": 8, "x_p": 16, "r_n": 16, "r_p": 16}

initial_condition = (
  {
      "Initial concentration in electrolyte [mol.m-3]": 1000.0,
      "Initial state of charge": 1.0,
      "Initial temperature [K]": 298.15,
  }
)

solution = dandeliion.solve(
      simulator=simulator,
      params=params,
      model='DFN',
      experiment=experiment,
      initial_condition=initial_condition,
      var_pts=var_pts,
))

plt.plot(
    solution["Time [s]"],
    solution["Current [A]"],
    label="DandeLiion",
)  # Current vs Time

where the following classes & methods have been used:

dandeliion.client.Simulator

Data class containing informations about simulation server.

dandeliion.client.Experiment

Base class for experimental conditions under which to run the model.

dandeliion.client.Solution

Dictionary-style class for the solutions of a simulation run returned by solve().

dandeliion.client.solve

Method for submitting/running a Dandeliion simulation.