Find all possible roots of transcendental function

7 ビュー (過去 30 日間)
University
University 2023 年 9 月 8 日
コメント済み: Sam Chak 2023 年 9 月 9 日
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 Center および File ExchangeTiming 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