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

valid ways to write equations using the DSL #1044

Open
vyudu opened this issue Sep 4, 2024 · 2 comments
Open

valid ways to write equations using the DSL #1044

vyudu opened this issue Sep 4, 2024 · 2 comments

Comments

@vyudu
Copy link
Collaborator

vyudu commented Sep 4, 2024

Might be worth thinking about allowing more complicated derivative expressions on the left side of differential equations.

@reaction_network begin
    @variables A(t) B(t)
    @equations D(A) + D(B) ~ A
end

f(A, t) = 2*A*t
@reaction_network begin
    @variables A(t) B(t)
    @equations f(A, t)*D(A) ~ A + B
end

This latter one may be complicated since we probably want to escape the f(A, t) but not the D(A)? @TorkelE would it be easy to change the DSL code to allow for stuff like this?

I assume we want both of the following to work?

f(A, t) = 2*A*t
@reaction_network begin
    @variables A(t) B(t)
    @equations f(A, t) ~ A + B
end

@reaction_network begin
    @variables A(t) B(t)
    @equations A + B ~ f(A, t)
end
@vyudu vyudu changed the title valid ways to pass equations using the DSL valid ways to write equations using the DSL Sep 4, 2024
@isaacsas
Copy link
Member

isaacsas commented Sep 4, 2024

Yes, it would be nice if all of these are supported (assuming they work in the symbolic interface).

@TorkelE
Copy link
Member

TorkelE commented Sep 5, 2024

All this should work (sans any function related its). Anything that is a valid equation normally should also work in the DSL. However, it is only in the case of D(V) ~ ... (Where there are no differentials on the RHS) Where we automatically under that V is a variable.

If you check the texts added here #815 you can see all the details of how it work.

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

No branches or pull requests

3 participants