Skip to content

MTK: Scaling of time/parametric plots? #2076

@B-LIE

Description

@B-LIE

I have unsuccessfully tried to figure out how to scale time plots (and generally: parametric plots) when plotting solutions from simulations using MTK models.

Scaling of results is quite important. Often, one uses SI units to make unit compatibility simple. But presenting results in SI units is often not elegant... It is often better to present pressures in atm or bar than in Pa. It is often better to present temperature in centigrades (or Fahrenheit) than in Kelvin. And wrt. time... sometimes minutes or days are better units than seconds.

Suppose the solution sol from simulating an MTK model contains state x (e.g., pressure) and observable variable y (e.g., temperature).

I can then plot x with either of the following commands:

plot(sol, idxs = x)
# or
plot(sol, idxs = [x])

If I want to plot both x and y as functions of time t, I do

plot(sol, idxs = [x,y])

If I instead want a parametric plot, I do

plot(sol, idxs = (x,y))
# or
plot(sol, idxs = [(x,y)])

I can also plot the time function x as the "parametric plot"

plot(sol, idxs = (t,x))

If I want to scale variables in time plots, I can do, e.g.,

plot(sol, idxs = [x/1e5, y-273.15])
  • What if I want to scale both time and variable? I have tried with:
plot(sol, idxs = (t/60, x/1e5))

but this crashes.

  • Question: What is the correct way to scale both variables in a parametric plot?
  • If this is not possible, it would be very useful if support for such a scaling is added.
  • The most general solution is to add scaling for parametric plots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions