Is it possible to simplify 'piecewise' expressions by preimposing conditions?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
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!