Info

This question is closed. Reopen it to edit or answer.

Can someone please tell me where I'm wrong so that I can correct it

1 view (last 30 days)
M = 2.5
fun1 = @(y) 1./y.*((sqrt(M^2 - 1)- cot(x)));
Km = integral(fun1,0,2.5);
above is my code an I need to know how to use the integral function on it. I keep getting this set of errors
Error in Intergral_test>@(y)1./y.*((sqrt(M^2-1)-cot(x)))
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in Intergral_test (line 3)
Km = integral(fun1,0,2.5); %returns C-.

Answers (1)

John D'Errico
John D'Errico on 10 Jun 2017
Edited: John D'Errico on 10 Jun 2017
You don't think having
- cot(x)));
in an integral with a kernel that is a function of y will cause a problem? :)
If x is symbolic, know that integral CANNOT solve a symbolic problem. If x is something else, I would point out that you have not defined it, in what you have shown us.
  4 Comments
Manil Athapattu
Manil Athapattu on 10 Jun 2017
Edited: Manil Athapattu on 10 Jun 2017
thanks a lot mate figured it out, my bad did not think that it would go to infinity at 0, either way i used 0.000001 which is pretty small. plus that constant i get is going to be used in some other equations so that is makes sense.
John D'Errico
John D'Errico on 10 Jun 2017
But 0.0000001, or whatever will create a arbitrarily large result and very different, based on whether you decided to use 0.0001, 0.0000000001, whatever. So just using a small number is not the right way to solve this, since exactly what number you choose as "small" will give you absurdly different results.
The .png suggests this is something that lives along some path. What path, we don't know, since we have been given only one single expression from a book or paper.

This question is closed.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!