[Newbie:] How to discard higher orders of variables?
Subject: [Newbie:] How to discard higher orders of variables?
From: Schirmacher, Rolf
Date: Wed, 11 Jul 2007 20:09:39 +0200
Hello,
first, please note that I am a newbie to maxima, so perhaps the solution is
rather simple.
My problem is that I want to discard higher order terms within an expression
as it is often done when simplifying analytical equations in engineering.
beta is a small quantity, so terms with an order higher than beta^2 (e.g.
beta^4) should be omitted. In addition, as beta << 1, terms like (1 +
beta^2) should be approximated as 1. (By the way, this is the approximation
made in the Fl?gge shell theory, see e.g. Leissa, Vibration of Shells).
So, let us define a term with some variety of occurances of beta:
(%i3) term : a * beta^2 + b * beta^4 + c * sqrt(1+beta^2) + d * sqrt(2 +
beta^2) + e * sqrt(2
+ beta^4) + f * (2+beta^2);
(%o3)
(beta^2+2)*f+sqrt(beta^4+2)*e+sqrt(beta^2+2)*d+sqrt(beta^2+1)*c+b*beta^4+a*b
eta^2
The most simple idea would be to use a subst(1,beta^1+1,term) to implement
the beta^2 << 1 implication, but that of course fails as subst simply do
some pattern matching. Only the term at c is simplified.
(%i5) subst(1, 1 + beta^2,term);
(%o5)
(beta^2+2)*f+sqrt(beta^4+2)*e+sqrt(beta^2+2)*d+c+b*beta^4+a*beta^2(%i6)
On the other side, a ratsubst (of which the manual says that it "knows
something about arithmetic") is too strong: It seems to conclude that beta^2
must be 0 (including all multiples like beta^4) and discards the factors of
a and b completely.
(%i6) ratsubst(1, 1 + beta^2,term);
(%o6) 2*f+sqrt(2)*e+sqrt(2)*d+c
Now, another idea to get rid at least of the higher orders of beta (say
higher than beta^2) would be to use the approach of ratweight and ratwtlvl,
but also this approach seems to be not really reliable, as the arguments of
the sqrt() seems to be unaffected:
(%i8) ratweight(beta,1);
(%o8) [beta,1]
(%i9) ratwtlvl: 2;
(%o9) 2
(%i11) rat(term);
(%o11)
(beta^2+2)*f+sqrt(beta^4+2)*e+sqrt(beta^2+2)*d+sqrt(beta^2+1)*c+a*beta^2
While you might think that it is because the term with beta^2 is within an
sqrt and so the effective weight would be only 2, this is definitely not the
real reason for the behaviour:
(%i12) ratwtlvl:1;
(%o12) 1
(%i13) rat(term);
(%o13) 2*f+sqrt(beta^4+2)*e+sqrt(beta^2+2)*d+sqrt(beta^2+1)*c
So, the remaining solution coming to my mind was to go to the taylor series:
(%i15) taylor(term,beta,0,2);
(%o15) c+sqrt(2)*d+sqrt(2)*e+2*f+((4*f+sqrt(2)*d+2*c+4*a)*beta^2)/4+...
As a second step, one would have to sort out all terms (manually?) from the
beta^2 term, which occur in the part independent of beta (as they represent
the beta^2 << 1 - issue). While this seems to be reasonable for the terms
given here, it shows up to be rather involved for "real world" equations.
Any idea how these kind of problems might be solved more easily?
Thanks in advance,
Rolf Schirmacher