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 anexpression. 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 2024年7月2日 GMT+2 09:00
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 months ago 2024年3月19日 GMT+1 14:33

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: 2 months ago 2024年7月1日 GMT+2 19:41

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: 2 months ago 2024年7月2日 GMT+2 09:00

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 thediscussion forum rulesbefore posting.

Pleaselog into 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 theSupport Centerfor a more comprehensive response from the Technical Support team.

Baidu
map