symbolic integration with undefined variable
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
james hopper
el 17 de Sept. de 2014
Comentada: james hopper
el 17 de Sept. de 2014
i created the following script code
syms r,x,r,z; a=int((r^2*x*z)/(r^2+z^2)^(3/2),0,2*pi) b=int(a, r, 0, r)
because i can't do definite integrals of multidimensional problems. But the answer for b is not making sense to me as i keep getting this piecewise answer that does not make sense. It appears that its trying to evaluate the value of z over which answer is valid. how can i force it to know that z is always a positive value > 0 so i can avoid this?
here is what i get out, note a is correct, but b is confused.
a = (2*pi^2*r^2*z)/(r^2 + z^2)^(3/2)
b = piecewise([z in {-1, 1}, (2*pi^2*r^3*z*hypergeom([3/2, 3/2], [5/2], -r^2))/3], [not z in {-1, 1}, int((2*pi^2*r^2*z)/(r^2 + z^2)^(3/2), r, 0, r)])
0 comentarios
Respuesta aceptada
David Sanchez
el 17 de Sept. de 2014
Point out that z>0 like this:
>> assume(z>0);
>> b=int(a, r, 0, r)
b =
-2*pi^2*z*(log(z) - log(r + (r^2 + z^2)^(1/2)) + r/(r^2 + z^2)^(1/2))
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!