I have a numerical optimization problem that I am trying to scale appropriately, in order to allow for the solver to achieve faster and more accurate results. I found a paper here that had a short section on nondimensionalization on page 44, that simply stated the following:
In order to nondimensionalize a quantity, just multiply by the appropriate constant.
The nondimensionalization constants are given by
$$n_{length}=\frac{1}{R_{P}}$$ $$n_{velocity}=\sqrt{\frac{R_{P}}{\mu}}$$ $$n_{mass}=\frac{1}{m_{0}}$$ $$n_{time}=\frac{n_{length}}{n_{velocity}}$$ $$n_{force}=\frac{n_{mass}n_{length}}{n_{time}^{2}}$$
where $R_{P}$ is the planet's radius, $\mu=GM$ is the planet's gravitational parameter and $m_{0}$ is the spacecraft's initial mass. I have very similar equations to those used in the thesis, where the following system of first-order ODEs describes the spacecraft's dynamics:
$$\dot{r_{x}} = v_{x}$$ $$\dot{r_{y}} = v_{y}$$ $$\dot{v_{x}} = -\frac{GMr_{x}}{||\mathbf{r}||^{3}}+\frac{T_{x}}{m}$$ $$\dot{v_{y}} = -\frac{GMr_{y}}{||\mathbf{r}||^{3}}+\frac{T_{y}}{m}$$ $$\dot{m} = -\frac{||\mathbf{T}||}{g_{0}I_{sp}}$$
I'm a little confused how I should go about actually implementing the nondimensionalization in order to discretize the equations in their scaled/nondimensionalized form. From my simple understanding of the topic, my nondimensionalized equations would look as follows:
EDIT: In response to Kirill's answer, would the transformed system of equations instead look as follows?
$$\dot{\tilde{r_{x}}} = \frac{n_{length}}{n_{time}}v_{x}$$ $$\dot{\tilde{r_{y}}} = \frac{n_{length}}{n_{time}}v_{y}$$ $$\dot{\tilde{v}_{x}} = \frac{n_{force}}{n_{mass}}\left(-\frac{GMr_{x}}{||\mathbf{r}||^{3}}+\frac{T_{x}}{m}\right)$$ $$\dot{\tilde{v}_{y}} = \frac{n_{force}}{n_{mass}}\left(-\frac{GMr_{y}}{||\mathbf{r}||^{3}}+\frac{T_{y}}{m}\right)$$ $$\dot{\tilde{m}} = \frac{n_{mass}}{n_{time}}\left(-\frac{||\mathbf{T}||}{g_{0}I_{sp}}\right)$$
EDIT 2: Since I'm not really understanding the answers given (apologies, I'm a bit slow), and can't seem to find any well explained examples online, I thought it may help if I show some of the code from the optimization problem I'm working on. Given the original system of ODEs, they are discretized using $N$ nodes, where the final time is given by $t_{f}$ and the time-step between nodes is given by $dt=t_{f}/N$. Thus, using a trapezoidal integration scheme, the system of ODEs is discretized as follows in MATLAB,
for t = 2:N
y(:,t) = (I-0.5*dt*A(:,:,t))\((I+0.5*dt*A(:,:,t-1))*y(:,t-1)+0.5*dt*B(u(:,t)+u(:,t-1)));
.
.
.
end
where the state vector is given by $y = [r_{x},r_{y},v_{x},v_{y},m]^{T}$ and the control vector is given by $u = [T_{x},T_{y},||\mathbf{T}||]^{T}$, with $A$ given by
A = [0 0 1 0 0;
0 0 0 1 0;
a 0 0 0 0;
0 a 0 0 0;
0 0 0 0 0]
wherea = -(G*M)/(norm(r(:,t)).^3)
, and
B = [0 0 0;
0 0 0;
1/m 0 0;
0 1/m 0;
0 0 -1/(g0*Isp)];
How could the above system be scaled? I thought about simply applying the following diagonal preconditioner to both the left and right-hand sides of the discretized equations
M_scale = [
n_length/n_time 0 0 0 0;
0 n_length/n_time 0 0 0;
0 0 n_force/n_mass 0 0;
0 0 0 n_force/n_mass 0;
0 0 0 0 n_mass/n_time];
where I then have
for t = 2:N
M_scale*y(:,t) = M_scale*(I-0.5*dt*A(:,:,t))\((I+0.5*dt*A(:,:,t-1))*y(:,t-1)+0.5*dt*B(u(:,t)+u(:,t-1)));
.
.
.
end
but unfortunately this doesn't seem to work.