How to solve the symbolic nonlinear equation

조회 수: 13 (최근 30일)
Dikra dikra
Dikra dikra 2018년 12월 7일
댓글: madhan ravi 2018년 12월 7일
the system of equation has two nonlinear equations in two variables. The equations are:
F(1) = (x(1)-b2*cos(theta2)+a)^2+(x(2)-b2*sin(theta2))^2-c2^2;
F(2) = (x(1)-b1*cos(theta1)+a)^2+(x(2)-b1*sin(theta1))^2-c1^2;
Thanks!
  댓글 수: 2
madhan ravi
madhan ravi 2018년 12월 7일
what are the values of parameters? fsolve() can be used, upload your code.
Dikra dikra
Dikra dikra 2018년 12월 7일
편집: Dikra dikra 2018년 12월 7일
I want to solve symbolically this system by using:
syms b2 a c2 c1 b1 theta2 theta1
the variables are x(1) and x(2)

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

채택된 답변

madhan ravi
madhan ravi 2018년 12월 7일
syms b2 a c2 c1 b1 theta2 theta1 x1 x2 % x1 is x(1) so is x2
F=zeros(2,1);
e1=F(1) == (x1-b2*cos(theta2)+a)^2+(x2-b2*sin(theta2))^2-c2^2;
e2=F(2) == (x1-b1*cos(theta1)+a)^2+(x2-b1*sin(theta1))^2-c1^2;
[x1,x2]=solve(e1,e2,x1,x2)
  댓글 수: 2
Dikra dikra
Dikra dikra 2018년 12월 7일
Thankn you. but why F=zeros(2,1)?
madhan ravi
madhan ravi 2018년 12월 7일
Anytime :) , read more about preallocation it's just filling a variable with values after defining the nature of it , if my answer helped make sure to accept the answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by