Find all possible roots of transcendental function

7 vues (au cours des 30 derniers jours)
University
University le 8 Sep 2023
Commenté : Sam Chak le 9 Sep 2023
Please can help with how find all the possible roots of q for xi and u and use the results to compute tau?
clear
clc
close all
%% Model parameters
alpha3 = -0.001104; eta1 = 0.0240; K1 = 6*10^(-12);
gamma1 = 0.1093; chi_a = 1.219*10^(-6); d = 0.0002;
H_c = pi*sqrt(K1/chi_a)/d;
alpha = 1-((alpha3).^2/(gamma1*eta1));
xi =linspace(-0.3, 0.3, 81);
u = linspace(0, 3, 81);
for iu=1:length(u)
for ixi=1:length(xi)
q(iu, ixi) - (1-alpha)*tan(q) + (1/gamma1)*((alpha3*ixi/eta1)*tan(q) + chi_a*(iu*H_c)^2*q)*(alpha*gamma1* (4*K1*q(iu, ixi).^2/d.^2 - (alpha3*ixi)/eta1 - chi_a*(iu*H_c).^2)^(-1));
tau(iu, ixi) = (alpha*gamma1*(4*K1*q(iu, ixi).^2/d.^2 - (alpha3*ixi)/eta1 - chi_a*(iu*H_c).^2)^(-1)
end
end
  1 commentaire
James Tursa
James Tursa le 8 Sep 2023
Please post an image of the function you are trying to find the roots of, rather than have us trying to decipher your code.

Connectez-vous pour commenter.

Réponses (1)

Torsten
Torsten le 8 Sep 2023
Modifié(e) : Torsten le 8 Sep 2023
Really all zeros ? Then you cannot save them in any array since for each u and xi, you get an infinite number of them. Is the function correct ? There were some strange settings therein: the "q(iu, ixi) -" at the beginning and the use of ixi and iu instead of xi(ixi) and u(iu) in the function definition.
%% Model parameters
alpha3 = -0.001104; eta1 = 0.0240; K1 = 6*10^(-12);
gamma1 = 0.1093; chi_a = 1.219*10^(-6); d = 0.0002;
H_c = pi*sqrt(K1/chi_a)/d;
alpha = 1-((alpha3).^2/(gamma1*eta1));
fun = @(q,xi,u)(1-alpha).*tan(q) + (1./gamma1).*((alpha3.*xi./eta1).*tan(q) + chi_a.*(u*H_c).^2.*q).*(alpha.*gamma1.*(4.*K1.*q.^2/d.^2-(alpha3.*xi)./eta1-chi_a.*(u.*H_c).^2).^(-1));
xi = 0.2;
u = 1.5;
hold on
q = 0:0.01:pi/2-0.1;
plot(q,fun(q,xi,u),'b')
q = pi/2+0.1:0.01:3*pi/2-0.1;
plot(q,fun(q,xi,u),'b')
q = 3*pi/2+0.1:0.01:5*pi/2-0.1;
plot(q,fun(q,xi,u),'b')
q = 5*pi/2+0.1:0.01:7*pi/2-0.1;
plot(q,fun(q,xi,u),'b')
hold off
grid on
  4 commentaires
University
University le 9 Sep 2023
Thank you Sam. The maple code is a bit long. Unless, you want the complete code. I have attached the contour plot of tau with respect to xi and u
Sam Chak
Sam Chak le 9 Sep 2023
@University, Based on the contour plot, it is most likely that the circled region represents the zero-crossing region where the roots are located. Therefore, the solution should appear as a curved line. However, if we examine the presumed implicit function , which has yet to be clarified, it is possible that this region corresponds to where discontinuities occur due to the tangent function in .

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by