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.

Better ProcessedVariable

See original GitHub issue

@TomTranter has pointed out several times that processed variables need a rethink and I agree. In particular we need to strike the balance between having to pass lots of inputs to ProcessedVariable and storing too much inside the variable object itself. However, we could switch to something better by doing e.g.

voltage = model.variables["Terminal voltage [V]"].process(solution)

where the mesh is stored in the variable and .process created a ProcessedVariable. Or something else? Like

processed_variables = model.process(["Terminal voltage [V]"], solution)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
tinosulzercommented, Dec 12, 2019

Processed variable does 2 things:

  1. Transform column vectors into n-dimensional arrays (up to 5 as you pointed out). Within the model everything is stored as a column vector (e.g. all the particle concentrations are stacked on top of each other), for speed, so it all has to be reshaped at the end in order to get the n-dimensional variables
  2. Set up interpolation, which helps to abstract away having to worry about indices, which of the 5 dimensions corresponds to which, etc

Would the following be ok?

solution["Voltage"] # this is the ProcessedVariable class, with interpolation
solution["Voltage"].data # gives the n-dimensional matrix you want
solution.data # gives dictionary of n-dimensional arrays
solution.save(filename) # saves only the data arrays, to a dictionary
1reaction
tinosulzercommented, Dec 12, 2019

Yes that sounds like the best way forward. We could also have the default being “don’t process any variables in solution” and then have a solution.update(variables) (or .process or .set) which processes any variables using the existing t and y. I think simulation is still useful and separate for everything leading up to obtaining the solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Process variable - Wikipedia
In control theory, a process variable is the current measured value of a particular part of a process which is being monitored or...
Read more >
Optimizing related process variables for profitability - ISA
Other functions in a DCS can guide operators to optimize related process variables for more profitable and reliable production. These key process variables...
Read more >
What is process variable and types of process variables?
A variable is something that can vary or change. Because process variables can and do change, instrumentation systems measure the variable then ...
Read more >
Understanding Key Process Variables - Phoenix Group
If we understand, by measurement, the current level of variation we can gain a better understanding of which inputs are Key inputs to...
Read more >
Process Variable - an overview | ScienceDirect Topics
Some process variables are more important than others, in that if they are optimally controlled, they ensure optimal operation of the process (Morari, ......
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