Solving equation with integral numerically for variable
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!