フィルターのクリア

Solve Non-linear system - System possible but undetermined

1 回表示 (過去 30 日間)
Yogan Sganzerla
Yogan Sganzerla 2018 年 11 月 4 日
編集済み: Yogan Sganzerla 2018 年 11 月 4 日
Hello,
I have this code to solve:
syms Theta_1 Theta_2 Theta_3
l1 = 3
l2 = 2.2
l3 = 1
a = 2
b = 0.5
t = 1
while t<70
phi_1 = (l1*cos(Theta_1)) + (l2*cos(Theta_2)) + (l3*cos(Theta_3)) - a; %Equation 1
phi_2 = (l1*sin(Theta_1)) + (l2*sin(Theta_2)) + (l3*sin(Theta_3)) - b; %Equation 2
phi_3 = Theta_3 - sin(0.05*pi*t); %Equation 3
phi = [phi_1 phi_2 phi_3];
Theta = [Theta_1 Theta_2 Theta_3];
[theta_1 theta_2 theta_3] = solve(phi,Theta); % SOLVING THE EQUATION
%Solving
Num_theta_1 = vpa(theta_1(2)); %positin Bar 1
Num_theta_2 = vpa(theta_2(2)); %positin Bar 2
Num_theta_3 = vpa(theta_3(2)); %positin Bar 3
%Answers
Answer_Position_Theta_1(t) = Num_theta_1;
Answer_Position_Theta_2(t) = Num_theta_2;
Answer_Position_Theta_3(t) = Num_theta_3;
t = t+1
end
figure(1)
plot(Answer_Position_Theta_3,'-*r')
figure(2)
plot(Answer_Position_Theta_2,'-*r')
figure(3)
plot(Answer_Position_Theta_1,'-*r')
When I run the simulation, I get the following result: 1. Theta_1
1. Theta_2
1. Theta_3
We can see that Theta_3 is correct! The function Sine. But Theta_1 and Theta_2 have some point out of the way. Probably is is because cos(30) = con(-30). I need to define that point following the other points.
Do you know how could I do? What should I change?
Dank! Cheers!

回答 (0 件)

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by