dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to generate a heatmap of a disk having its different temperatures?

  1. #1
    Join Date
    Jun 2018
    Posts
    2

    How to generate a heatmap of a disk having its different temperatures?

    I'm having some problems in generating heatmaps given a defined figure.
    I'm studying the temperature at the point of contact between two surfaces, a disk and a cylinder that could be modelled as one-dimensional, compared to the disk.

    I have 3 sets of data, 1 for the radius(r) of a disk, another one for the angle (Theta) of the contact point and a last one for the temperature of the contacting point where the friction occurs.

    So far I am able to create the disk and the differents points in a simulation obtained via another program, that gives me the previous sets of data.
    Where I have the trouble is when I want to link the temperature obtained to its point and giving it a colour scale based on its temperature. I don't know how to establish this relationship.

    As I say, this is what I have arrived to, which is only the definition of the points given by the results of the simulation.

    Theta = xlsread('Laiton1.xlsx',1,'G2:G3381'); % Parameter turning angle
    r = xlsread('Laiton1.xlsx',1,'C2:C3381'); % Parameter radius
    Tsurf_d = xlsread('Laiton1.xlsx',1,'E2:E3381'); % Temperature on the surface
    x = r*cos(Theta'); % parametrical transformation of (r,Theta) for the X axis
    y = r*sin(Theta'); % parametrical transformation of (r,Theta) for the Y axis
    Theta1 = linspace(0,360,5000); % Angle to define the 2 circumferences of the disk
    x1 = 0.0145*cos(Theta1); % X points for the inner circumerference
    y1 = 0.0145*sin(Theta1); % Y points for the inner circumerference
    x2 = 0.0475*cos(Theta1); % X points for the external circumerference
    y2 = 0.0475*sin(Theta1); % Y points for the external circumerference
    plot(X,Y,X1,Y1,'black',X2,Y2,'black')

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,464

    Re: How to generate a heatmap of a disk having its different temperatures?

    [moved from c++ as matlab]
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.8.7)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)