Reputation: 11
I am confused by not being able to solve this equation in Comsol
This is equation I mention:
1-2*sqrt(Lf/pi)*integrate((1)/sqrt(Lf^2-x^2)*(1+0.3*(1-x/Lf)/(1+Lf/0.1)),x,0,Lf)
If I write it in ODE and run, Comsol will notice message error (division by zero)
If I add eps
right after like this (Lf^2 -x^2 +eps)
, Comsol runs ok but result I get absolutely wrong
Any idea about my problem ?
Upvotes: 1
Views: 2238
Reputation: 1
Thats a mathematical issue you got there:
You try to integrate over the function 1/sqrt(Lf^2-x^2)
with the variable x ranging from 0 to Lf.
This means you are integrating over a mathematical pole since the function will be 1/(Lf^2-Lf^2) = 1/0
for x=Lf
.
This means that the problem resides in the funtion you want to integrate. Maybe you did a mistake there?
The eps cannot fix your problem, it is just used to catch division by zero errors, so that those errors don't halt your simulation. The eps does not correct the result, it just prevents other results from getting lost due to the thrown error.
Upvotes: 0