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

Finding variable in equation? #78

Open
aalpersen opened this issue Apr 11, 2023 · 2 comments
Open

Finding variable in equation? #78

aalpersen opened this issue Apr 11, 2023 · 2 comments
Labels
enhancement Indicates new feature requests

Comments

@aalpersen
Copy link

Is it possible to find/calculate variable from equation?

Parser pdebug = Parser();
Expression expdebug = pdebug.parse("(((x) - 32)/1.8)+273.15")

So I have that this equation is equal to 50. So for I want "50 = (((x) - 32)/1.8)+273.15. Find x?

Thank you

@fkleon fkleon added the enhancement Indicates new feature requests label Apr 12, 2023
@fkleon
Copy link
Owner

fkleon commented Apr 12, 2023

Hi @aalpersen, solving equations is not possible with this library, it can only evaluate expressions.

You might find a package like equations more suitable for this task.

There you can solve your example equation by finding the root for:
$50 = \frac{(x) - 32)}{1.8} + 273.15 \iff 0 = \frac{(x) - 32)}{1.8} + 273.15 - 50$

@aalpersen
Copy link
Author

Ok, thanks for input and your awesome library.

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

No branches or pull requests

2 participants