Change variables and expand around new variable (Mathematica)

Click For Summary

Discussion Overview

The discussion revolves around the challenges of changing variables and expanding a differential expression in Mathematica, specifically for calculating weak-field limits in general relativity. Participants explore the technical aspects of variable substitution and expansion around infinity.

Discussion Character

  • Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • One participant describes a differential expression involving functions B(r) and n(r) and expresses difficulty in changing variables to x=1/r and expanding around x=0 in Mathematica.
  • Another participant suggests creating a simplified example to isolate the error, indicating that this might help clarify the issue.
  • A third participant notes that the problem may relate to Mathematica's handling of variable changes and chain rule applications, mentioning that Maple can perform this task with its dchange function.
  • One participant recommends seeking assistance in a different forum section dedicated to computing and technology.

Areas of Agreement / Disagreement

Participants do not reach a consensus on how to resolve the issue with Mathematica, and multiple approaches and tools are discussed without agreement on a definitive solution.

Contextual Notes

Limitations include potential misunderstandings of Mathematica's variable handling and the specific requirements for expanding expressions. The discussion does not resolve the mathematical steps necessary for the variable change.

ramparts
Messages
44
Reaction score
0
I have a differential expression that I want to expand to some order around infinity (it's for calculating weak-field limits in GR). I have two functions, B(r) and n(r), and some expression involving them along the lines of

n[r] (3 r B'[r]^2 - 4 B[r] (2 B'[r] + r B''[r]))

Basically I want to change variables to x=1/r and expand this expression around x=0 to, say, 5th order. This seems like it would be fairly simple, but I must be doing something wrong because Mathematica keeps giving me errors like

General::ivar: "1/r is not a valid variable."

I've tried several ways of doing this, but I'm still learning Mathematica so I'd appreciate having the right way pointed out! Thanks.

(I've also tried expanding around {r,Infinity,5} and just gotten a symbolic result which wasn't useful.)
 
Physics news on Phys.org
I don't have Mathematica, but I suggest that you create a simplified example of this situation and see if error happens. If it does, you can post the example. If it doesn't, it might lead to some other aspect of the problem that you failed to capture in the example.
 
I think the problem boils down to this: given a differential expression (like the one I posted) I don't know how, in Mathematica, to change variables and have Mathematica do all the chain rule through. I've since learned that Maple can do this (and indeed I've been using Maple for what I need to do) with its dchange function in the PDETools. I wonder how one can get the same functionality within Mathematica.
 
I can't help with that. I suggest you ask in the forum section Physics Forums > Other Sciences > Computing & Technology. > Math & Science Software
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K