Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 2194

Interpolation function in matlab

$
0
0
Hi! I am working on a problem, where a boundary condition needs to be described by an interpolation function. Suppose in the system, I need to set the boundary potential 'V0' to be f1(x), where f1(x) is the interpolation function. Suppose x is from a 1D array, like x1(100). I have two questions.

1. According to the manual, I need to input the parameters as following:
model.func(<functag>).setIndex('table', <t_value>, <i>, 1);
model.func(<functag>).setIndex('table', <ft_value>, <i>, 2);

Shall I simply replace <functag> with 'f1'?
What does that mean by '<i> is the index (0-based) in the interpolation table'? Is <i> the length of the parameter table( for x1(100) , <i>=99)?

2. If I have created the interpolation function successfully, when I want to apply it in the boundary condition, shall I describe it as
model.physics('es').feature('pot2').set('V0', 1, 'f1(x)');
or
model.physics('es').feature('pot2').set('V0', 1, 'f1');
or something else?

Thanks!

Viewing all articles
Browse latest Browse all 2194

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>