Carl Love

Carl Love

28085 Reputation

25 Badges

13 years, 91 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

The command you need is convert(f(x), fullparfrac, x), possibly with added options. See the help page ?convert,fullparfrac.

Maple has a "sum over all roots of a polynomial" feature that usually makes seeing the individual factors unnecessary. However, if that's not useful for you, try including the factor option.

You get much better simplifications by calling dsolve for each numeric instantiation rather than getting a generic solution and then substituting parameter values,

K:= diff(F(xi), xi) = A + B*F(xi) + C*F(xi)^2;

diff(F(xi), xi) = A+B*F(xi)+C*F(xi)^2

V:= [seq](-1..1, 1/2);

[-1, -1/2, 0, 1/2, 1]

interface(rtablesize= nops(V)^3):

DataFrame(
    <seq(seq(seq(<a | b | c | rhs(dsolve(eval(K, [A,B,C]=~ [a,b,c])))>, a= V), b= V), c= V)>,
    columns= [A, B, C, F]
);

DataFrame(Matrix(125, 4, {(1, 1) = -1, (1, 2) = -1, (1, 3) = -1, (1, 4) = -((1/6)*sqrt(3)+(1/2)*tan((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (2, 1) = -1/2, (2, 2) = -1, (2, 3) = -1, (2, 4) = -1/2-(1/2)*tan((1/2)*_C1+(1/2)*xi), (3, 1) = 0, (3, 2) = -1, (3, 3) = -1, (3, 4) = 1/(-1+exp(xi)*_C1), (4, 1) = 1/2, (4, 2) = -1, (4, 3) = -1, (4, 4) = -((1/6)*sqrt(3)-(1/2)*tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (5, 1) = 1, (5, 2) = -1, (5, 3) = -1, (5, 4) = -((1/10)*sqrt(5)-(1/2)*tanh((1/2)*sqrt(5)*(_C1+xi)))*sqrt(5), (6, 1) = -1, (6, 2) = -1/2, (6, 3) = -1, (6, 4) = -((1/60)*sqrt(15)+(1/4)*tan((1/4)*sqrt(15)*(_C1+xi)))*sqrt(15), (7, 1) = -1/2, (7, 2) = -1/2, (7, 3) = -1, (7, 4) = -((1/28)*sqrt(7)+(1/4)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (8, 1) = 0, (8, 2) = -1/2, (8, 3) = -1, (8, 4) = 1/(-2+exp((1/2)*xi)*_C1), (9, 1) = 1/2, (9, 2) = -1/2, (9, 3) = -1, (9, 4) = (exp((3/2)*xi)*_C1+1)/(-1+2*exp((3/2)*xi)*_C1), (10, 1) = 1, (10, 2) = -1/2, (10, 3) = -1, (10, 4) = -((1/68)*sqrt(17)-(1/4)*tanh(((1/4)*_C1+(1/4)*xi)*sqrt(17)))*sqrt(17), (11, 1) = -1, (11, 2) = 0, (11, 3) = -1, (11, 4) = -tan(_C1+xi), (12, 1) = -1/2, (12, 2) = 0, (12, 3) = -1, (12, 4) = -(1/2)*tan((1/2)*sqrt(2)*(_C1+xi))*sqrt(2), (13, 1) = 0, (13, 2) = 0, (13, 3) = -1, (13, 4) = 1/(_C1+xi), (14, 1) = 1/2, (14, 2) = 0, (14, 3) = -1, (14, 4) = (1/2)*sqrt(2)*tanh((1/2)*sqrt(2)*(_C1+xi)), (15, 1) = 1, (15, 2) = 0, (15, 3) = -1, (15, 4) = tanh(_C1+xi), (16, 1) = -1, (16, 2) = 1/2, (16, 3) = -1, (16, 4) = ((1/60)*sqrt(15)-(1/4)*tan((1/4)*sqrt(15)*(_C1+xi)))*sqrt(15), (17, 1) = -1/2, (17, 2) = 1/2, (17, 3) = -1, (17, 4) = ((1/28)*sqrt(7)-(1/4)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (18, 1) = 0, (18, 2) = 1/2, (18, 3) = -1, (18, 4) = 1/(2+exp(-(1/2)*xi)*_C1), (19, 1) = 1/2, (19, 2) = 1/2, (19, 3) = -1, (19, 4) = (exp((3/2)*xi)*_C1+1)/(exp((3/2)*xi)*_C1-2), (20, 1) = 1, (20, 2) = 1/2, (20, 3) = -1, (20, 4) = ((1/68)*sqrt(17)+(1/4)*tanh(((1/4)*_C1+(1/4)*xi)*sqrt(17)))*sqrt(17), (21, 1) = -1, (21, 2) = 1, (21, 3) = -1, (21, 4) = ((1/6)*sqrt(3)-(1/2)*tan((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (22, 1) = -1/2, (22, 2) = 1, (22, 3) = -1, (22, 4) = 1/2-(1/2)*tan((1/2)*_C1+(1/2)*xi), (23, 1) = 0, (23, 2) = 1, (23, 3) = -1, (23, 4) = 1/(1+exp(-xi)*_C1), (24, 1) = 1/2, (24, 2) = 1, (24, 3) = -1, (24, 4) = ((1/6)*sqrt(3)+(1/2)*tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (25, 1) = 1, (25, 2) = 1, (25, 3) = -1, (25, 4) = ((1/10)*sqrt(5)+(1/2)*tanh((1/2)*sqrt(5)*(_C1+xi)))*sqrt(5), (26, 1) = -1, (26, 2) = -1, (26, 3) = -1/2, (26, 4) = -1-tan((1/2)*_C1+(1/2)*xi), (27, 1) = -1/2, (27, 2) = -1, (27, 3) = -1/2, (27, 4) = -(_C1+xi-2)/(_C1+xi), (28, 1) = 0, (28, 2) = -1, (28, 3) = -1/2, (28, 4) = 2/(-1+2*exp(xi)*_C1), (29, 1) = 1/2, (29, 2) = -1, (29, 3) = -1/2, (29, 4) = -((1/2)*sqrt(2)-tanh((1/2)*sqrt(2)*(_C1+xi)))*sqrt(2), (30, 1) = 1, (30, 2) = -1, (30, 3) = -1/2, (30, 4) = -((1/3)*sqrt(3)-tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (31, 1) = -1, (31, 2) = -1/2, (31, 3) = -1/2, (31, 4) = -((1/14)*sqrt(7)+(1/2)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (32, 1) = -1/2, (32, 2) = -1/2, (32, 3) = -1/2, (32, 4) = -((1/6)*sqrt(3)+(1/2)*tan((1/4)*sqrt(3)*(_C1+xi)))*sqrt(3), (33, 1) = 0, (33, 2) = -1/2, (33, 3) = -1/2, (33, 4) = 1/(-1+exp((1/2)*xi)*_C1), (34, 1) = 1/2, (34, 2) = -1/2, (34, 3) = -1/2, (34, 4) = -((1/10)*sqrt(5)-(1/2)*tanh((1/4)*sqrt(5)*(_C1+xi)))*sqrt(5), (35, 1) = 1, (35, 2) = -1/2, (35, 3) = -1/2, (35, 4) = (2+exp((3/2)*xi)*_C1)/(exp((3/2)*xi)*_C1-1), (36, 1) = -1, (36, 2) = 0, (36, 3) = -1/2, (36, 4) = -tan((1/2)*sqrt(2)*(_C1+xi))*sqrt(2), (37, 1) = -1/2, (37, 2) = 0, (37, 3) = -1/2, (37, 4) = -tan((1/2)*_C1+(1/2)*xi), (38, 1) = 0, (38, 2) = 0, (38, 3) = -1/2, (38, 4) = 2/(2*_C1+xi), (39, 1) = 1/2, (39, 2) = 0, (39, 3) = -1/2, (39, 4) = tanh((1/2)*_C1+(1/2)*xi), (40, 1) = 1, (40, 2) = 0, (40, 3) = -1/2, (40, 4) = sqrt(2)*tanh((1/2)*sqrt(2)*(_C1+xi)), (41, 1) = -1, (41, 2) = 1/2, (41, 3) = -1/2, (41, 4) = ((1/14)*sqrt(7)-(1/2)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (42, 1) = -1/2, (42, 2) = 1/2, (42, 3) = -1/2, (42, 4) = ((1/6)*sqrt(3)-(1/2)*tan((1/4)*sqrt(3)*(_C1+xi)))*sqrt(3), (43, 1) = 0, (43, 2) = 1/2, (43, 3) = -1/2, (43, 4) = 1/(1+exp(-(1/2)*xi)*_C1), (44, 1) = 1/2, (44, 2) = 1/2, (44, 3) = -1/2, (44, 4) = ((1/10)*sqrt(5)+(1/2)*tanh((1/4)*sqrt(5)*(_C1+xi)))*sqrt(5), (45, 1) = 1, (45, 2) = 1/2, (45, 3) = -1/2, (45, 4) = (1+2*exp((3/2)*xi)*_C1)/(exp((3/2)*xi)*_C1-1), (46, 1) = -1, (46, 2) = 1, (46, 3) = -1/2, (46, 4) = 1-tan((1/2)*_C1+(1/2)*xi), (47, 1) = -1/2, (47, 2) = 1, (47, 3) = -1/2, (47, 4) = (_C1+xi+2)/(_C1+xi), (48, 1) = 0, (48, 2) = 1, (48, 3) = -1/2, (48, 4) = 2/(1+2*exp(-xi)*_C1), (49, 1) = 1/2, (49, 2) = 1, (49, 3) = -1/2, (49, 4) = ((1/2)*sqrt(2)+tanh((1/2)*sqrt(2)*(_C1+xi)))*sqrt(2), (50, 1) = 1, (50, 2) = 1, (50, 3) = -1/2, (50, 4) = ((1/3)*sqrt(3)+tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (51, 1) = -1, (51, 2) = -1, (51, 3) = 0, (51, 4) = -1+exp(-xi)*_C1, (52, 1) = -1/2, (52, 2) = -1, (52, 3) = 0, (52, 4) = -1/2+exp(-xi)*_C1, (53, 1) = 0, (53, 2) = -1, (53, 3) = 0, (53, 4) = exp(-xi)*_C1, (54, 1) = 1/2, (54, 2) = -1, (54, 3) = 0, (54, 4) = exp(-xi)*_C1+1/2, (55, 1) = 1, (55, 2) = -1, (55, 3) = 0, (55, 4) = 1+exp(-xi)*_C1, (56, 1) = -1, (56, 2) = -1/2, (56, 3) = 0, (56, 4) = -2+exp(-(1/2)*xi)*_C1, (57, 1) = -1/2, (57, 2) = -1/2, (57, 3) = 0, (57, 4) = -1+exp(-(1/2)*xi)*_C1, (58, 1) = 0, (58, 2) = -1/2, (58, 3) = 0, (58, 4) = exp(-(1/2)*xi)*_C1, (59, 1) = 1/2, (59, 2) = -1/2, (59, 3) = 0, (59, 4) = 1+exp(-(1/2)*xi)*_C1, (60, 1) = 1, (60, 2) = -1/2, (60, 3) = 0, (60, 4) = 2+exp(-(1/2)*xi)*_C1, (61, 1) = -1, (61, 2) = 0, (61, 3) = 0, (61, 4) = _C1-xi, (62, 1) = -1/2, (62, 2) = 0, (62, 3) = 0, (62, 4) = -(1/2)*xi+_C1, (63, 1) = 0, (63, 2) = 0, (63, 3) = 0, (63, 4) = _C1, (64, 1) = 1/2, (64, 2) = 0, (64, 3) = 0, (64, 4) = (1/2)*xi+_C1, (65, 1) = 1, (65, 2) = 0, (65, 3) = 0, (65, 4) = _C1+xi, (66, 1) = -1, (66, 2) = 1/2, (66, 3) = 0, (66, 4) = 2+exp((1/2)*xi)*_C1, (67, 1) = -1/2, (67, 2) = 1/2, (67, 3) = 0, (67, 4) = 1+exp((1/2)*xi)*_C1, (68, 1) = 0, (68, 2) = 1/2, (68, 3) = 0, (68, 4) = exp((1/2)*xi)*_C1, (69, 1) = 1/2, (69, 2) = 1/2, (69, 3) = 0, (69, 4) = -1+exp((1/2)*xi)*_C1, (70, 1) = 1, (70, 2) = 1/2, (70, 3) = 0, (70, 4) = -2+exp((1/2)*xi)*_C1, (71, 1) = -1, (71, 2) = 1, (71, 3) = 0, (71, 4) = 1+exp(xi)*_C1, (72, 1) = -1/2, (72, 2) = 1, (72, 3) = 0, (72, 4) = 1/2+exp(xi)*_C1, (73, 1) = 0, (73, 2) = 1, (73, 3) = 0, (73, 4) = exp(xi)*_C1, (74, 1) = 1/2, (74, 2) = 1, (74, 3) = 0, (74, 4) = exp(xi)*_C1-1/2, (75, 1) = 1, (75, 2) = 1, (75, 3) = 0, (75, 4) = -1+exp(xi)*_C1, (76, 1) = -1, (76, 2) = -1, (76, 3) = 1/2, (76, 4) = ((1/3)*sqrt(3)-tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (77, 1) = -1/2, (77, 2) = -1, (77, 3) = 1/2, (77, 4) = ((1/2)*sqrt(2)-tanh((1/2)*sqrt(2)*(_C1+xi)))*sqrt(2), (78, 1) = 0, (78, 2) = -1, (78, 3) = 1/2, (78, 4) = 2/(1+2*exp(xi)*_C1), (79, 1) = 1/2, (79, 2) = -1, (79, 3) = 1/2, (79, 4) = (_C1+xi-2)/(_C1+xi), (80, 1) = 1, (80, 2) = -1, (80, 3) = 1/2, (80, 4) = 1+tan((1/2)*_C1+(1/2)*xi), (81, 1) = -1, (81, 2) = -1/2, (81, 3) = 1/2, (81, 4) = -(2+exp((3/2)*xi)*_C1)/(exp((3/2)*xi)*_C1-1), (82, 1) = -1/2, (82, 2) = -1/2, (82, 3) = 1/2, (82, 4) = ((1/10)*sqrt(5)-(1/2)*tanh((1/4)*sqrt(5)*(_C1+xi)))*sqrt(5), (83, 1) = 0, (83, 2) = -1/2, (83, 3) = 1/2, (83, 4) = 1/(1+exp((1/2)*xi)*_C1), (84, 1) = 1/2, (84, 2) = -1/2, (84, 3) = 1/2, (84, 4) = ((1/6)*sqrt(3)+(1/2)*tan((1/4)*sqrt(3)*(_C1+xi)))*sqrt(3), (85, 1) = 1, (85, 2) = -1/2, (85, 3) = 1/2, (85, 4) = ((1/14)*sqrt(7)+(1/2)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (86, 1) = -1, (86, 2) = 0, (86, 3) = 1/2, (86, 4) = -sqrt(2)*tanh((1/2)*sqrt(2)*(_C1+xi)), (87, 1) = -1/2, (87, 2) = 0, (87, 3) = 1/2, (87, 4) = -tanh((1/2)*_C1+(1/2)*xi), (88, 1) = 0, (88, 2) = 0, (88, 3) = 1/2, (88, 4) = 2/(2*_C1-xi), (89, 1) = 1/2, (89, 2) = 0, (89, 3) = 1/2, (89, 4) = tan((1/2)*_C1+(1/2)*xi), (90, 1) = 1, (90, 2) = 0, (90, 3) = 1/2, (90, 4) = tan((1/2)*sqrt(2)*(_C1+xi))*sqrt(2), (91, 1) = -1, (91, 2) = 1/2, (91, 3) = 1/2, (91, 4) = -(1+2*exp((3/2)*xi)*_C1)/(exp((3/2)*xi)*_C1-1), (92, 1) = -1/2, (92, 2) = 1/2, (92, 3) = 1/2, (92, 4) = -((1/10)*sqrt(5)+(1/2)*tanh((1/4)*sqrt(5)*(_C1+xi)))*sqrt(5), (93, 1) = 0, (93, 2) = 1/2, (93, 3) = 1/2, (93, 4) = 1/(-1+exp(-(1/2)*xi)*_C1), (94, 1) = 1/2, (94, 2) = 1/2, (94, 3) = 1/2, (94, 4) = -((1/6)*sqrt(3)-(1/2)*tan((1/4)*sqrt(3)*(_C1+xi)))*sqrt(3), (95, 1) = 1, (95, 2) = 1/2, (95, 3) = 1/2, (95, 4) = -((1/14)*sqrt(7)-(1/2)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (96, 1) = -1, (96, 2) = 1, (96, 3) = 1/2, (96, 4) = -((1/3)*sqrt(3)+tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (97, 1) = -1/2, (97, 2) = 1, (97, 3) = 1/2, (97, 4) = -((1/2)*sqrt(2)+tanh((1/2)*sqrt(2)*(_C1+xi)))*sqrt(2), (98, 1) = 0, (98, 2) = 1, (98, 3) = 1/2, (98, 4) = 2/(-1+2*exp(-xi)*_C1), (99, 1) = 1/2, (99, 2) = 1, (99, 3) = 1/2, (99, 4) = -(_C1+xi+2)/(_C1+xi), (100, 1) = 1, (100, 2) = 1, (100, 3) = 1/2, (100, 4) = -1+tan((1/2)*_C1+(1/2)*xi), (101, 1) = -1, (101, 2) = -1, (101, 3) = 1, (101, 4) = ((1/10)*sqrt(5)-(1/2)*tanh((1/2)*sqrt(5)*(_C1+xi)))*sqrt(5), (102, 1) = -1/2, (102, 2) = -1, (102, 3) = 1, (102, 4) = ((1/6)*sqrt(3)-(1/2)*tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (103, 1) = 0, (103, 2) = -1, (103, 3) = 1, (103, 4) = 1/(1+exp(xi)*_C1), (104, 1) = 1/2, (104, 2) = -1, (104, 3) = 1, (104, 4) = 1/2+(1/2)*tan((1/2)*_C1+(1/2)*xi), (105, 1) = 1, (105, 2) = -1, (105, 3) = 1, (105, 4) = ((1/6)*sqrt(3)+(1/2)*tan((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (106, 1) = -1, (106, 2) = -1/2, (106, 3) = 1, (106, 4) = ((1/68)*sqrt(17)-(1/4)*tanh(((1/4)*_C1+(1/4)*xi)*sqrt(17)))*sqrt(17), (107, 1) = -1/2, (107, 2) = -1/2, (107, 3) = 1, (107, 4) = -(exp((3/2)*xi)*_C1+1)/(-1+2*exp((3/2)*xi)*_C1), (108, 1) = 0, (108, 2) = -1/2, (108, 3) = 1, (108, 4) = 1/(2+exp((1/2)*xi)*_C1), (109, 1) = 1/2, (109, 2) = -1/2, (109, 3) = 1, (109, 4) = ((1/28)*sqrt(7)+(1/4)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (110, 1) = 1, (110, 2) = -1/2, (110, 3) = 1, (110, 4) = ((1/60)*sqrt(15)+(1/4)*tan((1/4)*sqrt(15)*(_C1+xi)))*sqrt(15), (111, 1) = -1, (111, 2) = 0, (111, 3) = 1, (111, 4) = -tanh(_C1+xi), (112, 1) = -1/2, (112, 2) = 0, (112, 3) = 1, (112, 4) = -(1/2)*sqrt(2)*tanh((1/2)*sqrt(2)*(_C1+xi)), (113, 1) = 0, (113, 2) = 0, (113, 3) = 1, (113, 4) = 1/(_C1-xi), (114, 1) = 1/2, (114, 2) = 0, (114, 3) = 1, (114, 4) = (1/2)*tan((1/2)*sqrt(2)*(_C1+xi))*sqrt(2), (115, 1) = 1, (115, 2) = 0, (115, 3) = 1, (115, 4) = tan(_C1+xi), (116, 1) = -1, (116, 2) = 1/2, (116, 3) = 1, (116, 4) = -((1/68)*sqrt(17)+(1/4)*tanh(((1/4)*_C1+(1/4)*xi)*sqrt(17)))*sqrt(17), (117, 1) = -1/2, (117, 2) = 1/2, (117, 3) = 1, (117, 4) = -(exp((3/2)*xi)*_C1+1)/(exp((3/2)*xi)*_C1-2), (118, 1) = 0, (118, 2) = 1/2, (118, 3) = 1, (118, 4) = 1/(-2+exp(-(1/2)*xi)*_C1), (119, 1) = 1/2, (119, 2) = 1/2, (119, 3) = 1, (119, 4) = -((1/28)*sqrt(7)-(1/4)*tan((1/4)*sqrt(7)*(_C1+xi)))*sqrt(7), (120, 1) = 1, (120, 2) = 1/2, (120, 3) = 1, (120, 4) = -((1/60)*sqrt(15)-(1/4)*tan((1/4)*sqrt(15)*(_C1+xi)))*sqrt(15), (121, 1) = -1, (121, 2) = 1, (121, 3) = 1, (121, 4) = -((1/10)*sqrt(5)+(1/2)*tanh((1/2)*sqrt(5)*(_C1+xi)))*sqrt(5), (122, 1) = -1/2, (122, 2) = 1, (122, 3) = 1, (122, 4) = -((1/6)*sqrt(3)+(1/2)*tanh((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3), (123, 1) = 0, (123, 2) = 1, (123, 3) = 1, (123, 4) = 1/(-1+exp(-xi)*_C1), (124, 1) = 1/2, (124, 2) = 1, (124, 3) = 1, (124, 4) = -1/2+(1/2)*tan((1/2)*_C1+(1/2)*xi), (125, 1) = 1, (125, 2) = 1, (125, 3) = 1, (125, 4) = -((1/6)*sqrt(3)-(1/2)*tan((1/2)*sqrt(3)*(_C1+xi)))*sqrt(3)}), rows = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125], columns = [A, B, C, F])

 

Download DataFRame.mw

If you want to use Dimension, you just need to change uses RationalTriigonometry to uses LinearAlgebra. If you want to use type, you need to put 'Matrix' like that, with unevaluation quotes. That's because Matrix(1,3) is an executable command, not just a type.

(f,g):= <<a|b|c>>, <<d,e,h>>:
type(f, 'Matrix'(1,3)), type(g, 'Matrix'(1,3)), type(g, 'Matrix'(3,1));

                       
true, false, true

Unevaluation quotes are not needed for types used in a procedure header:

f:= proc(p::Matrix(1,3)) ... end proc:

To get a Crout decomposition, first get a standard LUDecomposition of the transpose of the coefficient matrix, then transpose each of the returned matrices, then reverse the order that they are multiplied. Although that may seem like a lot of steps, it can all be done in one short command in Maple:

restart:

Eqs:= [4*x+y+z=4, x+4*y-2*z=4, 3*x+2*y-4*z=6]:

(A,B):= LinearAlgebra:-GenerateMatrix(Eqs, [x,y,z]):

(P,L,U):= LinearAlgebra:-LUDecomposition(A^%T, output= ['P','U','L'])^~%T;

P, L, U := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 4, (1, 2) = 0, (1, 3) = 0, (2, 1) = 1, (2, 2) = 15/4, (2, 3) = 0, (3, 1) = 3, (3, 2) = 5/4, (3, 3) = -4}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 1/4, (1, 3) = 1/4, (2, 1) = 0, (2, 2) = 1, (2, 3) = -3/5, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

L.U.P - A;

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

 

Download Crout.mw

Note the order specified in the output option: ['P', 'U', 'L'] rather than the usual ['P', 'L', 'U'].

You are trying to solve 2 equations for 1 variable. It's not usually possible to get an unconditional solution when there are more equations than variables being solved for. Here are 2 options:

  • Add a 2nd variable (of your choice) to solve for,
  • Accept a conditional solution.

To add a second variable (for example, Clm):

solve({tau = `&tau;opt`, lambda = `&lambda;opt`}, {w, Clm})

To get a possibly conditional solution, use eliminate instead of solve:

eliminate({tau = `&tau;opt`, `&lambda;opt` = lambdaopt}, {w})

The return will be a list of two sets. The first set is the solution(s) for w (only one in this case). The second set is expressions (only one in this case) that must equal 0 in order for the first set to be valid.

You've made a quite interesting discovery (Vote up): Overloads in modules don't explicitly have option overload, although they do otherwise contain the correct programmatic structure of an overload. So, the workaround for your procedure Isee is to explicily insert option overload when that's needed, like this:

Isee:= proc(a::procedure)
local vp:= interface('verboseproc'= 3), p:= eval(a);
    if op([5,1], ToInert(eval(a)))::specfunc(_Inert_OVERLOADLIST) then
        p:= subsop(3= overload, eval(a))  #op(3,a) is the explicit options
    fi;
    printf("%P", eval(p));
    interface('verboseproc'= vp);
    return
end proc:

 

There are several things that I did to make your double and quadruple summations faster. The most important and the most obvious is that any factor in a sum that doesn't depend on the summation variable should be factored out. Otherwise, those binomials (and other things) get recomputed many times,. Some other tricks:

  1. GAMMA(s1+h+1)/(GAMMA(s1+1)*h!) = binomial(s1+h, h), even when s1 isn't an integer.
  2. All necessary binomials can be pre-computed once, via very simple recursive formulae:
    [1, seq[scan= `*`]((n+1)/k - 1, k= 1..n)] generates the sequence binomial(n,k) $ k= 0..n (i.e., the entire (n+1)st row of Pascal's triangle). By changing the order of subtraction to 1 - (n+1)/k, we generate (-1)^k*binomial(n,k).
    [1, seq[scan= `*`](1 + s/k, k= 1..upto)] generates binomial(s+k, k) $ k= 0..upto.
  3. (beta1 - 1)^h*(-1)^h = (1 - beta1)^h, and of course this is trivial to generate recursively.
  4. The additions of fixed terms in the denominators can be pre-computed:
    e.g.DL:= x+y + b1*(s1+h) + b2*(s2+v).
  5. The undocumented command inner(A, B) computes the inner (or "dot") product of two lists of equal length; i.e.inner(A,B) = add(A*~B) = sum(A[k]*B[k], k= 1..nops(A)).
  6. The updating assignment operators +=*=, and ++ work exactly the same as they do in the numerous other languages that have them:
    S+= a  <=>  S:= S+a
    B*= k  <=>  B:= B*k
    d++  
    <=>  (d+= 1) - 1, i.e., it increments d and returns the pre-incremented value,

Here is my worksheet with all my improvements and verifications that my methods give the same results as @dharr.

 

restart:

n1:= 423: x:= 16: n2:= 81: y:= 35: s1:= 1/10: b1:= 7: beta1:= 21/10: s2:= 1/10: b2:= 7:
beta2 := 21/10:

First I verify that my simplifications produce the same results as @dharr:

A:= proc(h,v,r)
local
    L, j, S:= 0, n1x:= n1-x+1, n2y:= n2-y+1, Ls:= [$0..n2y-1],
    Dj:= r + x + b1*(s1+v), DL:= x+y + b1*(s1+h) + b2*(s2+v),
    BL:= [1, seq['scan'= `*`](1-n2y/L, L= 1..n2y-1)], Bj:= 1
;
    for j to n1x do
        S+= inner(BL, 1/~(DL++ +~ Ls))*Bj/Dj++;
        Bj*= 1 - n1x/j
    od;
    S*binomial(s1+h, h)*binomial(s2+v, v)*(1-beta1)^h*(1-beta2)^v
end proc
:

CodeTools:-Usage(A(2,2,0));

memory used=7.72MiB, alloc change=0 bytes, cpu time=0ns, real time=33.00ms, gc time=0ns

11727199469241514779864393729287999595266717038898384405454822453889989726964576758757729551099323484694782170822448350244634045448648056150840927233527350118380124119264858615283201523602923810903830006171445640638533014964609388484372553536841310967853824558690932280088151544584971199415788181111551306532754880119508566210291084045598562471540440317095151211911113829813243986384020095260781211101363284506805774438303489939264952762167438202379620004245323297602579179457497328410039101743209644168235298998961095392278935981336337925654946855818892100272459692432824817768478928223155226897063053135874218725475831316965225841532156062303907670391646481346412180543470550738955412983380825233032396184376956505282354537912590976013025195012646732190615857238658037431378033943474292755126953125/6382265268317256219633710058998499818340873590563036702803822950484199699636302738462052037083809489945501654638778705432982835407262106422716055822223400225220629848888603203921980303115472012139298206087469920885254016501522878034151924440738350864243996392880003254552368644323922787997879524243559004914030851003740366052093558872264913393738584398643237741388376227019971696955206515106578177861348809414199987981935214749218771677333981945489142846776730080142869549055976924435701756372241817375336920507491648219754129346141714754707551648893025832772408084923821700316568058764587634659823042662378587917652228685077432247136823506786967161644710468316981814899035776299987989971099597861998466613316946045883428522261542320902882571202585668513207901611181230727412654811333329187224660577277205763279177427978308304241574151519438327049907892296647014672715620294656

evalf(%);

0.1837466632e-77

f:= (r, upto)->
local
    h, v, j, L, n1x:= n1-x+1, n2y:= n2-y+1, Ls:= [$0..n2y-1], js:= [$0..n1x-1],
    BL:= [1, seq['scan'= `*`](1-n2y/L, L= 1..n2y-1)],
    Bj:= [1, seq['scan'= `*`](1-n1x/j, j= 1..n1x-1)],
    Beta1:= 1-beta1, Beta2:= 1-beta2,
    Bs1:= [1, seq['scan'= `*`](1+s1/h, h= 1..upto)],
    Bs2:= [1, seq['scan'= `*`](1+s2/h, h= 1..upto)],
    B1:= [1, seq['scan'= `*`](Beta1, h= 1..upto)],
    B2:= [1, seq['scan'= `*`](Beta2, h= 1..upto)],
    A0:= (h,v,r)->
    local j, Dj:= r + x + b1*(s1+v), DL:= x+y + b1*(s1+h) + b2*(s2+v);
        add(inner(BL, 1/~(DL++ +~ Ls))*Bj[j]/Dj++, j= 1..n1x),
    B0:= (h,v,r)->
    local L, DL:= y - r + b2*(s2+h), Dj:= x+y + b2*(s2+h) + b1*(s1+v);
        add(inner(Bj, 1/~(Dj++ +~ js))*BL[L]/DL++, L= 1..n2y)
;
    add(Bs1[h]*B1[h]*add(A0(h-1,v-1,r)*Bs2[v]*B2[v], v= 1..upto+1), h= 1..upto+1)
    +
    add(Bs1[v]*B1[v]*add(B0(h-1,v-1,r)*Bs2[h]*B2[h], h= 1..upto+1), v= 1..upto+1)
:

CodeTools:-Usage(f(0,12));

memory used=3.80GiB, alloc change=0 bytes, cpu time=1.92s, real time=6.81s, gc time=531.25ms

114249022902597666588491400529505235216742049616231180869631619194167698464302221521109360278934161699249264126826236228253701293270492644550135177145016349814982113455183820820735876815796463679992519208283503642450130209375877055834771405738601458875577451563602032933837943025767731232207854934759236939341322568521090401156938484109405395425106996068885180201446511126644125409694777192264543924174126949778005106553840262917702653247531868774015140088404720078587672388076732410686714770939922375245824000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/4478112673625161634402912271274057087521425782459964471363322850631457597742398047074088546911131451856756368982860023346654177624065136219112870362974132591633772922976976016146648645581986021657025573763585023497503972196876316120665545360282282680322522472194461718178716824852465782992306776138047404097571796261065850414338472933710797700189622470162561730240651195333635833352277583626670180879730361251512986788399320104862652482661166302364468264845833967133426250993316566352774199352462247496894848151055424852777184106477710417868463737767180212637570654326336497085984319988974445914462490654328034321182352155451367268612522705340661230039301539950445376032066380305314154637436491880112866704742279027028488977660000585169277423676424285496535951865146024850581707926633898571343437487693846692653268159361127272552016275556640003360341921899571661034103268149587939236207824679329125781964757872174171342424591595209864084608515982176191174973912465653082613424079377178453298484585210385316658608895204147668705453968995722653400843313999068483592478297363991

evalf(%);

0.2551276201e-55

CodeTools:-Usage(f(0,30)):

memory used=22.50GiB, alloc change=0 bytes, cpu time=9.80s, real time=40.99s, gc time=3.25s

evalf(%);

0.2551276201e-55

 

The terms from 13 to 30 were too small to make any difference.

Download FasterQuadrupleSum.mw

You wrote:

  • The combine function applies transformations which combine terms in sums,...

Unfortunately, that is just the most simplistic purpose of combine. In my mind, the primary purpose of combine is to make function arguments more complicated (such as changing func1(x) to func2(2*x)); expand does the reverse, changing 2*x to x. The could be replaced by any integer.

This has always seemed intuitively clear to me, and I never use a menu to do something that can be done with a typed command. Perhaps those two things are related to each other.

You simply need to use Typesetting:-Typeset in the plot option:

labels= [y(x), Typesetting:-Typeset(diff(y(x),x))]

To get a decimal version of the real value of a, use

evalf(a[1])

instead of your eval(a[1]). The f in evalf stands for floating-point. A more straightforward alternative is to replace your solve command with fsolve:

fsolve(period_eqn, a)
             
 8058.994329

There is no problem with Maple itself here. The problem is only with MaplePrimes's ability to display the worksheet inline. Downloading the worksheet link produces exactly the file that you uploaded.

Here, I've downloaded, executed, and re-uploaded your worksheet. If you download this link, I think you'll see that it's equivalent to your original:

Download predator_prey.mw

First, I'll compactify the code that produces your static plot, and I'll add hooks for controlling the parameters with more finesse. In particular, note the parameters option to dsolve and the solitary call to numsols with the parameters option:

restart:
vars:= [w, x, y, z]:
sys:= {
    diff~(vars(t), t)[]=~ ((y*z)(t), a*w(t), (x*z + w)(t), (-x*y)(t)),
    (vars(0)=~ vars||~0)[]
}:
params:= [a, w0, x0, y0, z0]:
param_vals:= [2, -0.727367040, -0.728244724, -0.237753623, 0.014225402]:
numsol:= dsolve(sys, numeric, method= rkf45, 'parameters'= params):
col:= [red, magenta, cyan, blue]:
numsol('parameters'= param_vals):
plots:-odeplot(
    numsol, `[]`~(t, vars(t)), t= 0..3, color= col, legend= vars(t)
):


The next step is to abstract that into a procedure that produces that static plot for given parameter values:

OnePlot:= proc(param_vals, tf)
    numsol('parameters'= param_vals);
    plots:-odeplot(
        numsol, `[]`~(t, vars(t)), t= 0..tf, 'color'= col, 'legend'= vars(t)
    )
end proc
: 


And finally the Explore:

Explore(
    OnePlot(params, tf),
    'parameters'= [(params[], tf)=~ (1. .. 3., (-1. .. 0.) $ 3, 0. .. 1., 3. .. 9.)],
    'initialvalues'= [(params[], tf)=~ (param_vals[], 3)]
);

 

Like this:

seq(cat("%15s" $ k), k= 1..4);

To continue, you need to say what mathematically makes the difference between solid and dashed lines.

params:= {
    h= piecewise(
        z <= d+1,   1,
        z <= d+4,   1-delta/2*(1 + cos(2*Pi*(z - 1 - 1/2))),
        z <= d+6,   1 
    ),
    w0= -c*h^2/4 + 3/64*(b*c-4*a)*h^4 + 19/2304*b*(b-4*a)*h^6,
    w1= c/4 + (4*a-b*c)*h^2/16,
    w2= (4*(b*c-4*a)-b*h^2)/256,
    w3= b*(b-4*a)/2304,
    a= x4*S*Gr*sin(alpha)/(4*x1*x5),
    b= 1/Da + x3*M/(x1*(1+m^2)),
    c= Dp/x1,
    Dp= 96*x1/((6-b*h^2)*h^4)*(F + a*h/24 - 11/6144*b*(b-4*a)*h^8),
    x1= ((1-phi1)*(1-phi2))^(-5/2),
    x2= (1-phi2)*(1 - phi1 + phi1*Rs1/Rf) + phi2*Rs2/Rf,
    x3= shnf/sf,
    x4= (1-phi2)*(1 - phi1 + phi1*RBs1/RBf) + phi2*RBs2/RBf,
    x5= khnf/kf,
    shnf= sbf*(ss2+2*sbf-2*phi2*(sbf-ss2))/(ss2+2*sbf+phi2*(sbf-ss2)),
    sbf= sf*(ss1+2*sf-2*phi1*(sf-ss1))/(ss1+2*sf+phi1*(sf-ss1)),
    khnf= kbf*(ks2+2*kbf-2*phi2*(kbf-ks2))/(ks2+2*kbf+phi2*(kbf-ks2)),
    kbf= kf*(ks1+2*kf-2*phi1*(kf-ks1))/(ks1+2*kf+phi1*(kf-ks1)),
    RBs1= 8933*16.7e6,
    RBf= 1063*1.8e6,
    RBs2= 6320*18e6,
    kf= 0.492,
    sbf= 6.67e-1, ss2= 2.7e-8,
    sf= 6.67e-1, ss1= 59.6e6,
    ks2= 76.5, kf= 0.492, ks1= 401,
    phi1= 0.01, phi2= 0.02, alpha= Pi/4, m= 0.5, Da= 0.1, Gr= 5, 
    delta= 1, S= 0.5,  d= 1,
    F= 1, z= 1
}:
                                      
W1:= eval[recurse](w0+w1*r^2+w2*r^4+w3*r^6, params):

plot(
    eval~(W1, M=~ [2, 5, 7]), r= 0..1,
    color= [red, blue, green], axes= boxed,
    legend= typeset~(M^2=~ [2,5,7]),
    labels= [r, w(r,1)], labeldirections= [horizontal, vertical],
    axesfont= [helvetica, 16], labelfont= [helvetica, 16],
    caption= typeset(
        ``(seq(v = eval[recurse](v, params), v= (m, Da, Gr, S, alpha, phi1, phi2)))
    )
);

If I translate your f into 1D-input, it becomes this:

f:= (u[1], u[2])-> u[1]^2*diff(u[2], x);

It's simply a nuance of Maple syntax that indexed variables such as u[1] are not allowed to be formal parameters of procedures. There is a simple fix that allows the variables to still display as subscripted:

f:= (u__1, u__2)-> u__1^2*diff(u__2, x);

First 8 9 10 11 12 13 14 Last Page 10 of 395