Git Product home page Git Product logo

p2d_fast_solver's Introduction

P2D Solver

by Rachel Han, Brian Wetton and Colin Macdonald

This repository contains the solver for pseudo-2D model of Li-ion battery based on Finite Difference Method with automatic differentiation via JAX.

The model is taken from the P2D model outlined in the paper by Torchio et al.

Getting started

  • pip install numpy scipy (or get these from your OS)
  • pip install jax[cpu]
  • pip install scikit-umfpack

Then run examples/main_reorder.py.

p2d_fast_solver's People

Contributors

hanrach avatar cbm755 avatar

Stargazers

goon avatar Pierre Kestener avatar  avatar Weipeng XU avatar  avatar  avatar Cody Zhao avatar Chaitanya Singh avatar Qi Zhang avatar  avatar  avatar  avatar

Watchers

 avatar James Cloos avatar pixor avatar  avatar

p2d_fast_solver's Issues

known-good dep versions

I'm going to track dependencies of what I need to get this running again. This should be used to create a virtual env for reproducibility. See also #7

So far:

Ubuntu 20.04
Python 3.8
sudo apt install libsuitesparse-dev swig
pip install scikit-umfpack==0.3.2
pip install jax==0.2.20 jaxlib==0.1.71

Newer Jax would probably require some effort. I could not get old 0.2.20 jax to work on Python 3.10:

Traceback (most recent call last):
  File "/home/cbm/work/People/Rachel_Han/p2d_fast_solver.git/examples/main_reorder.py", line 1, in <module>
    from jax.config import config
    from jax._src.numpy import lax_numpy
  File "/home/cbm/.local/lib/python3.10/site-packages/jax/_src/numpy/lax_numpy.py", line 53, in <module>
    from jax._src.ops import scatter
  File "/home/cbm/.local/lib/python3.10/site-packages/jax/_src/ops/scatter.py", line 31, in <module>
    from typing import EllipsisType
ImportError: cannot import name 'EllipsisType' from 'typing' (/usr/lib64/python3.10/typing.py)

document cM and cMp parameters

@jsfeng-fudan asked:

The Qrev() function prototype is Qrev(j,Tc,cM,cMp,cmax). I dont know the meaning of cM and cMp, I can usig the umat_pe to replace them.
can you help me to solve this problem?

need help for heat compute in charge and discharge cycle.

Hi@hanrach,
I study to use the code to compute the heat during charge and discharge cycle. but the code do not provide example to consult with. I try to modified the code as below (naive/p2d_main_fn.py)

图片

I can obtain the Ohm heat and rxn heat, but can not arrive at reversible heat.
图片
It is appreciated if you help me to solve this problem.

Is numba a dep?

I didn't install numba, and can run the main codes but in utils/banded_matrix.py I see:

import numba as nb

make dependencies clearer

I think the recommended imports are:

import stuff_from_python_stdlibs
import more_stuff_from_python_stdlibs
<blank line>
import packages_like_scipy
import and_numpy
<blank line>
import local_stuff

Not urgent but we should reorder some of the files to follow this. I'm a little hesitant in case the order matters with some of the jax stuff...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.