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.

Is this ODE defined correctly?

Please login with a confirmed email address before reporting spam

Hello,

I have to time-integrate an expression and use it in my model to solve a PDE simultaneously. COMSOL does not give me an error and the result doesn't look that wrong. But I am still not sure if it's 100% correct.

Maybe someone could take a look at my definitions. The Scalar "A" is time dependent and calculated via a surface integration of space- and time-depenedent magnetic field components. The equations are simplified for keeping the track of the field components.

In Variables I defined:

Br=rmm.Bx*cos(alpha)
Ba=-rmm.Bx*sin(alpha)
alpha=atan2(y,x)
A = (intop12(rho/mue0*Br*Ba))
rho=sqrt(x^2+y^2)
ds=A
s=(1-s)*f/p

As global ODE I defined:
Variable:s
st-ds
s(t0)=1


Thanks in advance








2 Replies Last Post Jun 25, 2012, 11:20 a.m. EDT
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 Jun 25, 2012, 7:52 a.m. EDT
Hi

careful with variable naming, normally "s" is already used by COMSOL (edge argument), so I would suggest that you use something else, in general use longer names than 1 letter ;)

COMSOL does not always flag an error if you redefine an internal variable, because it accepts that you changes the physics, the difficulty is to identify when you change something on purpose, or by error ;)


--
Good luck
Ivar
Hi careful with variable naming, normally "s" is already used by COMSOL (edge argument), so I would suggest that you use something else, in general use longer names than 1 letter ;) COMSOL does not always flag an error if you redefine an internal variable, because it accepts that you changes the physics, the difficulty is to identify when you change something on purpose, or by error ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 25, 2012, 11:20 a.m. EDT

Hi

careful with variable naming, normally "s" is already used by COMSOL (edge argument), so I would suggest that you use something else, in general use longer names than 1 letter ;)

COMSOL does not always flag an error if you redefine an internal variable, because it accepts that you changes the physics, the difficulty is to identify when you change something on purpose, or by error ;)


--
Good luck
Ivar


Thanks for the answer. I tried to rename "s" but the results were the same. So it does not seem to matter in my case...
[QUOTE] Hi careful with variable naming, normally "s" is already used by COMSOL (edge argument), so I would suggest that you use something else, in general use longer names than 1 letter ;) COMSOL does not always flag an error if you redefine an internal variable, because it accepts that you changes the physics, the difficulty is to identify when you change something on purpose, or by error ;) -- Good luck Ivar [/QUOTE] Thanks for the answer. I tried to rename "s" but the results were the same. So it does not seem to matter in my case...

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.