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

Inconsistent display of equations with and without connectors #1311

Open
hersle opened this issue Oct 18, 2024 · 8 comments
Open

Inconsistent display of equations with and without connectors #1311

hersle opened this issue Oct 18, 2024 · 8 comments

Comments

@hersle
Copy link
Contributor

hersle commented Oct 18, 2024

Because systems of equations with and without connectors are displayed in different Latex environments, they are displayed without and with alignment, respectively. This makes the ModelingToolkit big RC circuit tutorial equations unreadable:

Bad (before structural_simplify())

image

Good (after structural_simplify())

image

@ChrisRackauckas
Copy link
Member

oh that's not good 😅

@ChrisRackauckas
Copy link
Member

why would connectors be in a different environment?

@hersle
Copy link
Contributor Author

hersle commented Oct 18, 2024

They are currently displayed in this "function form", which does not have an equality sign that makes sense to align with:

image

@hersle
Copy link
Contributor Author

hersle commented Oct 18, 2024

One way to fix it would be to show equations(expand_connections(sys)) instead of equations(sys). But that would have to be done in ModelingToolkit, since expand_connections() is only defined there. And that would not fix the general problem in Symbolics.

Are connections used at all in Symbolics? I can't find it in any example or test. Or is it some historic remnant from Symbolics including (parts of?) ModelingToolkit before?

@ChrisRackauckas
Copy link
Member

Are connections used at all in Symbolics? I can't find it in any example or test. Or is it some historic remnant from Symbolics including (parts of?) ModelingToolkit before?

Connections don't make sense in the Symbolics world. They really require systems to make sense.

They are currently displayed in this "function form", which does not have an equality sign that makes sense to align with:

What about just displaying it as 0 = connect?

@hersle
Copy link
Contributor Author

hersle commented Oct 19, 2024

I suppose that would fix it, yes. That might require some some changes in MTK, since it affect more than just the Latex rendering to be consistent throughout MTK.

@hersle
Copy link
Contributor Author

hersle commented Oct 19, 2024

Connections don't make sense in the Symbolics world. They really require systems to make sense.

Then I also think this connector equation logic should be moved to MTK.

@ChrisRackauckas
Copy link
Member

yes that would make sense.

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

2 participants