Unable to find explicit solutions to an equation

1 Ansicht (letzte 30 Tage)
Plamen Bonev
Plamen Bonev am 14 Sep. 2021
Kommentiert: Plamen Bonev am 15 Sep. 2021
Hi,
I am trying to resolve the following equation :
x*atan(1/x)=y for x
My code is:
syms x y
eqn=(x*atan(1/x))==y
eqn=rewrite(eqn, 'log');
solx=solve(eqn, x, 'IgnoreAnalyticConstraints',1)
pretty(solx)
But I am getting the following error :
Any ideas?
Thank you in advance.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Sep. 2021
There is no closed form formula for that.
  2 Kommentare
Walter Roberson
Walter Roberson am 15 Sep. 2021
y_values = sort(rand(1,10))
y_values = 1×10
0.0586 0.2845 0.3234 0.3530 0.3767 0.4559 0.5491 0.5873 0.5990 0.7952
opts = optimset('display', 'none');
x_values = arrayfun(@(Y) fsolve(@(x) x*atan(x) - Y, 0.75, opts), y_values);
X = linspace(0,1);
Y = X.*atan(X);
plot(X, Y, '-', x_values, y_values, 'r+')
For the red +, in each case the x coordinate is the calculated one for that particular y, and you can see that it matches up perfectly with the forward calculation of x*atan(x) shown by the line.
Plamen Bonev
Plamen Bonev am 15 Sep. 2021
Thank you so much Walter :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Image Analyst
Image Analyst am 14 Sep. 2021
I'm not sure what you want to "resolve" or solve. This is what I see when I plot it:
fontSize = 20;
x = linspace(-2*pi, 2*pi, 1000);
y = x .* atan(1./x);
plot(x, y, 'LineWidth', 2);
grid on;
xlabel('x', 'FontSize', fontSize);
ylabel('y', 'FontSize', fontSize);
title('y = x .* atan(1./x)', 'FontSize', fontSize);
Now, explain exactly what is supposed to be equal to what.
  11 Kommentare
Walter Roberson
Walter Roberson am 15 Sep. 2021
Substitute fzero()
Plamen Bonev
Plamen Bonev am 15 Sep. 2021
Thanks a lot Walter.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by