逆関数が見つかりません
Show older comments
f(x) = x - cos(x)の逆関数を計算しようとしています。
逆関数自体は存在しますが、finverseでは計算できないようです。
最終的な目的は、あるxに対してg(x)の値を得ることなので、
gが式として表されなくても構わないのですが、どのようにしたら良いでしょうか。
syms x
f(x) = x - cos(x);
g = finverse(f,x);
g
2 Comments
Fumiaki Kishino
on 28 Jul 2022
Naoya
on 3 Apr 2025
今回の関数f(x) の逆関数g(x) を数式レベルで求めるのは難しいようです。
ご提示の fminsearchによる算出の他、以下のように vpasolveで求める方法もあります。
clear all, close all
% 関数 f(x) の定義
syms x
f(x) = x - cos(x);
% f(x) の逆関数 g(x) の定義
g = @(X) double(vpasolve(f==X));
% x = 1~10 において g(x)の出力を求める
xi = 1:0.1:10;
for n = 1:length(xi)
y(n) = g(xi(n));
end
% 関数 f(x), g(x) を確認
fplot(f,[1,10])
hold on
plot(xi, y)
plot(1:10)
legend({'f(x)','g(x)','y=x'})
Answers (0)
Categories
Find more on 数学 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!