Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I would like to calculate a system of two differential equations in Mathematica using DSolve, like:

fx''[x] + a*fx[x] == -I*eta*fy''[x] - b*fy[x], ...

where fx[x] and fy[x] are unknown functions. Using DSolve I can easily find some solutions of the type fx[x] = C[1]*cosh[x/L] + C[2]*a*sinh[x/L], where L is a term of the dimension of x.

The problem is, that the parameters a and b in my equations have physical dimension (e.g. meter). From the analysis of the solution the two terms in the result have different physical dimension, which is nonsensical. Another option is that Mathematica rescaled C[1] so that finally it has dimension of a*C[2].

My question is: Can I somehow control the physical dimensions of the parameters (a,b) in the differential equations or the constants C[1], C[2] in the result?

share|improve this question

migrated from Feb 20 '12 at 17:05

This question came from our site for professional and enthusiast programmers.

You input appears to have the same issue. If x and a have dimensions of length then f''[x] has dimensions of length^2*f[x] whereas af[x] is only lengthf[x]. –  Daniel Lichtblau Feb 20 '12 at 23:32
@DanielLichtblau: If x has the dimension of length, f''[x] of course has the dimension (dimension of f[x])/length^2. For the equations to be dimensionally correct, a must have the dimension 1/length^2, and b must have the dimension dim(eta)/length^2. –  celtschk Feb 21 '12 at 9:32

1 Answer 1

It is generally better to work in dimensionless units to start with. In your case, your a and b have units of $L^{-2}$, while eta is dimensionless. Taking fx''[x] + a*fx[x] == -I*eta*fy''[x] - b*fy[x] as an example, you could use $\xi=x/L$, $\alpha=a L^2$, $\beta=b L^2$ (all of which are now dimensionless), whereupon your differential equation becomes $L^{-2}\left(\partial_{\xi,\xi}F_x(\xi)+\alpha F_x(\xi)+i\eta \partial_{\xi,\xi}F_y(\xi)+\beta F_y(\xi)\right)=0$, where I have set $F_x(\xi)=f_x(x)$ and similarly for $y$. Solving the equation in the brackets is what you really should do; no problems like you mention above can now arise.

To summarise, one should almost always switch to dimensionless units before numerically solving a problem.

share|improve this answer
Your advise remind me an almost forgotten juvenile favorite –  belisarius is forth Mar 8 '12 at 1:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.