# I am unable to get the ans can someone tell how can i solve this

4 ビュー (過去 30 日間)
Vinay Basagare 2021 年 11 月 25 日
コメント済み: Vinay Basagare 2021 年 12 月 3 日
clear
clc
close all
a1=0.05;
a2=0.44;
a3=0.035;
d4=0.42;
d6=0.092;
t4=0;
t5=0;
t6=0;
C=[0,0,0.65];
A=[cos(t1)*(a1+a2*cos(t2)+a3*cos(t2+t3)+d4*sin(t2+t3)+d6*(cos(t2+t3)*cos(t4)*sin(t5)+sin(t2+t3)*cos(t5)))+d6*sin(t1)*sin(t4)*sin(t5)==0,sin(t1)*(a1+a2*cos(t2)+a3*cos(t2+t3)+d4*sin(t2+t3)+d6*(cos(t2+t3)*cos(t4)*sin(t5)+sin(t2+t3)*cos(t5)))+d6*cos(t1)*sin(t4)*sin(t5)==0,a2*sin(t2)+a3*sin(t2+t3)+d6*(sin(t2+t3)+cos(t4)*sin(t5)-cos(t2+t3)*cos(t5))==0.65];
S= vpasolve(A,[t1,t2,t3]);

サインインしてコメントする。

### 採用された回答

Rishabh Singh 2021 年 11 月 30 日
Hey Vinay,
Usage of variables "t1", "t2", "t3" is in form of symbolic variables. So declaring them as shown below will resolve the issue,
clear
clc
close all
a1=0.05;
a2=0.44;
a3=0.035;
d4=0.42;
d6=0.092;
t4=0;
t5=0;
t6=0;
C=[0,0,0.65];
syms t1 t2 t3;%declaring variables as symbolic variables
A=[cos(t1)*(a1+a2*cos(t2)+a3*cos(t2+t3)+d4*sin(t2+t3)+d6*(cos(t2+t3)*cos(t4)*sin(t5)+sin(t2+t3)*cos(t5)))+d6*sin(t1)*sin(t4)*sin(t5)==0,
sin(t1)*(a1+a2*cos(t2)+a3*cos(t2+t3)+d4*sin(t2+t3)+d6*(cos(t2+t3)*cos(t4)*sin(t5)+sin(t2+t3)*cos(t5)))+d6*cos(t1)*sin(t4)*sin(t5)==0,
a2*sin(t2)+a3*sin(t2+t3)+d6*(sin(t2+t3)+cos(t4)*sin(t5)-cos(t2+t3)*cos(t5))==0.65];
S= solve(A,[t1,t2,t3]);
For your specific application I would suggest using "solve symbolic equations". This will display the solutions in the live editor and can load the symbolic equations directly from the workspace.
Also consider looking into solvers other than numeric solvers such as "vpasolve", eg 'solve'.
Hope this helps.
##### 1 件のコメント表示非表示 なし
Vinay Basagare 2021 年 12 月 3 日
Thanks a lot. i really appreciate it.

サインインしてコメントする。

R2020a

### Community Treasure Hunt

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

Start Hunting!