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.

Integration with variable limits

Please login with a confirmed email address before reporting spam

Hi,

I am trying to solve a problem which requires that I define a function in the form:

V=-Integral of E(x) dx from x=0 until x=x
the function V is used in the coefficients of the equations which I am trying to solve.

I have tried the following approach:
V=-integral((E)*(dest(x)>=0)*(dest(x)<=(x)))
where integral is a model coupling integration operator. But It gives the following error:

"
Failed to find a solution for the initial parameter.
Singular matrix.

There are 62 void equations (empty rows in matrix) for the variable mod1.E.
at coordinates: (8.3326e-009), (9.76543e-009), (1.12679e-008), (1.28434e-008), (1.44956e-008), ...
Returned solution is not converged.
"
Anybody knows how to do it?
I need it very much.

Thanks on advance,

Nelson

6 Replies Last Post 8 set 2012, 18:08 GMT-4
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 28 giu 2012, 07:26 GMT-4
Hi

The special "dest()" operator is used to get the value of a variable at the "destination" part of a mapping operator (extrusion or projection), and integration alone does not perform mapping so that is in my view wrong,

Indeed if you integrate a variable over a domain you define the limits by the domain extend, so you need to multiply your variable by a boolean operator being =0 when your x gets above a given value.

But I'm wondering if you are not talking about a 2 dimensional projection integration combined with a one dimensional integration of the projection value. If you integrate over y in the projection then you can multiply by x<dest(x) to get your limit.
It only becomes a bit more complex if you integration domain is not a plane or skewed in orientation


--
Good luck
Ivar
Hi The special "dest()" operator is used to get the value of a variable at the "destination" part of a mapping operator (extrusion or projection), and integration alone does not perform mapping so that is in my view wrong, Indeed if you integrate a variable over a domain you define the limits by the domain extend, so you need to multiply your variable by a boolean operator being =0 when your x gets above a given value. But I'm wondering if you are not talking about a 2 dimensional projection integration combined with a one dimensional integration of the projection value. If you integrate over y in the projection then you can multiply by x

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28 giu 2012, 08:00 GMT-4
Thank you very much for your quick reply.
Maybe I should state that my problem is 1D. In this case, how can I define it?
Then I should not use the dest operator, as I have understand you correctly.
Thank you very much for your quick reply. Maybe I should state that my problem is 1D. In this case, how can I define it? Then I should not use the dest operator, as I have understand you correctly.

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 28 giu 2012, 08:49 GMT-4
Hi

the way I understand the dest() is that it is used in mapping operators when you define a source and a destination entity, by default you act on the source, but via the dest() you can evaluate variable at the destination coordinate.

But if you are in 1D I do not really get your equation, how would you write it out in standard math ?

--
Good luck
Ivar
Hi the way I understand the dest() is that it is used in mapping operators when you define a source and a destination entity, by default you act on the source, but via the dest() you can evaluate variable at the destination coordinate. But if you are in 1D I do not really get your equation, how would you write it out in standard math ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28 giu 2012, 09:10 GMT-4
In attachment I wrote what I am trying to solve.
E is the electric field and V is the potential. This must be prograamed this way because of the boundary conditons that I have. I think the problem resides in the implementation of V.
Any suggestions?

Thanks for your help
In attachment I wrote what I am trying to solve. E is the electric field and V is the potential. This must be prograamed this way because of the boundary conditons that I have. I think the problem resides in the implementation of V. Any suggestions? Thanks for your help


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 giu 2012, 06:21 GMT-4
Anybody has suggestions?
Anybody has suggestions?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 set 2012, 18:08 GMT-4
Hi Ivar,

I have a question on this, what if we want to get the value continuously from 0 to x then in that case how shall we describe our Boolean?

Best
Hi Ivar, I have a question on this, what if we want to get the value continuously from 0 to x then in that case how shall we describe our Boolean? Best

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.