Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Using a color scheme to indicate phase (direction) of surface displacement (revisited)

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


So, I'm still really frustrated that I cannot find a simple way to use a colormap that shows positive and negative displacements (or the phase) when visualizing structural mode shapes for an eigenfrequency. Here is the result I get for a COMSOL model of a simply supported thin plate. Notice that both the positive (+Z) and negative (-Z) displacements are red and the neutral plane (zero displacement) is blue. http://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_214.png What I really want is something like this (from Mathematica) where the zero displacement is white, positive displacment (up or +Z) is red, and negative displacement (down or -Z) is blue. http://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_212.png Or something like this use of the Twilight color map to indicate positive and negative of the z-component of the electric field: https://cdn.comsol.com/wordpress/2016/07/waveguide_twilight.png (from: https://www.comsol.com/blogs/enhance-your-visualization-plots-with-six-new-color-tables/) How was that Twilight color map used to show positive and negative z-components of the electric field? That is what I want to do, but I can't figure out how to make it work in COMSOL.

I can figure out how to change the range of the data and the color map to include +/- values, but I cannot figure out how to get the +/- values display colors to match that range. http://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_215.png Do I need to use a different quantity to plot (instead of "solid.disp" -- if so, what other quantity should I be plotting?) so that I can get the colormap to show different colors for up/down, in/out, or positive/negative directions for a simple 2-D surface? I don't want to have to resort to vectors. I just want a colored result where the colors indicate relative +/-displacement. The example above from the COMSOL blog about using the Twilight color map shows that it must be possible to do what I want to do . . . I just can't figure out how to do it.


4 Replies Last Post 03.03.2023, 16:57 GMT-5
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 03.03.2023, 02:31 GMT-5

Daniel,

you are plotting the solid displacement magnitude, which is by definition always positive. In order to bring the sign in, you can consider to plot the z-component.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Daniel, you are plotting the solid displacement magnitude, which is by definition always positive. In order to bring the sign in, you can consider to plot the z-component. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 03.03.2023, 09:53 GMT-5

What is the "code" for plotting the z-component? What should I use instead of the default "solid.disp"?

What is the "code" for plotting the z-component? What should I use instead of the default "solid.disp"?

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 03.03.2023, 10:19 GMT-5

Figured it out (thanks for the suggestion that got me searching for the correct variable to plot, Edgar) . . . If I change the default plotting variable from "solid.disp" to "comp1.w" then I can see the +/- displacementin the z-direction like I was hoping to see, with colors indicating the direction of the displacement.

https://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_216.png Great software. But there is a rather steep learning curve for a novice.

Figured it out (thanks for the suggestion that got me searching for the correct variable to plot, Edgar) . . . If I change the default plotting variable from "**solid.disp**" to "**comp1.w**" then I can see the +/- displacementin the z-direction like I was hoping to see, with colors indicating the direction of the displacement. ![https://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_216.png](https://www.acs.psu.edu/drussell/temp/COMSOL/screenshot_216.png) Great software. But there is a rather steep learning curve for a novice.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 03.03.2023, 16:57 GMT-5

Yes, it is not exactly plug and play, but worth the effort.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Yes, it is not exactly plug and play, but worth the effort.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.