Is it possible to simplify 'piecewise' expressions by preimposing conditions?
2 views (last 30 days)
Show older comments
I am solving a problem involving integration of the expression 'K' defined over 'r' and 'z' in symbolics, along with parameters 'a' and 'b', also symbolic. Now, when I integrate 'K' as follows:
K = 1/b^2 + z^2/(b^2*r^2) ;
K_integration = int( int(K*2*pi*r,r,z,a) ,z,0,b ) ;
I get the following solution:
K_integration =
piecewise([0 <= a & b == 0, 0], [0 <= a & b ~= 0, (pi*a^2)/b - (pi*b*(6*log(b) - 6*log(a) + 1))/9])
Here piecewise function imposes the conditions, if satisfied, for which the integral evaluates to respective expressions. Can I somehow pre-impose these conditions, for example,
0 <= a & b ~= 0
and get the final expression directly.
(pi*a^2)/b - (pi*b*(6*log(b) - 6*log(a) + 1))/9
0 Comments
Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!