How does one use integral2 (double integral) symbolically?

21 ビュー (過去 30 日間)
Mikayel
Mikayel 2013 年 8 月 22 日
編集済み: Walter Roberson 2024 年 5 月 14 日
I would like to get some help on how to use the integral2 symbolically?
E.g. I have a Joint PDF function -> "@(x,y) exp(-(x+y))"
To verify that it adds up to one, I did the following -> "integral2(pdf,0,inf,0,inf)" with the result being 1 as expected.
Now to calculate the Joint CDF symbolically I defined x and y as symbols and tried to do -> "cdf=@(u,v) exp(-(u+v))" and "integral2(cdf,0,x,0,y)". The error I got was -> "Error using integral2. XMAX must be a floating point scalar."
What I want to get is -> "(1-exp(-y))*(1-exp(-x))" !!
Your help will be much appreciated.
  1 件のコメント
Dipak  kumar Panigrahy
Dipak kumar Panigrahy 2020 年 5 月 21 日
clear
clc
syms rtstar
syms rt1 v delta R do %or assign numeric values to the variables
p=10;
cdf1=p*tan(delta)*R^2;
cdf2=p*tan(delta)*R^2;
eqn = ss == (int(int(cdf1,rt,rt1,rtstar),e,0,v)-int(int(cdf2,rt,rtstar,rt2),e,0,v));
sol = solve(eqn, rtstar)
can ayone tell me how to solve this eqn?

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

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 8 月 22 日
From the documentation of integral2:
integral2
Numerically evaluate double integral
It is not meant for symbolic computation. If you are interested in symbolic results you need to have Symbolic Toolbox installed
Then you can use the int function:
  3 件のコメント
Shashank Prasanna
Shashank Prasanna 2013 年 8 月 23 日
編集済み: Shashank Prasanna 2013 年 8 月 23 日
Sir, you have to use functions from the Symbolic Toolbox.
>> syms u v
>> cdf = exp(-(u+v))
>> int(int(cdf,v,0,v),u,0,u)
Mikayel
Mikayel 2013 年 8 月 23 日
Thank you so much!

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

その他の回答 (1 件)

Okae
Okae 2024 年 5 月 14 日
編集済み: Walter Roberson 2024 年 5 月 14 日
how do i type j=\iint\of V_s\ [f\left(\varepsilon_{\left(\left(p+q\right)\right)}-f\left(\varepsilon_p\right)\delta\left(\varepsilon_{\left(\left(p+q\right)\right)}-\varepsilon_p-\hbar\omega q\right)\right]dp_{\left(x\right)d}p_y
in symbolic math toolbox?

Community Treasure Hunt

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

Start Hunting!

Translated by