Correct Dimensions to avoid numerical errors

In Summary, the author is trying to simulate a pendulum system and he is trying to set the dimensions of the simulation accordingly to minimize the error.
  • #1
road_king
18
0

Homework Statement



Hi, I have to do a simulation of two non linear dynamical equations which represent a electromechanical system. (An inverted pendulum attached to a cart moving over a rail). I am going to simulate the response via numerical methods programmed in LV. (I am trying firts with a variable step size RK.).
I have 4 state variables [x,x_dot,theta,theta_dot] and Vm which is a voltage.

Homework Equations



My question is that to avoid the propagation of numerical error during the simulation one have to properly set the dimensions according to the range of variation of the variables in order to set each variable range of variation to be [-1,+1].

If you put the x in meters, you have a range of variation of [-0.5,+0.5] or [0,1] because the rail is 1 meter long. (Also you may set that in cm or in mm, but this may led you to get more error during the iterative process of the simulation).

Also he pendulum may rotate over the pivot for the full angle of rotation. If you set the angle (theta) in rads the range is [0,2*pi] but if you set this in degrees you then have [0,360]. The Voltage Vm could vary from 0 to 16 volts.

The Attempt at a Solution



I am going to try first with X in meters and Theta in radians, Vm in volts.
 
Physics news on Phys.org
  • #2
It's not clear what you are asking.

Solving differential equations works with the magnitudes of the measurements, not the units themselves. If you want your solution routines to work with multiple unit systems, you have to ask the user his unit preference and then adjust the step sizes in your program according to those choices.
 
  • #3
Sorry if I might not be as clear as I should be.

I have this program in which I have to set the proper units of the dimensions of the problem in order to minimize the error that the simulation is going to produce. I read a paper in which it states that if the variables only vary from -1 to +1 that error is minimized. So I was asking what would you do, to establish the linear displacement in meters or mm or cm, and the angle better in radians or degrees? So it is clear that the magnitudes operated by the solver are going to be different if they are established in different units.

Hope this helps.
 
  • #4
It sounds like what you have is a scaling problem. I'm not familiar with the problem you are trying to solve, but given your four state variables, you have to find a scaling factor which keeps all of the values for these variables in the range of -1 to +1. This may or may not be possible.
 
  • #5
road_king said:
I read a paper in which it states that if the variables only vary from -1 to +1 that error is minimized.

Statements like that are often made, but rarely actually proved to be correct by those who make them.

In some applications of numerical methods it seems to be "fashionable" to use scaled non-dimensional variables for everything. In other applications, nobody bothers to do it.

Considering any cheap PC will do floating-point arithmetic to about 16 decimal places, on values with magnitudes between about ##\pm 10^{\pm 300}##, it might be worth stopping to think why that isn't "accurate enough" for what you want to do, before you start scaling anything.

If you are simulating what happens in the time domain, I would expect the most important things affecting the errors will be (1) the numerical method you use to integrate the differential equations, and (2) the time step size of the simulation. (The two things are inter-related, of course).
 
  • #6
Thanks guys,

LabVIEW has a lot of integration routines, I was thinking of trying a variable step size Runge-Kutta.
 

FAQ: Correct Dimensions to avoid numerical errors

1. What are numerical errors and why should they be avoided?

Numerical errors are inaccuracies that occur during calculations due to limitations in the precision of numbers. They should be avoided because they can significantly affect the accuracy of scientific results and lead to incorrect conclusions.

2. How do incorrect dimensions contribute to numerical errors?

Incorrect dimensions can cause numerical errors by introducing unit conversions or mathematical operations that are not compatible, resulting in incorrect calculations and final values.

3. What are the correct dimensions to use in scientific calculations?

The correct dimensions to use in scientific calculations are the fundamental units of measurement for the specific quantity being calculated. These units should be consistent throughout all calculations and conversions to avoid numerical errors.

4. How can dimensional analysis help in avoiding numerical errors?

Dimensional analysis is a method that uses the fundamental dimensions of a quantity to check the validity of equations and to ensure that the correct dimensions are used in calculations. It can help identify and correct any errors in units that may lead to numerical errors.

5. Are there any tools or techniques to help ensure correct dimensions in scientific calculations?

Yes, there are tools and techniques such as unit conversion tables, dimensional analysis, and software programs that can help ensure correct dimensions are used in scientific calculations. It is also important to double-check all unit conversions and calculations to avoid any potential errors.

Back
Top