Skip to content
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

Runwhile support (limited) #84

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

SeregaKR
Copy link
Contributor

@SeregaKR SeregaKR commented Mar 1, 2024

I tried to separate it into two pull requests as asked. This is the proposed change for RunWhile support.

I personally also don't have much experience with RunWhile - I'll check with some of my colleagues for use cases. For now I suggest introducing the most widely used scenarios and letting the users pass other conditions directly as string.

@SeregaKR
Copy link
Contributor Author

SeregaKR commented Mar 1, 2024

Waiting for a reply from colleagues. But by quick Googling, there are a few common scenarios that I think should be implemented:

  1. MaxTorque < some value
  2. mx or mz (probably also my) > some value. Here it is usually passed to mumax3 as m.comp(0) for mx or m.comp(3) for mz and applying average().
    RunWhile(m.Comp(3).average() > -0.94)
  3. These two cases are also often combined with a maximum time limit:
    RunWhile(m.Comp(3).average() > -0.94 && t < 5e-9)

I think we should have a parameter for the time limit, comparison (like > or <) and number. The question is should we have separate parameters for each magnetization component or just pass the name.

td.drive(system, t=5e-9, cmp=">", mz=-0.94) or td.drive(system, t=5e-9, cmp=">", p_value=-0.94, p_name="mz")

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.

None yet

1 participant