Info
此问题已关闭。 请重新打开它进行编辑或回答。
Numerical computation using Matlab
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to solve the expression for theta with T as an input:
Input: T
Output: theta
How can i solve to find the solution for a range of T?
Ls = 0.090;
r1 = 0.035;
Ks = 445e3;
xp = 0.1403;
func = Ks .*((sqrt((r1^2 + xp^2) - (2.*r1.*xp.*cos(theta))))...
- Ls).*r1.*(xp./(sqrt((r1^2 + xp^2) - (2.*r1.*xp.*cos(theta))))).*sin(theta) - T;
0 个评论
回答(1 个)
Alan Stevens
2020-7-23
Here's a (not very elegant!) way:
Ls = 0.090;
r1 = 0.035;
Ks = 445e3;
xp = 0.1403;
theta0 = 0;
TT = 0:50:500;
Theta = zeros(size(TT));
for i = 1:length(TT)
T = TT(i);
func = @(theta) Ks.*((sqrt((r1^2 + xp^2) - (2.*r1.*xp.*cos(theta))))...
- Ls).*r1.*(xp./(sqrt((r1^2 + xp^2) - (2.*r1.*xp.*cos(theta))))).*sin(theta) - T;
Theta(i) = fzero(func, theta0);
end
plot(TT,Theta*180/pi),grid
xlabel('T'), ylabel('\theta [degrees]')
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!