Yes I have. off echo, fancy,raise,lower; load_package scope; depend(DvDX, x4, x11); J := DuDY*DvDX*DwDZ - DuDX*DvDZ*DwDY + DuDX*DvDY*DwDZ$ I1bar := 1/J^k; off nat; on echo$ optimize DI1barDx11 :=: df(I1bar,x11), DI1barDx4 :=: df(I1bar,x4); end; Output (excerpt): ... g13 := g5*DuDX$ g14 := DwDY*DvDZ$ g16 := DvDY*DwDZ$ g5 := (g11 + DuDX*(g16 - g14))**k$ ... g5 is now the erring term.
Yes I have. off echo, fancy,raise,lower; load_package scope; depend(DvDX, x4, x11); J := DuDY*DvDX*DwDZ - DuDX*DvDZ*DwDY + DuDX*DvDY*DwDZ$ I1bar := 1/J^k; off nat; on echo$ optimize DI1barDx11 :=: df(I1bar,x11), DI1barDx4 :=: df(I1bar,x4); end; Output (excerpt): ... g13 := g5*DuDX$ g14 := DwDY*DvDZ$ g16 := DvDY*DwDZ$ g5 := (g11 + DuDX*(g16 - g14))**k$ ...
I found a hack. The problem seems to be arise with the divisor in the quotient rule, therefore I optimized it separately as shown below: optimize DI1barDx11_ :=: (J^k*df(I1, x11) - I1*df(J^k, x11)), %/J^(2*k), DI1barDx4_ :=: (J^k*df(I1, x4) - I1*df(J^k, x4)), %/J^(2*k), den :=: J^(2*k); No undefined g10 term appears in this case.
The g10 problem only appears when J has an exponent. No such problem occurs when I1bar := I1/J;
I take that back. Problem not solved. I now have a situation where g10 is referenced before it is defined g209 := g882*g10$ g211 := g881*g10$ g926 := g924*j$ g213 := g926*g10$ g525 := g13*g10$ g928 := g1174*g10$ ... % skip eight lines g10 := ((g1441 + g1381 + g1059 - g1437*DvDX + g1210*DwDZ)/g13)**k$
Reduce references undefined term.
Most viewers that I have come across only support meshes. I am looking for a viewer that can display: Points (I'm willing to compromise on this) Lines Faces Curves (2D and 3D splines), and Surfaces (BURBS) Collada too apparently supports these primitives but most viewers will only display a subset of them. I am open to any formats for which GLC-Player can display these primitives.
Egg on my face, I got this wrong.
[delete]
Thank you. I found part in the docs but not this particular incantation. It might be a beneficial addition.
I am puzzled by the answers I am getting from reduce and I have checked this over many times so I apologize if I have made a mistake somewhere. Ignoring the denominator, the triple integral I1 := int(int(int(x^a*y^b*z^c,x),y),z); is x^(a+1)*y^(b+1)*z^(c+1). And, ignoring the denominator, the definite integral equivalent I2 := int(int(int(x^a*y^b*z^c,x,-1,1),y,-1,1),z,-1,1); ought to be equivalent to 1^(a+1)*1^(b+1)*1^(c+1) - (-1)^(a+1)*(-1)^(b+1)*(-1)^(c+1); So that when a = 2, b = 1, c = 3, I2 should...
I am puzzled by the answers I am getting from reduce and I have checked this over many times so I apologize if I have made a mistake somewhere. Ignoring the denominator, the triple integral I1 := int(int(int(x^a*y^b*z^c,x),y),z); is x^(a+1)*y^(b+1)*z^(c+1). And, ignoring the denominator, the definite integral equivalent I2 := int(int(int(x^a*y^b*z^c,x,-1,1),y,-1,1),z,-1,1); ought to be 1^(a+1)*1^(b+1)*1^(c+1) - (-1)^(a+1)*(-1)^(b+1)*(-1)^(c+1); So that when a = 2, b = 1, c = 3, I2 should be 2. Unfortunately...
I am puzzled by the answers I am getting from reduce and I have checked this over many times so I apologize if I have made a mistake somewhere. Ignoring the denominator, the triple integral I1 := int(int(int(x^a*y^b*z^c,x),y),z); is x^(a+1)*y^(b+1)*z^(c+1). And, ignoring the denominator, the definite integral equivalent I2 := int(int(int(x^a*y^b*z^c,x,-1,1),y,-1,1),z,-1,1); ought to be 1^(a+1)*1^(b+1)*1^(c+1) - (-1)^(a+1)*(-1)^(b+1)*(-1)^(c+1); So that when a = 2, b = 1, c = 3, I2 should be 2. Unfortunately...
Is there an easy way to get reduce to split an expression into its parts e.g. given func = "#381*x1**4 + #382*x1**3*x3 + #383*x1**3*x5 + #384*x1**3*x7 + #385*x1**3 + #386*x1**2*x2**2 + #387*x1**2*x2*x4 + #388*x1**2*x2*x6 + #389*x1**2*x2*x8 + #390*x1**2*x2 + #391*x1**2*x3**2 + #392*x1**2*x3*x5 + #393*x1**2*x3*x7 + #394*x1**2*x3 + #395*x1**2*x4**2 + ... I would like to return the list {#381*x1**4, #382*x1**3*x3, #383*x1**3*x5, ...}. (The # terms arise from the application of the coeff2 package.)
In retrospect the problem appears to be with lambda. v := lambda*x; Returns nothing but when I enter v; I get the error: ***** Invalid parameter: (times x) Could it be that reduce is parsing lambda as a lambda expression?
In retrospect the problem appears to be with lambda. v := lambda*x; Returns nothing but when I enter v; I get the error: ***** Invalid parameter: (times x)
At the final step of the following calculation off fancy,echo,raise,lower$ DuDX := (eta*x - eta + x - 1)/8$ DvDX := (eta*y - eta + y - 1)/8$ DuDY := (x*xi + x - xi - 1)/8$ DvDY := (y*xi + y - xi - 1)/8$ j := 1/4$ F := mat((1,0),(0,1)) + mat((DuDX, DuDY), (DvDX, DvDY))/j$ C := tp(F)*F; E := 0.5*(C - mat((1,0),(0,1))); W := 0.5*lambda*(trace(E))^2 + mu*trace(E^2); I get the error **** Invalid parameter: (plus (times (expt (trace E) 2)) (times mu (trace (expt E 2)))). when I try to print out W. I am...
At the final step of the following calculation off fancy,echo,raise,lower$ DuDX := (eta*x - eta + x - 1)/8$ DvDX := (eta*y - eta + y - 1)/8$ DuDY := (x*xi + x - xi - 1)/8$ DuDY := (y*xi + y - xi - 1)/8$ j := 1/4$ F := mat((1,0),(0,1)) + mat((DuDX, DuDY), (DvDX, DvDY))/j$ C := tp(F)*F; E := 0.5*(C - mat((1,0),(0,1))); W := 0.5*lambda*(trace(E))^2 + mu*trace(E^2); I get the error **** Invalid parameter: (plus (times (expt (trace E) 2)) (times mu (trace (expt E 2)))). when I try to print out W. I am...
I logged on to say this. (GUI version of reduce csl on Ubuntu downloaded from Sourceforge.) Thank you.
Perhaps the statement you include in your report is used in the context of some previous computations one of which sets one of x1 to x9 to be an expression that depends on g.. Unfortunately the problem still occurs in a fresh reduce session. The reduce accept the input but when I type g I get the error. Update What's unusual is that when I press the up arrow key reduce only recalls the first part of the expression g := 2*x1**2 - x1*x3 - 2*x1 + 2*x2**2 - x2*x4 + 2*x3**2 - x3 + 2*x4**2 - 4 + 2*x3**2...
Perhaps the statement you include in your report is used in the context of some previous computations one of which sets one of x1 to x9 to be an expression that depends on g.. Unfortunately the problem still occurs in a fresh reduce session. The reduce accept the input but when I type g I get the error. Update What's unusual is that when I press the up arrow key reduce only recalls the first part of the expression g := 2*x1**2 - x1*x3 - 2*x1 + 2*x2**2 - x2*x4 + 2*x3**2 - x3 + 2*x4**2 - 4 + 2*x3**2...
Perhaps the statement you include in your report is used in the context of some previous computations one of which sets one of x1 to x9 to be an expression that depends on g.. Unfortunately the problem still occurs in a fresh reduce session. The reduce accept the input but when I type g I get the error.
When I input a lengthy expression into reduce, e.g. below g := 2*x1**2 - x1*x3 - 2*x1 + 2*x2**2 - x2*x4 + 2*x3**2 - x3 + 2*x4**2 - 4 + 2*x3**2 - x3*x5 - 5*x3 + 2*x4**2 - x4*x6 + 2*x5**2 - 4*x5 + 2*x6**2 + 2 + 2*x1**2 - x1*x3 - x1*x7 - 2*x1*x9 + 2*x10**2 - 2*x10*x2 - x10*x4 - x10*x8 + 2*x2**2 - x2*x4 - x2*x8 + 2*x3**2 - 2*x3*x7 - x3*x9 + 2*x4**2 - 2*x4*x8 + 2*x7**2 - x7*x9 + 2*x8**2 + 2*x9**2 - 6 + 2*x10**2 - x10*x12 - x10*x4 - 2*x10*x6 + 2*x11**2 - 2*x11*x3 - x11*x5 - x11*x9 + 2*x12**2 - 2*x12*x4...
Thanks for your suggestions. The LISP approach is less appealing because I do not know the language, therefore I am struggling to appreciate Francis' reply. The input suggestion would work but I fear it is fragile as I'd have to remember lots of line numbers when generating a lot of expressions, and I cannot reorder inputs. The saveinput feature that you demo'ed would be an improvement, however my current use case centres on a single use input. Evaluate string would be the ideal feature. This is...
I find myself dynamically writing expressions such as the following to file write x," := ",k,"$"; and needing to evaluate them later but the only way I can see to do this is to load said file. Does reduce offer a better way to do this without jumping through the hoop of file IO.
Yes it does but only on shorter expressions such as my second example. The substitution does not work on my first example.
Another example `!T1 := ( !A!R1 - !C!S1); !T2 := ( !A!R2 - !C!S2); !T3 := ( !A!R3 - !C!S3); !T4 := ( !A!R4 - !C!S4);` !E1 := (-!D*!R1 + !B*!S1); !E2 := (-!D*!R2 + !B*!S2); !E3 := (-!D*!R3 + !B*!S3); !E4 := (-!D*!R4 + !B*!S4); G := !T1*k1 + !T2*k2 + !T3*k3 + !T4*k4; H := !E1*k1 + !E2*k2 + !E3*k3 + !E4*k4; M := !T1*k5 + !T2*k6 + !T3*k7 + !T4*k8; N := !E1*k5 + !E2*k6 + !E3*k7 + !E4*k8; G*N - H*M; Again I'd like to substitute B*A - C*D for J (or 8) in the final expression that contains 24 pairs of terms...
Another example !T1 := ( !A*!R1 - !C*!S1); !T2 := ( !A*!R2 - !C*!S2); !T3 := ( !A*!R3 - !C*!S3); !T4 := ( !A*!R4 - !C*!S4); !E1 := (-!D*!R1 + !B*!S1); !E2 := (-!D*!R2 + !B*!S2); !E3 := (-!D*!R3 + !B*!S3); !E4 := (-!D*!R4 + !B*!S4); G := !T1*k1 + !T2*k2 + !T3*k3 + !T4*k4; H := !E1*k1 + !E2*k2 + !E3*k3 + !E4*k4; M := !T1*k5 + !T2*k6 + !T3*k7 + !T4*k8; N := !E1*k5 + !E2*k6 + !E3*k7 + !E4*k8; G*N - H*M; Again I'd like to substitute B*A - C*D for J (or 8) in the final expression that contains 24 pairs...
Another example `!T1 := ( !A!R1 - !C!S1); !T2 := ( !A!R2 - !C!S2); !T3 := ( !A!R3 - !C!S3); !T4 := ( !A!R4 - !C!S4); !E1 := (-!D!R1 + !B!S1); !E2 := (-!D!R2 + !B!S2); !E3 := (-!D!R3 + !B!S3); !E4 := (-!D!R4 + !B!S4); G := !T1k1 + !T2k2 + !T3k3 + !T4k4; H := !E1k1 + !E2k2 + !E3k3 + !E4k4; M := !T1k5 + !T2k6 + !T3k7 + !T4k8; N := !E1k5 + !E2k6 + !E3k7 + !E4k8; GN - HM;` Again I'd like to substitute B*A - C*D for J (or 8) in the final expression that contains 24 pairs of terms such as !A*!B*R1*S2*k1*k6...
Another example !T1 := ( !A*!R1 - !C*!S1); !T2 := ( !A*!R2 - !C*!S2); !T3 := ( !A*!R3 - !C*!S3); !T4 := ( !A*!R4 - !C*!S4); !E1 := (-!D*!R1 + !B*!S1); !E2 := (-!D*!R2 + !B*!S2); !E3 := (-!D*!R3 + !B*!S3); !E4 := (-!D*!R4 + !B*!S4); G := !T1*k1 + !T2*k2 + !T3*k3 + !T4*k4; H := !E1*k1 + !E2*k2 + !E3*k3 + !E4*k4; M := !T1*k5 + !T2*k6 + !T3*k7 + !T4*k8; N := !E1*k5 + !E2*k6 + !E3*k7 + !E4*k8; G*N - H*M; Again I'd like to substitute B*A - C*D for J (or 8) in the final expression that contains 24 pairs...
I have a complicated expression !E := (!Y1*eta**2*y1 - !Y1*eta**2*y2 + !Y1*eta**2*y3 - !Y1*eta**2*y4 - !Y1*eta*x1*xi + !Y1*eta*x1 + !Y1*eta*x2*xi - !Y1*eta*x2 - !Y1*eta*x3*xi + !Y1*eta*x3 + !Y1*eta*x4*xi - !Y1*eta*x4 - 2*!Y1*eta*y1 + 2*!Y1*eta*y2 + !Y1*x1*xi - !Y1*x1 - !Y1*x2*xi + !Y1*x2 - !Y1*x3*xi + !Y1*x3 + !Y1*x4*xi - !Y1*x4 + !Y1*y1 - !Y1*y2 - !Y1*y3 + !Y1*y4 - !Y2*eta**2*y1 + !Y2*eta**2*y2 - !Y2*eta**2*y3 + !Y2*eta**2*y4 + !Y2*eta*x1*xi + !Y2*eta*x1 - !Y2*eta*x2*xi - !Y2*eta*x2 + !Y2*eta*x3*xi...
This is a tall order but, is there a way in reduce to rewrite a series of given expressions in terms common subexpressions, which are functions of eta and xsi? For example the subsexpression (eta*xi + eta + xi + 1) appears eight times in the eight functions below. This is merely a 2d example. In 3d I'd have a series of 24 expressions and I don't trust myself to find the subexpressions manually. An alternative could be to write a Python script to do the job, but I'd hate to reinvent the wheel if this...
This is a tall order but, is there a way in reduce to rewrite a series of given expressions in terms common subexpressions, which are functions of eta and xsi? For the subsexpression (eta*xi + eta + xi + 1) appears eight times in the eight function below. This is merely a 2d example. I'd have a series of 24 expressions and I don't trust myself to find the subexpressions manually. An alternative could be to write a Python script to do the job, but I'd hate to reinvent the wheel if this functionality...
How can I extract the six coefficients a ... f of a mixed polynomial ax^2 + by^2 + cxy + dx + ey + f? Unfortunately, the operator coeff doesn't quite work well for mixed polynomials. Please advise. Regards.
How can I extract the six coefficients a ... f of an algebraic expression ax^2 + by^2 + cxy + dx + ey + f? Unfortunately, the operator coeff doesn't quite work well for mixed polynomials. Please advise. Regards.
I'm exporting my results to file but the output is limited to 80 chars per line. Is there a way to set this limit to unlimited?
"fancy off;" worked brilliantly. Thanks!
I am working with large expression such as: N1 := (1 - xi)*(1 - eta)*(1 - zeta)/8; N2 := (1 + xi)*(1 - eta)*(1 - zeta)/8; N3 := (1 + xi)*(1 + eta)*(1 - zeta)/8; N4 := (1 - xi)*(1 + eta)*(1 - zeta)/8; N5 := (1 - xi)*(1 - eta)*(1 + zeta)/8; N6 := (1 + xi)*(1 - eta)*(1 + zeta)/8; N7 := (1 + xi)*(1 + eta)*(1 + zeta)/8; N8 := (1 - xi)*(1 + eta)*(1 + zeta)/8; DN1xi := df(N1,xi,1); DN2xi := df(N2,xi,1); DN3xi := df(N3,xi,1); DN4xi := df(N4,xi,1); DN5xi := df(N5,xi,1); DN6xi := df(N6,xi,1); DN7xi := df(N7,xi,1);...
Found the answer. off exp; OR factor x;
Found the answer. factor x;
How can I ask REDUCE to collect like terms in a polynomial. For example, given a x^2 + c + b x^2 + d x + e + f x^2 REDUCE should return x^2(a + b + f) + d x + (c + e)