trigonometric non linear equation

조회 수: 1 (최근 30일)
deepak verma
deepak verma 2021년 4월 23일
댓글: deepak verma 2021년 4월 23일
Trying to solve the nonlinear equation using this code but geeting error :
code :-----------------------------------------------------------------------------------------------
F=@(x) [(Vm/3)*{cos(x(2))-cos(x(1)+pi/3)+1.5*cos(x(1))-1.5*cos(x(2))}-Vdc*{(x(2)-x(1))/2-(2*x(2))/2+(x(1)+pi/3)/1.5}; (Vm/3)*{cos(x(1)+pi/3)-cos(x(2))+cos(x(2)-(2*pi)/3)-cos(x(1)-pi/3)-1.5*cos(x(1)+pi/3)+1.5*cos(x(1))}-Vdc*{(x(1)-x(2)+pi/3)/3-(x(2)-x(1))/2}];
x0=[-1;1];
options=optimoptions('fsolve', 'Display', 'iter');
Error:::-------------------------------------------------------------------------------------------------
Undefined operator '*' for input arguments of type 'cell'.
Error in
@(x)[(Vm/3)*{cos(x(2))-cos(x(1)+pi/3)+1.5*cos(x(1))-1.5*cos(x(2))}-Vdc*{(x(2)-x(1))/2-(2*x(2))/2+(x(1)+pi/3)/1.5};(Vm/3)*{cos(x(1)+pi/3)-cos(x(2))+cos(x(2)-(2*pi)/3)-cos(x(1)-pi/3)-1.5*cos(x(1)+pi/3)+1.5*cos(x(1))}-Vdc*{(x(1)-x(2)+pi/3)/3-(x(2)-x(1))/2}]
Error in fsolve (line 242)
fuser = feval(funfcn{3},x,varargin{:});
  댓글 수: 1
deepak verma
deepak verma 2021년 4월 23일
To get the value of theta 1 and theta2 : Vm=80 and Vdc=72

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

채택된 답변

William
William 2021년 4월 23일
I have no idea what this question is about, but I do notice that some of the expressions are surrounded with curly braces { } rather than parentheses ( ). In Matlab, the curly braces indicate a cell-array, and that seems to be causing a problem with the multiplication operator (which cannot be used on cells).
  댓글 수: 1
deepak verma
deepak verma 2021년 4월 23일
thanx solved. Curley braces were the problem

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by