Message Boards Message Boards

0
|
3801 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Equations into Tuples

Posted 9 years ago

Given a list of equations, I need a function that solves the equations to generate tuples.

Examples:

eq={x1=0,x2=0,x3=0}

Will generate the point {0,0,0}.

Similarly: {2 x3 == x2, 2 x1 + x2 == 4, x2 + 2 x3 == 4}

Will generate the point {1,2,1}

Is there such a built in function?

POSTED BY: Conor Nelson
2 Replies
Posted 9 years ago
eq1 = {x1 == 0, x2 == 0, x3 == 0};
sol1 = Solve[eq1, {x1, x2, x3}] // Flatten;
{x1, x2, x3} /. sol1

eq2 = {2 x3 == x2, 2 x1 + x2 == 4, x2 + 2 x3 == 4};
sol2 = Solve[eq2, {x1, x2, x3}] // Flatten;
{x1, x2, x3} /. sol2
POSTED BY: Okkes Dulgerci
Posted 9 years ago
eq2 = {2 x3 == x2, 2 x1 + x2 == 4, x2 + 2 x3 == 4};
{x1, x2, x3} /. Solve[eq2, {x1, x2, x3}] // Flatten
POSTED BY: Okkes Dulgerci
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract