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

1 visualizzazione (ultimi 30 giorni)
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]);

Risposta accettata

Rishabh Singh
Rishabh Singh il 30 Nov 2021
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.

Più risposte (0)

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!