フィルターのクリア

Find the value from the integral equation

1 回表示 (過去 30 日間)
Arad
Arad 2023 年 2 月 7 日
コメント済み: Arad 2023 年 2 月 7 日
I have the function A(e) as:
A=(cos(4*w)*cos(4*w)+1)/(1+exp(w-m0);
where the w is the variable and and m0 is the unknown value which should to be obtained by:
int(A,e,-20,20)-2=0.
I need to obtain the m0 parameter by solving the above equation.
  1 件のコメント
Sargondjani
Sargondjani 2023 年 2 月 7 日
I'm just going to give hints:
  1. make a function, or function handle of A
  2. define an objective function (the equation that should be zero. You can use Matlabs "integral" function.
  3. you need solve solve the objective function. You can use fsolve, or alternatively look an algorithm using Newton's method on file exhange (for example this link might work: https://uk.mathworks.com/matlabcentral/fileexchange/28227-newton-s-method)
This should get you started.

サインインしてコメントする。

回答 (2 件)

Torsten
Torsten 2023 年 2 月 7 日
fun = @(w,m0) (cos(4*w).*cos(4*w)+1)./(1+exp(w-m0));
m0sol = fsolve(@(m0)integral(@(w)fun(w,m0),-20,20)-2,1)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
m0sol = -18.9804
integral(@(w)fun(w,m0sol),-20,20)-2
ans = 2.6910e-11
  1 件のコメント
Arad
Arad 2023 年 2 月 7 日
Thank you very much.

サインインしてコメントする。


Dyuman Joshi
Dyuman Joshi 2023 年 2 月 7 日
編集済み: Dyuman Joshi 2023 年 2 月 7 日
You can solve it symbollically (This requires symbolic toolbox)
syms w m0
A=(cos(4*w)*cos(4*w)+1)/(1+exp(w-m0));
eq=int(A,w,-20,20)-2==0;
val=vpasolve(eq)
val = 
%Verification
syms y(x)
y(x)=(cos(4*x)*cos(4*x)+1)/(1+exp(x-val));
inty=int(y,x,-20,20)
inty = 
%As we can see here, we don't get the numeric value of the integral
%so we use vpa to approximate the value
vpa(inty)
ans = 
2.0
  1 件のコメント
Arad
Arad 2023 年 2 月 7 日
Thank you very much.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by