Small quantities in mathematica

  • Context: Mathematica 
  • Thread starter Thread starter JohnSimpson
  • Start date Start date
  • Tags Tags
    Mathematica quantities
Click For Summary

Discussion Overview

The discussion revolves around handling small quantities in Mathematica, specifically focusing on how to simplify expressions involving a small parameter \(\epsilon\) by removing higher-order terms. Participants explore methods for retaining certain terms while discarding others in various mathematical contexts.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant inquires about automatically removing terms of order \(\epsilon^2\) and higher in Mathematica.
  • Another participant suggests using the Series function to expand expressions and retain terms up to order 1.
  • A follow-up question seeks clarification on how to retain multiplicative terms while discarding additive terms in a specific matrix expression.
  • One participant expresses confusion over the initial request, asking for more precise specifications on what terms should be kept or removed.
  • A participant clarifies that they want to treat \(\epsilon\) as small compared to 1 while keeping it finite, leading to a simplification of the matrix under this assumption.
  • Another participant proposes alternative methods for simplification, including pattern matching and substitutions, while cautioning about the need to verify results for accuracy.
  • Concerns are raised about the limitations of power series expansions in achieving the desired simplifications, particularly in the context of square root expressions.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to simplify expressions involving small quantities, with no consensus reached on a single method that satisfies all conditions outlined in the discussion.

Contextual Notes

Participants note that the effectiveness of proposed methods may depend on the specific forms of expressions and the assumptions made about the small parameter \(\epsilon\). There are unresolved questions regarding the applicability of power series expansions and pattern matching techniques.

JohnSimpson
Messages
89
Reaction score
0
"Small" quantities in mathematica

Hi, I'm doing a calculation in which I have a small parameter \epsilon floating around, and I want to automatically remove terms of order \epsilon^2 and higher. Is this possible to do?
 
Physics news on Phys.org


Sure! Just use:

Series[Expression,{epsilon,0,1}]. this will expand Expression in a power series about epsilon=0, and only keep terms up to order 1. If you use Normal[Series[Expression,{epsilon,0,1}]], that will get rid of the annoying O(epsilon^2) terms floating around.
 


Thanks! One more question. Let's say I had something like

<br /> \left(<br /> \begin{array}{cc}<br /> -2 \varepsilon &amp; 1-\varepsilon \\<br /> -1+\varepsilon &amp; -1+2 \varepsilon <br /> \end{array}<br /> \right)<br />

How could I retain the multiplicative terms but ditch the additive terms, so that this simplifies to

<br /> \left(<br /> \begin{array}{cc}<br /> -2 \varepsilon &amp; 1 \\<br /> -1 &amp; -1<br /> \end{array}<br /> \right)<br />
 


What you're asking doesn't make sense to me. In the upper left you kept the multiplicative term (2 epsilon) and not the additive term (0), while in the upper right you kept the additive term (1) and not the multiplicative term (- epsilon). What do you want to do exactly? If you can specify precisely what you want to do, we can program the computer to do it.
 


Right, sorry. What I want to do is say that epsilon is small compared to some other number, in this case 1, but to keep epsilon finite.

<br /> 0 &lt; \varepsilon &lt;&lt; 1<br />

Therefore, -1 + 2epsilon is ROUGHLY -1. So the first matrix above simplifies under this approximation to the second one.

EDIT: Hmmm, actually, I don't think the power series expansion is quite what I'm looking for. I'd like to have

<br /> f(x) = \sqrt{x^2 + \varepsilon + \varepsilon^2} \simeq \sqrt{x^2 + \varepsilon}<br />

since terms of eps^2 are very small compared to terms of power eps, but x is comparable to epsilon for small enough x. Unless I'm very confused a power series expansion in epsilon will not give me this. Any thoughts would be appreciated.
 
Last edited:


Perhaps you can adapt something like this

In[1]:= {{-2ξ,1-ξ},{-1+ξ,-1+2ξ}}/.{x_+_*ξ->x,x_+ξ->x}

Out[1]= {{-2 ξ,1},{-1,-1}}

Or perhaps

In[2]:= Sqrt[x + ξ + ξ^2] /. ξ^2 -> 0

Out[2]= Sqrt[x + ξ]

Limit[expression,ξ->0] won't do what you want and I can't think of a single simple pattern substitution that will do all and only the things you want in all the kinds of expressions that someone could come up with.

With any pattern matching in particular and any Mathematica result in general you should carefully check the results to make sure there are no errors
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K