Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plots for magnitude are not smooth #985

Open
raphaeltimbo opened this issue May 26, 2023 · 11 comments · May be fixed by #988
Open

Plots for magnitude are not smooth #985

raphaeltimbo opened this issue May 26, 2023 · 11 comments · May be fixed by #988
Assignees
Labels
enhancement New feature or request stale Issues with no activity for a long period

Comments

@raphaeltimbo
Copy link
Collaborator

As we can see in the figure:

image

Magnitude plots for forced response analysis are not smooth.
Maybe we could use some interpolation process to make it look better.

@raphaeltimbo raphaeltimbo added the enhancement New feature or request label May 26, 2023
@marcusfilipesr
Copy link
Collaborator

marcusfilipesr commented Jun 7, 2023

Hello, @raphaeltimbo!!

I was thinking in a way to solve this issue, and I found that the Plotly do have an interpolation between the points, using the line_shape="spline" argument.

I'm adding this to a PR and, would like to ask if you can test it with this plot that you generated.

@marcusfilipesr marcusfilipesr linked a pull request Jun 7, 2023 that will close this issue
@raphaeltimbo
Copy link
Collaborator Author

Hello @marcusfilipesr !
I link the option of using line_shape="spline", but discussing with some colleagues, we were also thinking about modifying the way that we generate the data for the plot.
These colleagues suggested to implement some algorithm that would check where we have the natural frequencies, and in that region we would also have more 'samples' to calculate the amplitude, since a small number of samples in that region can mislead us in which is the maximum value that we can achieve (e.g. if one speed sample is exactly at the peak we get the maximum value).

@marcusfilipesr
Copy link
Collaborator

Hi @raphaeltimbo!

Sorry for the delayed answer! I'll start idealizing an algorithm according to your suggestion.

@ross-bott
Copy link
Collaborator

Hi there!
I have marked this issue as stale because it has not had activity for 45 days.
Consider the following options:

  • If the issue refers to a large task, break it in smaller issues that can be solved in
    less than 45 days;
  • Label the issue as wontfix or wontfix for now and close it.

@ross-bott ross-bott added the stale Issues with no activity for a long period label Sep 16, 2023
@marcusfilipesr
Copy link
Collaborator

@raphaeltimbo to create this new samples, with the code as is, it would be necessary to add more elements to the rotor, correct?

I think a possible solution would be a "copy rotor" inside the one you're running the frequency response analysis, where you could add more elements as you please.

Am I getting it right? Or I'm missunderstanding it?

@raphaeltimbo
Copy link
Collaborator Author

Hi @marcusfilipesr!
For the 'samples' I was actually referring to the frequency array used in frequency/forced response.
For example, in the plot here in this issue we have an analysis from 0 to 15000 RPM. This analysis is carried out with the user providing an array of frequencies that will be equally spaced between each frequency value (a np.linspace for example).

My idea is to get this array and in the region around the natural frequency (5k to 7k in our example) have more frequencies being evaluated.

If the array had a space of 5 RPM between each value, in this region we could have 1 RPM, or some value that could even change as we get closer to the peak.

@marcusfilipesr
Copy link
Collaborator

Hi @marcusfilipesr! For the 'samples' I was actually referring to the frequency array used in frequency/forced response. For example, in the plot here in this issue we have an analysis from 0 to 15000 RPM. This analysis is carried out with the user providing an array of frequencies that will be equally spaced between each frequency value (a np.linspace for example).

My idea is to get this array and in the region around the natural frequency (5k to 7k in our example) have more frequencies being evaluated.

If the array had a space of 5 RPM between each value, in this region we could have 1 RPM, or some value that could even change as we get closer to the peak.

Got it! Sorry for the lack of understanding. I'll do that.

@raphaeltimbo raphaeltimbo removed the stale Issues with no activity for a long period label Mar 22, 2024
@raphaeltimbo
Copy link
Collaborator Author

We should test the implemented method cluster_points to evaluate if it can solve this issue.
If that is the case, I think we should change the documentation to make it more clear what this option does.

@ross-bott
Copy link
Collaborator

Hi there!
I have marked this issue as stale because it has not had activity for 45 days.
Consider the following options:

  • If the issue refers to a large task, break it in smaller issues that can be solved in
    less than 45 days;
  • Label the issue as wontfix or wontfix for now and close it.

@ross-bott ross-bott added the stale Issues with no activity for a long period label May 8, 2024
@ViniciusTxc3
Copy link
Collaborator

I tested including the "cluster points" method but the effect was not as expected.
image
This was the test code:

rotor = rs.rotor_example()
speed = np.linspace(0, 1000, 101)
response = rotor.run_freq_response(speed_range=speed, cluster_points=True, num_points=5)
fig = response.plot_magnitude(inp=13, out=13, frequency_units="RPM").show()

@raphaeltimbo, I believe we will need to refine this region to improve visualization.

@jguarato
Copy link
Contributor

As we can see in the figure:

image

Magnitude plots for forced response analysis are not smooth. Maybe we could use some interpolation process to make it look better.

@raphaeltimbo,
Do you still have the script to generate this graph so I can investigate this issue further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Issues with no activity for a long period
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants