Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Numerical computation using Matlab

1 vue (au cours des 30 derniers jours)
Muhammad Bilal
Muhammad Bilal le 23 Juil 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021
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;

Réponses (1)

Alan Stevens
Alan Stevens le 23 Juil 2020
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]')

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by