Creating Interpolation Curve using Expression

Please login with a confirmed email address before reporting spam

Hi,

I want to create a 3D Interpolation Curve using an expression. For instance, let's use this simple example:

y=2*x

resulting coordinates would be:

x-y-z- 0;0;0 1;2;0 2;4;0 ...

I am trying to enter the expression "2x" in the "y" column (see image) but that returns a "x variable unknown" error. I obviously don't have the right approach.

Any suggestion?

Thanks, PL



3 Replies Last Post Jul 2, 2024, 3:00 a.m. EDT
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 months ago Mar 19, 2024, 9:33 a.m. EDT

With that expression you can set up an analytical function.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
With that expression you can set up an analytical function.

Please login with a confirmed email address before reporting spam

Posted: 4 months ago Jul 1, 2024, 1:41 p.m. EDT

The doc on anlytic functions as well as interpolated curves is a bit thin. After making your analytic function, in Component-Definitions-Functions making sure to set the units appropriately, you could then call the function either by manually typing in an1(0), an1(1)... But I would guess that you want a smooth function. To achieve this, change the data source to vectors, and set a range for x, and then set (probably) the same range for y but this time choose the function at the bottom of the window. Hope the the screen captures help.

The doc on anlytic functions as well as interpolated curves is a bit thin. After making your analytic function, in Component-Definitions-Functions making sure to set the units appropriately, you could then call the function either by manually typing in an1(0), an1(1)... But I would guess that you want a smooth function. To achieve this, change the data source to vectors, and set a range for x, and then set (probably) the same range for y but this time choose the function at the bottom of the window. Hope the the screen captures help.


Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 months ago Jul 2, 2024, 3:00 a.m. EDT

Hi all,

Using a Parametric Curve instead of an Interpolation Curve might be a better approach in this case.

Best regards,

Magnus

Hi all, Using a Parametric Curve instead of an Interpolation Curve might be a better approach in this case. Best regards, Magnus

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.