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.

equation from results of simulation

Please login with a confirmed email address before reporting spam

Hello everybody,
I'm using a model (with solid mechanics) and I would implement this calculation:
1) Obtain the principal stresses solid.sp1,sp2 and sp3
2) Through Results>Derived values>Surface integration I would use the principal stresses obtained in an integral
3) I would use the result of this integral in a formula; My problem is exactly here! How can I assign a variable to the result of this integral (in the way to use it in a formula)? And how can I implement a formula?
for instance, if the result of the integral is integ, Pf=1-exp(-integ); I tried to use this formula in "Surface integration", but I have obtained a wrong result (>1)...it should be inclusive 0-1.

Thanks

Kind regards

Fabio

6 Replies Last Post 24 gen 2012, 13:11 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 gen 2012, 12:27 GMT-5
Hi

read the doc about Model coupling operators (Define Model Couplings integration) then define a variable "Definition - variables" calling this integration operator.

Solve or update your solution

post process in a plot or in a derived variables node

You might be able to define the full equation of your variable in a Global derived Variable node, but to refer to the integration you are better off defining them as operator first, then solve (to update the model data set) then display the results. The derived variables makes tables that you can plot out with a simple icon click

--
Good luck
Ivar
Hi read the doc about Model coupling operators (Define Model Couplings integration) then define a variable "Definition - variables" calling this integration operator. Solve or update your solution post process in a plot or in a derived variables node You might be able to define the full equation of your variable in a Global derived Variable node, but to refer to the integration you are better off defining them as operator first, then solve (to update the model data set) then display the results. The derived variables makes tables that you can plot out with a simple icon click -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 gen 2012, 13:05 GMT-5
post process in a plot or in a derived variables node

You might be able to define the full equation of your variable in a Global derived Variable node, but to refer to the integration you are better off defining them as operator first, then solve (to update the model data set) then display the results. The derived variables makes tables that you can plot out with a simple icon click

Hi Ivar,
thanks for your reply; but I don't know what to do in the section "Results": practically, in the "surface integration" I wrote my equation:
1-exp(-1/((sigma0^m)*Veff)*((solid.sp1*(solid.sp1>0))^m+(solid.sp2*(solid.sp2>0))^m+(solid.sp3*(solid.sp3>0))^m)*Th_AsA)
But obviously, it solves an integral for this entire equation, and it's wrong, the surface integral is only:
((solid.sp1*(solid.sp1>0))^m+(solid.sp2*(solid.sp2>0))^m+(solid.sp3*(solid.sp3>0))^m)
Now, I tried to solve this integral with Results>Derived values>surf. integration and I was well about this; the problem is after:

1) How can I implement the remaining equation:
1-exp(-1/((sigma0^m)*Veff)*RES_INT*Th_AsA)

2) For the point 1), How can I call the results of "surface integration" as a variable (for instance RES_INT)?

Thank you again in advance, sorry for inexperience, it's one of my first approaches with Comsol!

Fabio
post process in a plot or in a derived variables node You might be able to define the full equation of your variable in a Global derived Variable node, but to refer to the integration you are better off defining them as operator first, then solve (to update the model data set) then display the results. The derived variables makes tables that you can plot out with a simple icon click Hi Ivar, thanks for your reply; but I don't know what to do in the section "Results": practically, in the "surface integration" I wrote my equation: 1-exp(-1/((sigma0^m)*Veff)*((solid.sp1*(solid.sp1>0))^m+(solid.sp2*(solid.sp2>0))^m+(solid.sp3*(solid.sp3>0))^m)*Th_AsA) But obviously, it solves an integral for this entire equation, and it's wrong, the surface integral is only: ((solid.sp1*(solid.sp1>0))^m+(solid.sp2*(solid.sp2>0))^m+(solid.sp3*(solid.sp3>0))^m) Now, I tried to solve this integral with Results>Derived values>surf. integration and I was well about this; the problem is after: 1) How can I implement the remaining equation: 1-exp(-1/((sigma0^m)*Veff)*RES_INT*Th_AsA) 2) For the point 1), How can I call the results of "surface integration" as a variable (for instance RES_INT)? Thank you again in advance, sorry for inexperience, it's one of my first approaches with Comsol! Fabio

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 gen 2012, 01:42 GMT-5
Hi

