There are two lists as follows:
Vars =
{{(x1)Cos[x2], Sin[x2], 0, (x3) (Sin[x2])}, {(Cos[x2]) (Sin[x4]),
(x3)Cos[x4], 1, x1}};
Const = {{1, 0, 0, 1}, {0, 1, 1, 2}};
Using Vars
and Const
, I want to make a system of equations like :
SysEqu =
{(x1)Cos[x2]==1, Sin[x2]==0, 0==0, (x3) (Sin[x2])==1,
(Cos[x2])(Sin[x4])==0, (x3)Cos[x4]==1, 1==1, x1==2}
Then a UI asks about the VARIABLES
to be solved and finally :
sol1 = NSolve[SysEqu, VARIABLES];
I know that NSolve
generally may have some problems to give exact answers for any kind of equation. Other approaches could be acceptable instead of NSolve[]
.
Could you please help me with this code?!
P.S.
To setup my equations, I used this code:
SetEqual = MapThread[Set, {Vars, Const}, 2];
However, some errors appear that two of them are :
Tag Times in x2 Sin[x2] is Protected.
Cannot assign to raw object 1.