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

External functions : passing (variables and) unknown functions

$
0
0
Dear all,

I'm actually using Livelink for MATLAB in order to solve a 2D time-dependant PDE in coefficient form, which is supposed to return a function u(t,x,y)
One of the coefficients might depend on experimental measurement to be read from a table M(x,y).
I decided to implement a simple external function fun1(t,x,y) which is able to call the appropiate element in M for given x and y.
That was no big deal.

I have an issue though, because I now need to be able to call to M(x,y) and u(t,x,y) in this external function. I'm just assuming one of my coefficient my depend on both u and M. Meaning my 2D time dependant PDE might be non-linear (still simple though)

I know it is possible to pass the function u alone by doing so:
model.physics('...').feature('...').set('...', 1, 'some simple expression including u')
But since I need to call to some element of M(x,y), I have no other choice but to create an external function:
model.physics('...').feature('...').set('...', 1, 'fun1')

How can I pass the function u in fun1? Could not find anything in the doc about this...

M

Edit : I could be interested to pass partial derivatives of u as well, if it is possible.

Viewing all articles
Browse latest Browse all 26527

Trending Articles