Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Derivative with respect to parametric sweep Variable

Please login with a confirmed email address before reporting spam

Hello,

I am having troubles to get a derivative of a Variable which does not directly depend on a sweep parameter.
For Example:

Variable:
A1=intop1(rmm.Az)/Surface

Now I define a sweep parameter called "stage" to have a parametrized Geometry and in every Solution A1 differs. So a plot of "A1" with respect to "stage" is not constant.

What i now want to do is to get the derivative of "A1" with respect to "stage". If I define it as

d(A1, stage)

the result is zero.

Is there a way i can define that derivative?


Thanks in advance



2 Replies Last Post 5 dic 2014, 03:49 GMT-5
Ralf Müller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 nov 2012, 06:12 GMT-5
Hello Mr. Hartmann,

You are right. There is no relationship between these values. You have to create a function including both of them, which is the interpolation function. You can get this function in Comsol with the following procedure.

If you plotted A1 as a function of your parameter stage, you can export the data set by using the Export button in the Results window and create a text file.

In order to get the interpolation function right-click Global Definitions>Functions>Interpolation. In the settings window choose File as Data source and browse for the file. You see the function if you press the plot button.

To have this function available in the post-processing update you solution by right-click study>Update Solution. After that you are able to plot d(A1,stage).

I hope this information helps you.

Best regards,

Ralf Müller
Hello Mr. Hartmann, You are right. There is no relationship between these values. You have to create a function including both of them, which is the interpolation function. You can get this function in Comsol with the following procedure. If you plotted A1 as a function of your parameter stage, you can export the data set by using the Export button in the Results window and create a text file. In order to get the interpolation function right-click Global Definitions>Functions>Interpolation. In the settings window choose File as Data source and browse for the file. You see the function if you press the plot button. To have this function available in the post-processing update you solution by right-click study>Update Solution. After that you are able to plot d(A1,stage). I hope this information helps you. Best regards, Ralf Müller

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 5 dic 2014, 03:49 GMT-5
Hello Mr. Müller

Are there any improvements for this problem in Comsol 4.4 or 5 regarding to automatisation?

Or is there a possibility to iterate trougth the parameter vector and compute the differential quotient?
Maybe like:

derivative(1,1) = (A1(1,2)-A1(1,1)) / (stage(1,2)-stage(1,1))
derivative(1,2) = (A1(1,3)-A1(1,2)) / (stage(1,3)-stage(1,2))
derivative(1,3) = (A1(1,4)-A1(1,3)) / (stage(1,4)-stage(1,3))
.
.
.
.

and then plot variable "derivative" with respect to "stage"!

Thans for your help

Best regards

Zeljko Tanasic
Hello Mr. Müller Are there any improvements for this problem in Comsol 4.4 or 5 regarding to automatisation? Or is there a possibility to iterate trougth the parameter vector and compute the differential quotient? Maybe like: derivative(1,1) = (A1(1,2)-A1(1,1)) / (stage(1,2)-stage(1,1)) derivative(1,2) = (A1(1,3)-A1(1,2)) / (stage(1,3)-stage(1,2)) derivative(1,3) = (A1(1,4)-A1(1,3)) / (stage(1,4)-stage(1,3)) . . . . and then plot variable "derivative" with respect to "stage"! Thans for your help Best regards Zeljko Tanasic

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.