Skip to content

Commit

Permalink
#763 fixing examples
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Dec 26, 2019
1 parent de91e3b commit 790b744
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 9 additions & 9 deletions examples/notebooks/change-input-current.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "118979747d4f418982a358d3769dc257",
"model_id": "000da8e81b0b4e91984553ba15ba179c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.00787878787878788, step=0.005), Output()),"
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.0036363636363636364, step=0.005), Output()…"
]
},
"metadata": {},
Expand Down Expand Up @@ -134,7 +134,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "397b778427504eb8ac88b53de8397683",
"model_id": "cc4fd2e7c9ea4129a7acf0e519fea268",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -177,12 +177,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4acb95c01295406db377f5dd1593e014",
"model_id": "84f6cac9b14f43a1907322e650f3c9f8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.057314594406781015, step=0.001), Output())…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.026550306076661374, step=0.001), Output())…"
]
},
"metadata": {},
Expand Down Expand Up @@ -301,12 +301,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "19720a31f3964e55b01905476f50393a",
"model_id": "09ced8a9e10b4e769a9b4cc8573b7fa2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.0028657297203390506, step=0.00014328648601"
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.0013275153038330688, step=6.63757651916534"
]
},
"metadata": {},
Expand All @@ -324,7 +324,7 @@
"# Example: simulate for 30 seconds\n",
"simulation_time = 30 # end time in seconds\n",
"tau = param.process_symbol(pybamm.standard_parameters_lithium_ion.tau_discharge).evaluate(0)\n",
"npts = 50 * simulation_time * omega # need enough timesteps to resolve output\n",
"npts = int(50 * simulation_time * omega) # need enough timesteps to resolve output\n",
"t_eval = np.linspace(0, simulation_time / tau, npts)\n",
"solution = model.default_solver.solve(model, t_eval)\n",
"label = [\"Frequency: {} Hz\".format(omega)]\n",
Expand Down Expand Up @@ -361,7 +361,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 3 additions & 1 deletion examples/scripts/compare_comsol/compare_comsol_DFN.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def myinterp(t):
comsol_phi_n = get_interp_fun("phi_n", ["negative electrode"])
comsol_phi_e = get_interp_fun("phi_e", whole_cell)
comsol_phi_p = get_interp_fun("phi_p", ["positive electrode"])
comsol_voltage = interp.interp1d(comsol_t, comsol_variables["voltage"])
comsol_voltage = interp.interp1d(
comsol_t, comsol_variables["voltage"], fill_value="extrapolate", bounds_error=False
)

# Create comsol model with dictionary of Matrix variables
comsol_model = pybamm.BaseModel()
Expand Down

0 comments on commit 790b744

Please sign in to comment.