Page 1 of 1

[SOLVED] Solve System Problem.

Unread postPosted: 24 Apr 2017, 01:20
by rodolfonobrega
Hi, first of all, sorry for posting in English, but I did not find any posts in the forum that are in English ...

I'm trying to make a program, and at the end of the code, I check which variables are missing to be calculated and solve them through a system ... to do this, I keep the list of unused variables in another variable, but texas Does not accept such action.

In the following image I gave an example of the problem!


Image



Is there any way to resolve this?

Thank you all.

Re: Solve System Problem.

Unread postPosted: 24 Apr 2017, 08:30
by Bisam
You may force the OS to replace "vars" by its value before solving using string tools as shown below :
Code: Select all
vars:={a,b}
syst:={a+b=2,2a+b=3}
expr("solve(" & string(syst) & "," & string(vars) & ")")

Re: Solve System Problem.

Unread postPosted: 24 Apr 2017, 14:07
by rodolfonobrega
Bisam wrote:You may force the OS to replace "vars" by its value before solving using string tools as shown below :
Code: Select all
vars:={a,b}
syst:={a+b=2,2a+b=3}
expr("solve(" & string(syst) & "," & string(vars) & ")")



Hi, Bisam, thankyou so much for responding!
I had just thought of this solution and it worked!

my code look like this: (same ideia)
Code: Select all
d:="{a,b}"
expr("solve([[a+b=2][2*a+b=3]],"&d&")")


well...

Thanks a lot for your help!