Find a variable as function of other variable with equations system using Symbolic ToolBox
이전 댓글 표시
I have 3 equations that connects between 4 variables, let's say:
syms a b c d;
r=b+d;
e=pi/2;
eq1 = c - a*sin(d) + b*cos(d) == 0;
eq2 = r - c*tan(e) - a*cos(d) - b*sin(d) == 0;
eq3 = b == e*r + a*tan(e);
Now I would like to find c(d), means, I would like to find what is c as a function of other variable, in this case - d.
Then perform other operations on c(d) such as differntiate etc.
What would be the best/easiest way to do that using Symbolic Toolbox?
Thanks.
댓글 수: 2
Walter Roberson
2020년 4월 4일
10 radians is an unusual angle, but that is probably not so important for your question.
Evyatar Sivan
2020년 4월 4일
채택된 답변
추가 답변 (1개)
Ameer Hamza
2020년 4월 4일
try this example
syms a b c d;
r=b+d;
e=pi/2;
eq1 = c - a*sin(d) + b*cos(d) == 0;
eq2 = r - c*tan(e) - a*cos(d) - b*sin(d) == 0;
eq3 = b == e*r + a*tan(e);
sol = solve([eq1 eq2 eq3], [a b c]);
C = sol.c; % c as function of d
% Now find its derivative
dC_dd = diff(C,d); % dc/dd
% you can also integrate it
IC = int(C,d);
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!