Skip to content

Substituting a variable value replaces unrelated variables too #62

@aniketkotal

Description

@aniketkotal

@cortex-js/compute-engine: v0.8.0 from npm
vue: v3.2.40
Minimal Stackblitz demo: https://stackblitz.com/edit/vue-5kqpdv?file=src/App.vue

What's happening

Substituting any variable, say V, replaces V in unrelated variables such as V_1, V_N

What should happen

Only the substituted variable should be affected

Steps to Reproduce

  1. Create a new ComputeEngine
  2. Parse an equation which has multiple variables with one part same. (ex: V-V_a)
  3. Substitute the variable V with a value.
  4. Evaluate and check the output

Quick Demonstration

Equation: V-V_a
Variables: V: 6, V_a: 4
Expected Output: 2
Actual Output: Evaluation: 2-2_{a}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions