Solving Data Smoothing Issue

  • Thread starter enigma
  • Start date
  • Tags
    Data
In summary, there is a problem with the pressure coefficients returned from the CFD code due to a minor dent in the surface of the wing. The speaker has tried using a Gaussian filter to smooth out the data but it is not providing a satisfactory solution. They are considering coding a solution that will find the first two points where the tangent to the curve intersects and are open to suggestions for a more elegant solution. A 5th order Butterworth filter has been used with a low cutoff frequency, causing a displacement in the filtered data. Adjusting the cutoff frequency may provide less displacement but also less smoothing.
  • #1
enigma
Staff Emeritus
Science Advisor
Gold Member
1,757
17
Hi all,

I'm having a little difficulty processing my data, and I hope someone here will be able to help me out. (files are a MATLAB .m script and a .mat data file zipped up)

The data I have is the shape of a standard wing and the pressure coefficients along the top and bottom surfaces output from CFD code. Unfortunately, there is a minor dent in the surface where the two equations which generated the shape meet (this remains even after filtering). This inconsistancy will not show up in my experimental setup because it will be under the noise level after I sand the wing.

The problem I'm having is with the pressure coefficients returned from the CFD code. The divot causes the Navier Stokes equations to go whacky on that point and it looks like a 1/x term in the region about 0 is superimposed over the curves (running the code shows what I'm talking about... around c=0.15). I would like to smooth this curve out.

I have coded a method which a colleage called a Gaussian filter (looking online for more information has turned up very little... only things with image processing, so the name might not even be correct), which basically takes the secant between the points ahaid and behind the point to be modified, interpolates the value of the point in question which lies on the secant, and averages it with the original value (hope that makes sense). You then run that through for all points to be filtered, and then run the loop until you get clean enough data.

Unfortunately, this is not giving me a smooth enough slope either, even after 10 runs or more, and the improvement is quickly reaching diminishing returns. The code also illustrates this.

I'm considering coding something which will go out from the "asymptote" and find the first two points where the tangent to the curve intersects both of them, but I have a feeling that this will be computationally intensive as well.

I am wondering if there is a more elegant solution which I'm unaware of to solve this problem.

Thanks in advance for your time.
 

Attachments

  • wingprocess.zip
    12 KB · Views: 201
Mathematics news on Phys.org
  • #2
I used a 5th order Butterworth filter with cutoff frequency equal to 0.15 of your sampling frequency.
The .txt file is your .m file edited to implement the modification. I also changed the colors of the plot. In blue is your wing profile, in green the raw data and in red the filtered data.
There is a displacement in the filtered data, because the cutoff frequency is too low, in order to achive enough smoothing. If this displacement is undesirable, you can have less displacement with less smoothing by augmenting the cutoff frequency.
 

Attachments

  • cp23015aoa0.txt
    1.2 KB · Views: 402
  • #3


Hi there,

Thank you for reaching out for help with your data smoothing issue. It sounds like you have already put a lot of effort into finding a solution, and I can understand how frustrating it can be when it doesn't seem to be working. I'm not an expert in CFD or MATLAB, but I do have some suggestions that may help you out.

Firstly, have you tried using a different type of smoothing filter? There are various types available, such as moving average, Savitzky-Golay, and Butterworth filters, which may be more suitable for your data. It might be worth experimenting with different filters to see if any of them give you the desired smoothness.

Another thing to consider is the size of your filter window. If it's too small, it may not be able to fully smooth out the dent in your data. On the other hand, if it's too large, it may end up smoothing out other important features in your data. Finding the right balance is key, and you may need to adjust the window size based on the specific characteristics of your data.

Additionally, have you tried using a spline interpolation method instead of the secant method you mentioned? Splines are commonly used for data smoothing and may give you better results. You could also try combining spline interpolation with a smoothing filter to see if that helps.

Lastly, I would recommend reaching out to others in the CFD or MATLAB community for help. They may have more experience dealing with similar issues and could offer valuable insights and suggestions. You could also try posting your question on forums or online communities dedicated to CFD or MATLAB to get a wider range of responses.

I hope these suggestions help you find a more elegant solution to your data smoothing problem. Best of luck!
 

1. What is data smoothing and why is it important?

Data smoothing is a technique used in data analysis to remove random variations or "noise" from a dataset in order to reveal underlying patterns or trends. It is important because it helps to improve the accuracy and reliability of data analysis results.

2. What are some common methods for data smoothing?

Some common methods for data smoothing include moving averages, exponential smoothing, and polynomial regression. Each method has its own advantages and is suitable for different types of data and analysis goals.

3. How do I determine the appropriate window size for moving average smoothing?

The appropriate window size for moving average smoothing depends on the frequency of fluctuations in the data. For data with high frequency fluctuations, a smaller window size is recommended, while for data with low frequency fluctuations, a larger window size is more suitable.

4. Can data smoothing be used for all types of data?

No, data smoothing is not suitable for all types of data. It is most commonly used for time series data and continuous data with a clear trend or pattern. It may not be effective for discrete or categorical data.

5. Are there any limitations or drawbacks to using data smoothing?

One limitation of data smoothing is that it can potentially remove important information or outliers from the dataset. It may also introduce bias into the data analysis results. Additionally, the choice of smoothing method and parameters can greatly impact the final results, so it is important to carefully consider and validate the chosen approach.

Similar threads

  • Programming and Computer Science
Replies
1
Views
275
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Replies
76
Views
4K
  • General Math
Replies
11
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
Replies
6
Views
2K
  • DIY Projects
Replies
33
Views
2K
  • Programming and Computer Science
Replies
21
Views
2K
Replies
1
Views
1K
Back
Top