solving equation written in the functions

조회 수: 1 (최근 30일)
Vijay Shankar Dwivedi
Vijay Shankar Dwivedi 2020년 10월 28일
편집: Aman Vyas 2020년 11월 3일
I want to solve three equations with three unknowns.
Force_x(x,y,z) == 0, Force_y(x,y,z) == 0, Force_z(x,y,z) == 0
vpasolve is not working here because Force_x works only when x y z are numbers, while vpasolve is passing symbols.
Help me with any other method or any modification.
my code:
[XX, YY] = vpasolve([Force_x(x,y,z)==0, Force_y(x,y,z)==0, Force_z(x,y,z)==0], [x, y, z], [0, 0, 0]);
error: Invalid arguments specified in evaluating the interpolant.
this error is due to symbols passed by Force_x.
  댓글 수: 2
KSSV
KSSV 2020년 10월 28일
There should be some relation involving x,y,z right? Simply F_x = 0 ...will not work.
Vijay Shankar Dwivedi
Vijay Shankar Dwivedi 2020년 10월 28일
편집: Vijay Shankar Dwivedi 2020년 10월 28일
Force_x(x,y,z) is a function defined in anothe file which involves x, y, z.

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

채택된 답변

Aman Vyas
Aman Vyas 2020년 11월 3일
편집: Aman Vyas 2020년 11월 3일
Hi,
You can try following code:
syms x y z Force_x Force_y Force_z
[X Y Z] = vpasolve([Force_x==0,Force_y==0,Force_z ==0],[x y z],[0 0 0])
This would start produce generic output as shown :
X =
Empty sym: 0-by-1
Y =
Empty sym: 0-by-1
Z =
Empty sym: 0-by-1
See this if it matches the requirement in output. Once you start calling function Force_x and other two then it should start outputting correct value.
Hope it helps !

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by