Numerical Integration with symbolic integration limits

Hi all,
I am trying to solve the following expression:
exp1=((L+rho)-sqrt(rho^2-(z-(delta+c)/2)^2))^2;
Vg=2*pi*vpaintegral(exp1,z,delta/2,delta+c)
with delta and c being symbolic variables. rho and L depend directly on c.
The problem is that I would like to prescribe a value for Vg and then get a numerical solution for c which is also a part of my integration limits.
Can somebody help me solve this problem? I assume there is a more intelligent way to get a quick solution for this problem.
Thanks!

답변 (1개)

Walter Roberson
Walter Roberson 2020년 3월 23일
You cannot do that. vpaintegral does not support symbolic limits.
You are asking for something like
vpasolve( Vg - 2*pi*vpaintegral(exp1,z,delta/2,delta+c), c)
but you still want delta to be symbolic, so you are looking for c expressed in terms of delta. You cannot get that with numeric techniques. If we had your full formulas then maybe a non-numeric technique could be found.

댓글 수: 1

Denis Smaitch
Denis Smaitch 2020년 3월 23일
편집: Denis Smaitch 2020년 3월 23일
Hi Walter,
thanks for your quick response. Actually, I will be plotting c over delta=a so I could make delta numerical before solving the integral problem. The only sym I am left with during the integration step is c.
syms z delta c a real
theta=deg2rad(30);
alp=acos((a-c)/(a));
rho=(delta+2*a-2*a*cos(alp))/(2*cos(alp+theta));
L=a*sin(alp)-rho*(1-sin(alp+theta));
%% Get volume of gel
exp1=((L+rho)-sqrt(rho^2-(z-(delta+c)/2)^2))^2;
exp2=(z-delta)*(2*a+delta-z);
Vg=vpa(2*pi*vpaintegral(exp1,z,delta/2,delta+c)...
-2*pi*vpaintegral(exp2,z,delta,delta+c),4);
The second part of the integral is easily solvable. The first part is what makes the computation long/imposible.
Thanks for your help!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2020년 3월 23일

편집:

2020년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by