Skip to content

Commit

Permalink
Prep for v0.1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
c-randall committed Dec 26, 2024
1 parent 64a022f commit 67dc209
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 3 additions & 11 deletions docs/jupyter_execute/examples/ramping.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/jupyter_execute/user_guide/basic_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"output_type": "stream",
"text": [
"CycleSolution(\n",
" solvetime=0.006 s,\n",
" solvetime=0.011 s,\n",
" success=[True, True],\n",
" status=[2, 1],\n",
" nfev=[257, 69],\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/source/examples/ramping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -101,7 +101,7 @@
"dynamic_load = thev.loadfns.Ramp2Constant(20*75/1e-3, 20*75)\n",
"\n",
"expr = thev.Experiment()\n",
"expr.add_step('current_A', dynamic_load, (180., 0.5), limits=('voltage_V', 3.))\n",
"expr.add_step('current_A', dynamic_load, (360., 0.5), limits=('voltage_V', 3.))\n",
"\n",
"soln = model.run(expr)\n",
"soln.plot('time_s', 'current_A')\n",
Expand All @@ -125,7 +125,7 @@
"outputs": [],
"source": [
"expr = thev.Experiment()\n",
"expr.add_step('current_A', 75*20, (180., 75), limits=('voltage_V', 3.))\n",
"expr.add_step('current_A', 75*20, (180., 50), limits=('voltage_V', 3.))\n",
"\n",
"soln2 = model.run(expr)\n",
"\n",
Expand Down Expand Up @@ -168,7 +168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion src/thevenin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from . import loadfns
from . import plotutils

__version__ = '0.2.0.dev'
__version__ = '0.1.2'

__all__ = [
'IDASolver',
Expand Down
4 changes: 3 additions & 1 deletion src/thevenin/loadfns/_ramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def __repr__(self) -> str: # pragma: no cover
def __call__(self, t: float) -> float:

linear = self._m*t + self._b
sigmoid = 1. / (1. + np.exp(-self._sharpness*(linear - self._step)))

z = self._sharpness*(linear - self._step)
sigmoid = 1. / (1. + np.exp(-np.clip(z, -700, None)))

return (1. - sigmoid)*linear + sigmoid*self._step

0 comments on commit 67dc209

Please sign in to comment.