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

A question about the parameter function #756

Closed
HaojieZhang917 opened this issue Sep 11, 2024 · 1 comment
Closed

A question about the parameter function #756

HaojieZhang917 opened this issue Sep 11, 2024 · 1 comment
Labels

Comments

@HaojieZhang917
Copy link

Question❓
There is a example about solving nonhomogeneous equations using parameter function in the tutorials.In that case,parameter is introduced as a function which is time-varying like this.
M = t -> 0.1sin(t)
prob = ODEProblem(pendulum!, u₀, tspan, M)
But in my ODE,there is four time-varying parameter equations needed to introduce.I try to introduce the parameter function as a tuple which include four time-varying parameter equations,but it seems wrong.
So what can i do to solve this question?

@ChrisRackauckas
Copy link
Member

Is there any reason for not just using it as a standard generic function? Just make M(t) = 0.1sin(t) and use it in f?

You could also just make it a tuple, and that's type-stable for indexing, but I don't see why you wouldn't just make generic functions.

Closing since there isn't a change to the docs to be made, but feel free to continue the conversation. Or discourse.julialang.org might be a good place to discuss this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants