Is it possible to simplify 'piecewise' expressions by preimposing conditions?

2 vues (au cours des 30 derniers jours)
Kiran Sagar
Kiran Sagar le 11 Mar 2016
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

Réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by