Find all possible roots of transcendental function

7 次查看(过去 30 天)
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 个评论
James Tursa
James Tursa 2023-9-8
Please post an image of the function you are trying to find the roots of, rather than have us trying to decipher your code.

请先登录,再进行评论。

回答(1 个)

Torsten
Torsten 2023-9-8
编辑:Torsten 2023-9-8
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 个评论
University
University 2023-9-9
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 2023-9-9
@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 .

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by