-
Notifications
You must be signed in to change notification settings - Fork 45
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
The ce.assign() function not working properly #120
Comments
In LaTeX, (BTW, |
@arnog Really appreciate your really fast response Please look at my code-sandbox: https://codesandbox.io/s/infallible-worker-kdshn7?file=/src/App.js But in most cases, I need to use complex formulas. like updated on my sandbox. in sandbox added required equation. Steps to Reproduce
Actual Behaviorwhen i try to assign Expected Behaviorassign to value all the used variables in the formula and get an answer. |
If you want the subscript to also be considered a single variable, you also need to wrap it, i.e. The corresponding identifier is |
@arnog Yeah that's working, But I have another confusion. Based on your previous response, it appears that enclosing the variable with subscripts using |
You can provide a |
Hey @arnog, thank you for your quick response. However, I am facing another problem. The I added an input math-field where I'm attempting to input subscript variables, but |
@arnog How can I assign a value to a variable such as In my example, I have the expression Could you please assist me with this? How can I assign a value to variables in this manner? |
Unfortunately, as the error message indicate, |
@arnog Thanks for your response. Is there any way to get a list of used variables from LaTeX or a math field? For instance, I have a LaTeX response in a math-field like this. Is there any method or function that can provide me with an array or object of variables? |
Depending on what you're looking for, either
|
Heyy @arnog , you can visit here and check
https://codesandbox.io/s/infallible-worker-kdshn7
UPDATE
ce.assign()
takes a value without brackets..\mathrm
?onInlineShortcut
function does not work when attempting to type subscripts such asQ_{Ed}
..M_g,6.10a
? I've added an example in sandboxDescription
I want to evaluate formulas with variables by using the compute-engine. But I tested one case It gives me wrong answer. you can view code to above sandbox link.
Steps to Reproduce
const ce = new ComputeEngine.ComputeEngine();
const f = ce?.parse(
x+y+xyz);
ce.assign()
to assign values tox
,y
andxyz
like this.ce?.assign('xyz', 22); ce?.assign('x', 10); ce?.assign('y', 20);
console.log
to show diffrent results. butActual Behavior
it gives me results like this.
Simplyfy: xyz+x+y
evaluate: 200z+30
final: 200z+30
Expected Behavior
And I would be expecting the result
52
.The text was updated successfully, but these errors were encountered: