Solving equation with integral numerically for variable

2 ビュー (過去 30 日間)
Christoph Müller
Christoph Müller 2016 年 7 月 26 日
編集済み: Christoph Müller 2016 年 8 月 4 日
I have to solve a normalization equation (i.e., all proababilities have to sum up to 1) in order to determine the normalization constant. It was no problem to solve this using the symbolic toolbox. However, the computational performance is poor and therefore I want to solve it numerically but I haven't found a way to solve it so far. A simplified version of this problem is given below.
% Constant parameters
p1 = 0.02;
p2 = 0.25;
r1 = 0.2;
r2 = 0.3;
a1 = 1.0;
a2 = 1.0;
N = 20;
syms C1 x;
Y11=(r1+r2)/(p1+p2);
Y21=(r1+r2)/(p1+p2);
b1=(1/a1)*(r1*p2-r2*p1)*(1/(p1+p2)+1/(r1+r2));
fx00=C1*(exp(b1*x));
fx01=C1*(exp(b1*x))*Y21;
fx10=C1*(exp(b1*x))*Y11;
fx11=C1*(exp(b1*x))*Y11*Y21;
internal_behavior=int((fx00+fx01+fx10+fx11),'x',0,N);
F1=internal_behavior - 1;
C1=vpasolve(F1,C1);
Is there any way to solve this numerically? I tried to define the functions fx00, ..., fx11 as anonymous functions @(x,C1) to integrate numerically. But I cannot use the int() command within vpasolve() . Any hint is highly appreciated.

採用された回答

Torsten
Torsten 2016 年 7 月 26 日
C1=b1/((exp(b1*N)-1)*(1+Y21+Y11+Y11*Y21))
Best wishes
Torsten.

その他の回答 (0 件)

カテゴリ

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