Matlab doesn't do the complicated integration

1 view (last 30 days)
I have tried to do a double integration using symbolic expression. However at somepoint the integration just stops. The output will be the same equation that I typed in (int(...)) instead of the actual answer of integration. Here are my codes:
syms xj yj
xije=0.0909090909090909;
yije=0.272727272727273;
xj1=0;yj1=0;
xj2=0.1818;yj2=0.1818;
f1=0.188+0.812/xj2^2*(2*xj2*xj-xj^2);
x=xije-xj;y=yije-yj;
x1=xije-xj1;x2=xije-xj2;
y1=yije-yj1;y2=yije-yj2;
R=sqrt(x^2+y^2);
f2=1/R^3;
f = f1*f2;
sigmaz=int(f,xj,x1,x2)
And heres the output:

Answers (2)

Walter Roberson
Walter Roberson on 20 Oct 2020
int is for closed form integration to get an indefinitely precise solution. You cannot justify getting an indefinitely precise solution to an integration involving imprecise numbers such as 0.188.
It is a category error to use floating point numbers with int() or solve(). You should use vpaintegral() and vpasolve() instead.

Ameer Hamza
Ameer Hamza on 20 Oct 2020
What about something like this
f = f1*f2;
sigmaz=int(f,xj)
I = subs(sigmaz, xj, x2) - subs(sigmaz, xj, x1)
It gives following expression in Live script

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!