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.

Interpolation & Excel

Abdulrahman Al Rumaidh

Please login with a confirmed email address before reporting spam

Hello everyone,

I'm trying to define a material property that is a function of two physical quantities. I'm doing that using an interpolation function with the data imported from an Excel spreadsheet. I searched for the way of tabulating spatial data but I couldn't find what I was looking for.

I attached something similar to my data. The first row represents temperature, the first column pressure, and the rest is specific volume. I tried this format but when I imported them in COMSOL and plotted it, it didnt show me all my points.

Can someone help me with this?


4 Replies Last Post 26.12.2015, 04:49 GMT-5
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 23.12.2015, 16:53 GMT-5
Hi,
I am not using the Excel Live Link. I use the grid file format for such a 2D interpolation function. Call the help from the interpolation function node. Below is a copy from the help text explaining the format.

Cheers
Edgar

-----Citation below

Grid File

A grid file

%Grid

x grid points separated by spaces

y grid points separated by spaces (optional)

z grid points separated by spaces (optional)

%Data

Data values separated by spaces

Each row contains values for different x grid points for fixed values of  y and z. The rows first increase the  y grid value and then the z grid value. The grid points can also represent another independent variable that the data values depend on. For example, the “grid points” can be temperature values and the data values the thermal conductivity at these temperatures.

----Citation above


--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi, I am not using the Excel Live Link. I use the grid file format for such a 2D interpolation function. Call the help from the interpolation function node. Below is a copy from the help text explaining the format. Cheers Edgar -----Citation below Grid File A grid file %Grid x grid points separated by spaces y grid points separated by spaces (optional) z grid points separated by spaces (optional) %Data Data values separated by spaces Each row contains values for different x grid points for fixed values of  y and z. The rows first increase the  y grid value and then the z grid value. The grid points can also represent another independent variable that the data values depend on. For example, the “grid points” can be temperature values and the data values the thermal conductivity at these temperatures. ----Citation above -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Abdulrahman Al Rumaidh

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 25.12.2015, 03:19 GMT-5
Thanks for your reply. I went through this page in the Help before posting my question but I didn't understand the format for spatial data. If you can give me an example of such data in Excel I will appreciate it very much.
Thanks for your reply. I went through this page in the Help before posting my question but I didn't understand the format for spatial data. If you can give me an example of such data in Excel I will appreciate it very much.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 25.12.2015, 05:17 GMT-5
Your example would look like this:

%Grid
50 100 150 200
1 10 20 30
%Data
0.123 0.124 0.125 0.126
0.234 0.235 0.236 0.237
0.345 0.346 0.347 0.348
0.456 0.457 0.458 0.459

Put it into a text file and import it into an interpolation function.

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Your example would look like this: %Grid 50 100 150 200 1 10 20 30 %Data 0.123 0.124 0.125 0.126 0.234 0.235 0.236 0.237 0.345 0.346 0.347 0.348 0.456 0.457 0.458 0.459 Put it into a text file and import it into an interpolation function. -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Abdulrahman Al Rumaidh

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 26.12.2015, 04:49 GMT-5
Thank very much for your help. It worked nicely :)

Best Ragards
--
Abdulrahman Al Rumaidh
Mechanical Engineering Student | University of Bahrain
Thank very much for your help. It worked nicely :) Best Ragards -- Abdulrahman Al Rumaidh Mechanical Engineering Student | University of Bahrain

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.