Substitute all solutions of a give system of equations.

조회 수: 1 (최근 30일)
Alessio Nava
Alessio Nava 2013년 4월 23일
댓글: Radu Trimbitas 2014년 9월 10일
I would like to substitute all the solutions of a system of equations in the original system. For example I would like to do something like this in Mupad:
eqs:=[x^2-1,y^2-1]
solutions:=solve(eqs)
and then create a matrix which contains all the couples of solutions; I tried with evalAt and subs combined with map and op but had no luck.
Any suggestions?
  댓글 수: 1
Radu Trimbitas
Radu Trimbitas 2014년 9월 10일
The idea is to consider the solution as a list and to evaluate the equation for the elements given in that list. The Mupad code is
eqs:=[x^2-1,y^2-1]:
solve(eqs,{x,y}):
zz:=op(%):
f:=l->(eqs)|l:
map([zz],f)

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 4월 23일
syms x y
eqs=[x^2-1,y^2-1]
sol=solve(eqs)
M=[sol.x sol.y]

추가 답변 (1개)

Alessio Nava
Alessio Nava 2013년 4월 23일
And what about replacing x and y in eqs with all the couples contained in the vector M?

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by