📜  MATLAB 中符号表达式的限制

📅  最后修改于: 2022-05-13 01:54:23.680000             🧑  作者: Mango

MATLAB 中符号表达式的限制

极限是微积分中使用的函数,出现在连续性、导数和积分的定义中。符号表达式的极限被定义为符号表达式在特定点的行为。

认为\lim_{x \to \infty}(1/x) = 0. \,   随着 x 接近无穷大 (1/x) 变为 0。

Matlab 允许用户使用 limit() 方法计算符号表达式的极限。 limit() 方法的不同语法

  • 限制(f,var,a)
  • 限制(f,a)
  • 限制(f)
  • 限制(f,var,a,'左')
  • 限制(f,var,a,'右')

限制(f,var,a)

  • var逼近a时,它返回函数f极限
  • {L=\displaystyle \lim _{var\to a}f(var)}

例子:

Matlab
% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = cos(x)/x;
disp('f(x) :');
disp(f);
 
% Limit of f when x approaches to Inf
l = limit(f,x,Inf);
disp("Limit (x->Inf): ");
disp(l);


Matlab
% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = x^x;
disp('f(x) :');
disp(f);
 
% Limit of f when default variable(x) %
% approaches to 0 %
l = limit(f,0);
disp("Limit (x->0): ");
disp(l);


Matlab
% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = tan(x)/x;
disp('f(x) :');
disp(f);
 
% Limit of f when x approaches to 0 %
l = limit(f);
disp("Limit (x->0): ");
disp(l);


Matlab
% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = 1/(2*x);
disp('f(x) :');
disp(f);
 
% Left limit of f when x approaches to 0
l = limit(f,x,0,'left');
disp("Left limit: ");
disp(l);


Matlab
% Define a symbolic expression f in variable x
syms x
f = 1/(2*x);
disp('f(x) :');
disp(f);
 
% Right limit of f when x approaches to 0
l = limit(f,x,0,'right');
disp("Right limit: ");
disp(l);


输出 :

限制(f,a)

默认变量接近a时,它返回函数f极限



例子:

MATLAB

% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = x^x;
disp('f(x) :');
disp(f);
 
% Limit of f when default variable(x) %
% approaches to 0 %
l = limit(f,0);
disp("Limit (x->0): ");
disp(l);

输出:

限制(f)

默认变量接近0时,它返回函数f极限



例子:

MATLAB

% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = tan(x)/x;
disp('f(x) :');
disp(f);
 
% Limit of f when x approaches to 0 %
l = limit(f);
disp("Limit (x->0): ");
disp(l);

输出 :

限制(f,var,a,'左')

  • var接近a时,它返回函数f左极限
  • L =  \lim_{var \to a^-}f(var)



例子:

MATLAB

% MATLAB code for define a %
% symbolic expression f in variable x %
syms x
f = 1/(2*x);
disp('f(x) :');
disp(f);
 
% Left limit of f when x approaches to 0
l = limit(f,x,0,'left');
disp("Left limit: ");
disp(l);

输出 :

限制(f,var,a,'右')

  • var接近a时,它返回函数f右极限
  • L =  \lim_{var \to a^+}f(var)

例子:



MATLAB

% Define a symbolic expression f in variable x
syms x
f = 1/(2*x);
disp('f(x) :');
disp(f);
 
% Right limit of f when x approaches to 0
l = limit(f,x,0,'right');
disp("Right limit: ");
disp(l);

输出 :