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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by