nerdamer icon indicating copy to clipboard operation
nerdamer copied to clipboard

solveEquations not working with too complex equation

Open BOISSARD opened this issue 1 year ago • 0 comments

Hello Martin,

Introduction

First of all, thank you so much for all the work on this project, I love it.

Your project responds perfectly to a need I have for a math school project.

But I encounter a difficulty.

My needs

I have an equation string with a list of variable.
The goal is to generate the solving function for each variable of the equation.

Too complex equation not working

The complexe equation : T = v*F*((((1+tr)^(n)-1)/tr) -1)

I'm writing this issue because solveEquations doesn't work with a too complex equation :

let solv = nerdamer.solveEquations("T = v*F*((((1+tr)^(n)-1)/tr) -1)", "T")

Here is the value of solv when it's not working, with a "value": "#" :

[
    {
        "group": 7,
        "value": "F*v",
        ...
    },
    {
        "group": 1,
        "value": "#",
        "multiplier": {
            "num": "0",
            "den": "1"
        },
        "power": {
            "num": "1",
            "den": "1"
        }
    }
]

But working with a simplest version

The simplest version T = v*F*(((1+tr)^(n)-1)/tr)
When removing the little -1 of the factorization's right part, it's working perfectly.

let solv = nerdamer.solveEquations("T = v*F*(((1+tr)^(n)-1)/tr)", "T")

Here is the value of solv when it's working :

[
    {
        "group": 7,
        "value": "(-(1+tr)^n*F*v+F*v)*tr^(-1)",
        "multiplier": {
            "num": "-1",
            "den": "1"
        },
        "imaginary": false,
        "isInfinity": false,
        "power": {
            "num": "1",
            "den": "1"
        },
        "symbols": { ... },
        "length": 2
    }
]

Conclusion

I hope it can have a solution and these examples will allow you to reproduce my issue and why not correct it.

Thanks in advance for your efforts.

And thanks again for you incredible work and this great package.

Regards,

Clément

BOISSARD avatar Oct 03 '22 17:10 BOISSARD