Symbolic substraction of multiple valued functions

1 visualización (últimos 30 días)
Meva
Meva el 21 de Oct. de 2016
Comentada: Meva el 22 de Oct. de 2016
Hello,
I have two equations which are the same but in a different format. byhand is arranged version of thetadouble function. If I substract byhand from thetadouble I should get zero, but instead Matlab just repeats what I typed. Please see below.
syms thetadouble(h, theta, kappa, b, a, c, gamma) byhand(h, theta, kappa, b, a, c, gamma)
thetadouble = (sqrt(a*kappa)*(a^3 *(1 - 2 *b) ...
- a^2 *(-1 + 2 * b) *(1 - 2*c + 2 * c^2) *kappa - (b - c) *(-1 + c) ...
*c *(h + theta - b *theta)^2 *kappa + ...
a *((-1 + b + c) * h^2 -2 *(-1 + b) *(-1 + b + c) *h*theta ...
+ (-1 + b)^2 *(-1 + b + c) * theta^2 - (-1 + 2*b) *(-1 + c)^2 *c^2 *kappa^2)) ...
- (b - c) *(h + theta - b *theta)^2 *...
(a^2 + a *(1 - 2 *c + 2 *c^2) *kappa + (-1 + c)^2 *c^2 *kappa^2) ...
*atan((-1 + c)*kappa/a) + (b -c) * (h + theta - b *theta)^2*(a^2 + a *(1 - 2 *c + 2 *c^2) * kappa + (-1 + c)^2 *c^2*kappa^2) ...
*atan(c *kappa/a))...
/(4*a^(3/2)*gamma *sqrt(kappa)...
*(a +(-1 + c)^2*kappa)* (a +c^2 *kappa));
byhand = (sqrt(a*kappa)*(a*(1 - 2*b)*(a^2 + kappa*a*(1 - 2 *c + 2 *c^2) + ...
c^2*kappa^2 *(1 - c)^2) + (b - c)*(1 - c)*c*(h + (1 - b)*theta)^2*kappa ...
+ a*(b - 1 + c)*(h + (1 - b)*theta)^2)...
+ (b - c) *(h + (1 - b )* theta)^2 * ...
(a^2 + a *(1 - 2 *c + 2 *c^2) ...
* kappa + (-1 + c)^2 *c^2*kappa^2)*(atan((1 - c) * sqrt(kappa/a))+ ...
atan(c * sqrt(kappa/a))))/((4 *a^(3/2) *gamma *sqrt(kappa) ...
*(a + (-1 + c)^2 *kappa)*(a +c^2 *kappa)));
diff = thetadouble - byhand
Please give me an idea. Thanks..

Respuesta aceptada

Steven Lord
Steven Lord el 21 de Oct. de 2016
What happens when you simplify the difference?

Más respuestas (0)

Categorías

Más información sobre Gamma Functions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by