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.

How are solutions stored in COMSOL

Please login with a confirmed email address before reporting spam

I have recently been solving an eigenvalue PDE in COMSOL, which spits out a number of eigensolutions depending on how many you asked for. I can plot these as I wish, but I would like to also be able to access them and manipulate them algebraically. This therefore leads to the question:
How are solutions stored in COMSOL? Can I call them somehow and let them enter in expressions?

1 Reply Last Post 13.06.2016, 10:06 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 13.06.2016, 10:06 GMT-4
Perhaps what you are looking for is the with(,) operator? See Reference Manual, version 5.2, page 243:

WITH
• The with operator can access specific solutions during results evaluation.
• For time-dependent problems, parametric problems, and eigenvalue problems, this makes it possible to use the solution at any of the time steps, any parameter value, or any eigensolution in an expression used for plotting or data evaluation.
• Use the solution number as the first input argument. The second input argument is the expression that you want to evaluate using this solution. For example, with(3,u^2) provides the square of the third eigensolution for an eigenvalue problem.
• For example, you can use the with operator to verify that two eigensolutions are orthogonal.
• If you want to use the with operator for a parametric problem, you should use a Parametric solver instead of a Parametric Sweep.
• The with operator can only be used during results evaluation, so you cannot use it when setting up the model.
See also withsol for a more general operator.

Best,
Jeff
Perhaps what you are looking for is the with(,) operator? See Reference Manual, version 5.2, page 243: WITH • The with operator can access specific solutions during results evaluation. • For time-dependent problems, parametric problems, and eigenvalue problems, this makes it possible to use the solution at any of the time steps, any parameter value, or any eigensolution in an expression used for plotting or data evaluation. • Use the solution number as the first input argument. The second input argument is the expression that you want to evaluate using this solution. For example, with(3,u^2) provides the square of the third eigensolution for an eigenvalue problem. • For example, you can use the with operator to verify that two eigensolutions are orthogonal. • If you want to use the with operator for a parametric problem, you should use a Parametric solver instead of a Parametric Sweep. • The with operator can only be used during results evaluation, so you cannot use it when setting up the model. See also withsol for a more general operator. Best, Jeff

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.