Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Numerical computation using Matlab

1 visualizzazione (ultimi 30 giorni)
Muhammad Bilal
Muhammad Bilal il 23 Lug 2020
Chiuso: MATLAB Answer Bot il 20 Ago 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;

Risposte (1)

Alan Stevens
Alan Stevens il 23 Lug 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]')

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by