indeed if you have a complex equation that requires the integral of a value over a surface and its combined with other variables, or other integrations, you need to do it in steps:
1) define your integrals in the definition node and have them prepared by solving or updating your solution (the solver node is lower in the three than the Definition node so changing anything "above" requires updates below)
2) define a variable that refers to your integration (as this is also "above" the solver node finish this part before your resolve or update)
3) use the Derived variables global evaluation and refer to the variables or to a combination of variables (COMSOL's internal ones as well as yours) and / or to the intop1() operators fully defined with the required expressions for the integrands. Then plot the resulting table

Note often you do not really need the Definition Variables, but such variables might also be referred to in all the other line surface or volume plots, but not the derived variables tables items

An important thing is to distinguish the variables (yours and COMSOL's) that are global and those who are implicit field variables with an implicit dependence on the spatial coordinates (x,y,z or r) and/or time "t"

--
Good luck
Ivar
Hi indeed if you have a complex equation that requires the integral of a value over a surface and its combined with other variables, or other integrations, you need to do it in steps: 1) define your integrals in the definition node and have them prepared by solving or updating your solution (the solver node is lower in the three than the Definition node so changing anything "above" requires updates below) 2) define a variable that refers to your integration (as this is also "above" the solver node finish this part before your resolve or update) 3) use the Derived variables global evaluation and refer to the variables or to a combination of variables (COMSOL's internal ones as well as yours) and / or to the intop1() operators fully defined with the required expressions for the integrands. Then plot the resulting table Note often you do not really need the Definition Variables, but such variables might also be referred to in all the other line surface or volume plots, but not the derived variables tables items An important thing is to distinguish the variables (yours and COMSOL's) that are global and those who are implicit field variables with an implicit dependence on the spatial coordinates (x,y,z or r) and/or time "t" -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 gen 2012, 07:49 GMT-5
Hi Ivar,
thank you so much for your help! Now it works! But now I should improve my model, and so to use a Time dependent study instead of a Stationary, and I would evaluate this equation for each time (at 0 s, 10 s, 20 s etc); I have seen that the evaluation of a Derived Values is "manually" (practically, I have to click the = icon to see the result); this is properly for a stationary study (only one solution after the study), but for a Time dependent, in that I have a new solution after each step, how can I make it?

Thank you again

Fabio
Hi Ivar, thank you so much for your help! Now it works! But now I should improve my model, and so to use a Time dependent study instead of a Stationary, and I would evaluate this equation for each time (at 0 s, 10 s, 20 s etc); I have seen that the evaluation of a Derived Values is "manually" (practically, I have to click the = icon to see the result); this is properly for a stationary study (only one solution after the study), but for a Time dependent, in that I have a new solution after each step, how can I make it? Thank you again Fabio

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 gen 2012, 17:05 GMT-5
Hi

try it out, the derived variable nodes make lists for each time steps, these are the easy paces to make simple post processing. but you can also "define variables" (before you solve, or at least try a solver update F5) and refer to these in the plots. Most variables arein fact field variables depending on x,y,z and "t" when you have a time solver

--
Good luck
Ivar
Hi try it out, the derived variable nodes make lists for each time steps, these are the easy paces to make simple post processing. but you can also "define variables" (before you solve, or at least try a solver update F5) and refer to these in the plots. Most variables arein fact field variables depending on x,y,z and "t" when you have a time solver -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 24 gen 2012, 13:11 GMT-5
Yes, I have tried and works.
Thank you so much Ivar.

Regards

Fabio
Yes, I have tried and works. Thank you so much Ivar. Regards Fabio

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.