From a2b4257d01dc3e4c94d6e0afdd2d18251f5c76bf Mon Sep 17 00:00:00 2001 From: Chris Sangwin <C.J.Sangwin@ed.ac.uk> Date: Fri, 8 Mar 2024 07:35:19 +0000 Subject: [PATCH] Workaround to issue #1129. TODO: error trapping in user contributed functions. --- stack/maxima/contrib/vectorcalculus.mac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack/maxima/contrib/vectorcalculus.mac b/stack/maxima/contrib/vectorcalculus.mac index e41351c22..9570f3b6e 100644 --- a/stack/maxima/contrib/vectorcalculus.mac +++ b/stack/maxima/contrib/vectorcalculus.mac @@ -24,7 +24,7 @@ /* Calculate the divergence of a vector-valued function */ /****************************************************************/ div(u, vars):= block([div_vec], - if not(listp(vars)) or emptyp(vars) then error("div: the second argument must be a list of variables."), + /* TODO: error trapping: if not(listp(vars)) or emptyp(vars) then error("div: the second argument must be a list of variables."), */ if matrixp(u) then funcs: list_matrix_entries(u) else funcs: flatten(u), /* TODO: confirm div should always simplify? */ div_vec: map(lambda([ex], ev(diff(funcs[ex],vars[ex]), simp)), ev(makelist(ii,ii,1,length(vars)), simp)), @@ -39,7 +39,7 @@ s_test_case(div(matrix([x^2*cos(y),y^3]),[x,y]), 2*x*cos(y)+3*y^2); /* Calculate the curl of a vector-valued function */ /****************************************************************/ curl(u,vars):= block([cux, cuy, cuz], - if not(listp(vars)) or emptyp(vars) then error("curl: the second argument must be a list of 3 variables."), + /* TODO: error trapping: if not(listp(vars)) or emptyp(vars) then error("curl: the second argument must be a list of 3 variables."), */ if matrixp(u) then [ux,uy,uz]: list_matrix_entries(u) else [ux,uy,uz]: flatten(u), cux: diff(uz,vars[2]) - diff(uy,vars[3]), cuy: diff(ux,vars[3]) - diff(uz,vars[1]), -- GitLab