8000 RunningAverage by JonathanMaes · Pull Request #347 · mumax/3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RunningAverage #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 29, 2024
Merged

RunningAverage #347

merged 6 commits into from
Nov 29, 2024

Conversation

JonathanMaes
Copy link
Contributor

This PR adds 3 new functions for manipulating (custom) Quantitys:

  • RunningAverage(): tracks the running average over time of a given Quantity (for each cell individually, so this function also returns a full Quantity). The averaging takes the time step into account: when advancing a time step $$dt$$, the average will be updated based on the previous average $$a(t)$$ and the value $$q(t+dt)$$ of the quantity after the step :

    $$a(t+dt) = \frac{t \cdot a(t) + dt \cdot q(t+dt)}{t+dt}$$

  • Sum() and SumVector(): the total of the Quantity, summed over all cells in the simulation grid.

    • Sum() returns a scalar float64 and can be used for both scalar and vector quantities. For a vector quantity, all components will be added together.
    • SumVector() returns a data.Vector and can only be used for vector quantities.

@JLeliaert JLeliaert merged commit 01f1534 into 3.11 Nov 29, 2024
@JLeliaert JLeliaert deleted the feature/runningAverage branch November 29, 2024 15:13
@JonathanMaes JonathanMaes mentioned this pull request Dec 3, 2024
5FF4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0