question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect values for y axis in 2D simulation?

See original GitHub issue

Describe the bug

This might not be a bug but just me not understanding how to do things properly (PyBaMM beginner…). When using a 2+1D pouch cell model, the plot uses values for the y (horizontal) axis which are not what I would expect based on the Electrode width parameter setting.

To Reproduce Steps to reproduce the behaviour:

import pybamm

options = {"cell geometry": "pouch", "thermal": "x-lumped", "dimensionality": 2}
model = pybamm.lithium_ion.SPM(options=options)
geometry = model.default_geometry

parameter_values = model.default_parameter_values
parameter_values.update(
    {
        "Electrode height [m]": 0.3,
        "Electrode width [m]": 0.1,
        "Negative tab width [m]": 0.03,
        "Positive tab width [m]": 0.03,
        "Negative tab centre y-coordinate [m]": 0.03,
        "Positive tab centre y-coordinate [m]": 0.07,
        "Negative tab centre z-coordinate [m]": 0.3,
        "Positive tab centre z-coordinate [m]": 0.3,
    }
)
parameter_values.process_model(model)
parameter_values.process_geometry(geometry)

sim = pybamm.Simulation(model, parameter_values=parameter_values, solver=pybamm.CasadiSolver("fast"))
sim.solve([0, 60])

Expected behaviour

I expected the horizontal axis (y) to extend from 0 to 10 cm.

Screenshots

image

Additional context

Using PyBaMM 0.3.0 or current master (no difference). Python 3.8.5.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tinosulzercommented, Feb 5, 2021

FYI, you can pass the plot function a “spatial_unit” argument to display mm or m instead of um https://pybamm.readthedocs.io/en/latest/source/plotting/quick_plot.html

0reactions
DavidMStraubcommented, Feb 6, 2021

Thanks for the quick fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

problem in 2D simulation? - Forums - CFD Online
Hi dear friends i want simulating one spillway as shown follow in 2D, i using version 14, in previous version like v12 for...
Read more >
Excel Charts Displaying Incorrect Values on Vertical Axis
I am creating charts in Excel 2010; when I select data and create the chart, the vertical axis amounts do not agree with...
Read more >
Problem in generation of 2d model - Ansys Learning Forum
I'm trying to generate a model of cooling tower using axisymmetric but the problem is that i dont know how to place it...
Read more >
Unable to plot displacement vs time graph - COMSOL
I am using 2D plot Group and adding Parameterized Curve 2D in Data Sets. Also, I am not able to get the correct...
Read more >
Invalid Curves for 2D Axisymmetric Models - PTC Support
For example, no curve can cross or lie on the Y axis. To ensure this, Creo Simulate enforces a rule that all model...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found