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.

numerical derivatives

Please login with a confirmed email address before reporting spam

Dear pros,
this should be simple, yet I have not succeeded in implementing this in COMSOL and could not find any relevant instructions anywhere.

I use COMSOL to process experimentally obtained and thus known velocity fields.

I refer to a Matlab function via livelink which COMSOL then uses to assign a variable named u (in the Component Definitions) its values. This works fine, I can trace the variable u and get the proper field.

The PDEs I further need to solve however don't just use u, but also its derivatives as known terms. I don't want to calculate those derivatives in Matlab but use COMSOL which should be capable of deriving a known field on its own mesh. So ... what I need is a module that will just calculate the space derivatives of a known field numerically, but I was not able to find any such module in the physics section.

The Coefficient PDE physics interface seemed promising at first, but it's actually just the wrong way around, because it will calculate u, though my unknown is f:
\beta \nabla u = f

Thank you very much in advance.

1 Reply Last Post May 29, 2015, 2:14 a.m. EDT
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago May 29, 2015, 2:14 a.m. EDT
If you import the known field into an interpolation function, then you can evaluate its derivatives numerically. Suppose that you set the interpolation function's name to F and that it takes two arguments x and y. Then d(F(x, y), x) is the partial derivative with respect to x.
If you import the known field into an interpolation function, then you can evaluate its derivatives numerically. Suppose that you set the interpolation function's name to F and that it takes two arguments x and y. Then d(F(x, y), x) is the partial derivative with respect to x.

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.