Solving a second order differential equation numerically, by making it dimensionless

574 Views Asked by At

$$\textbf{I have been given the following:}$$


This is an example solution of a second order ODE, specifically that of a Harmonic Oscillator $$ {\text{d}v\over\text{d}t}=-\omega^2x-kv, $$ where $v=$d$x/$d$t$ and $\omega$ & $k$ are constants.

We can make this dimensionless by putting $x=x_0X$, $v=(x_0/t_0)V$ and $k=K/t_0$ where $\omega t_0=1$. The equation then becomes $$ {\text{d}V\over\text{d}T}=-X-KV. $$

To solve numerically, we need to convert this to a pair of 1st-order equations by using a vector of variables $Z=(X,V)$: $$ \begin{align} {\text{d}X\over\text{d}T} &= V;\\ {\text{d}V\over\text{d}T} &= -X-KV. \end{align} $$

We'll look for solutions with $K=0,0.5,1$, initial conditions $(X_0,V_0)=(1.0,0.3)$, and we'll plot the solution to $T=4\pi$.


$$\textbf{My problem}$$
I understand how to solve the differential equation numerically, once it is in the form of two 1st-order equations. My problem is with making the differential equation dimensionless:

  • Why do we want to make it dimensionless, is there not a way to convert into first order DEs without doing so?
  • I don't entirely understand what the X,V,K terms are. I am assuming that we can say $x$ is some function, X multiplied by the initial condition $x_0$, as in this case the initial condition would be the only part with dimensionality. However I am not convinced with my interpretation, if anyone could provide some insight for this, that'd be great.
  • Finally, upon making it dimensionless, how is it converted into the two First order DEs, it is mainly where $\frac{dX}{dT}$ comes from that is confusing me.

Any help is greatly appreciated, Thanks

1

There are 1 best solutions below

3
On BEST ANSWER

Why do we want to make it dimensionless

You do not have to make it dimensionless. Making it dimensionless tends to make the various terms have similar magnitude, which reduces numerical errors, but is not strictly necessary.

I am assuming that we can say $x$ is some function, $X$ multiplied by the initial condition $x_0$

Yes. Your unknown function $x(t)$ is dimensional, presumably having dimension length, so you define $X=x/x_0$ such that you now have an alternative unknown function $X(t)$ which is dimensionless.

it is mainly where $dX/dT$ comes from that is confusing me.

You yourself wrote $v=dx/dt$. That's where it comes from. Instead of stating that the second derivative of the position equals something, you state that the first derivative of the speed equals something. Additionally, you define the speed as the first derivative of the position. So your second-order differential equation became two first-order differential equations.