Uncaught Error: Cannot convert "kg^4" to a number #2647
Replies: 5 comments
-
Can you provide a minimal example demonstrating the issue? |
Beta Was this translation helpful? Give feedback.
-
OK. let suppose a user ha entered an equation to be solved. I want these units (kg and kg^-1) to be solved according to given equation. But the maths js library throws error for the above syntax. Can you help me with this?
|
Beta Was this translation helpful? Give feedback.
-
The contents of the scope is taken as a value, not as an expression. I think you can evaluate your variables first too if they contain an expression? |
Beta Was this translation helpful? Give feedback.
-
contents of scope {p1 , p2} contains names of dynamic variables like a and b etc. Thats why I have to pass them as value. This case is working fine for arithmetic variables but is problematic in case of units. |
Beta Was this translation helpful? Give feedback.
-
can you give a concrete example? Maybe I can give you a concrete suggestion then :) |
Beta Was this translation helpful? Give feedback.
-
var e = math.simplify(equation , {
[p1]: (var2[0]),
[p2]: (var2[1])
}
equation contains a dynamic equation like p1+p2 , p1-p2 or 5p1/4. Values of P1 and P2 are units like kg^2 , m^-4 etc.
Any idea how can i resolve this issue?
Beta Was this translation helpful? Give feedback.
All reactions