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 CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by