Find all possible roots of transcendental function

7 visualizzazioni (ultimi 30 giorni)
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 Commento
James Tursa
James Tursa il 8 Set 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.

Accedi per commentare.

Risposte (1)

Torsten
Torsten il 8 Set 2023
Modificato: Torsten il 8 Set 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 Commenti
University
University il 9 Set 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 il 9 Set 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 .

Accedi per commentare.

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by