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 there any way to debug in COMSOL? I mean, to solve step by step

Please login with a confirmed email address before reporting spam

Hello, I think this is interesting.

It would be very useful for me if there would be a way to run a model step by step. I am working in Time Dependent, with PDE equations, and I cannot find the mistake that exists in my model...

When this things happen in MATLAB, the best you can do is to run your program step by step, checking and evaluating the variables, until you find why it does not work...


Any trick to do this in COMSOL?

Thanks a lot!

7 Replies Last Post Oct 15, 2012, 7:12 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 Oct 13, 2012, 12:22 p.m. EDT
Hi

often you get clues of what is wrong by first running for the initial conditions (possible as specific commands in 4.3a (&3.5a), from 4.0 to 4.3 you need to run the solver sub-node: dependent variables

--
Good luck
Ivar
Hi often you get clues of what is wrong by first running for the initial conditions (possible as specific commands in 4.3a (&3.5a), from 4.0 to 4.3 you need to run the solver sub-node: dependent variables -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2012, 5:01 a.m. EDT
thanks a lot, was helpful to know that ;-)

Another "problem" I have just realized about...

I have some variables that depends on a lot of things, and all of these are dependent on the time. I am using PDE and time dependent solver, so I see the evolution of my variables along time. That works fine.

I have a very interesting plot that I use to "debug", I mean, to say if everything seems to go right. This plot would be perfect if I could show it for a concrete instant 't'.

Do you have any idea about how I could do that?

(explaining myself a bit better: I run the study from 0 to 1 sec, in steps of 0.001). I would like to see the value of all my variables for t=0.57s, for instance).

The plot is well done, because if I disable the PDE, I see that it works fine for the initial parameters and variables values

Thanks a lot!!
thanks a lot, was helpful to know that ;-) Another "problem" I have just realized about... I have some variables that depends on a lot of things, and all of these are dependent on the time. I am using PDE and time dependent solver, so I see the evolution of my variables along time. That works fine. I have a very interesting plot that I use to "debug", I mean, to say if everything seems to go right. This plot would be perfect if I could show it for a concrete instant 't'. Do you have any idea about how I could do that? (explaining myself a bit better: I run the study from 0 to 1 sec, in steps of 0.001). I would like to see the value of all my variables for t=0.57s, for instance). The plot is well done, because if I disable the PDE, I see that it works fine for the initial parameters and variables values Thanks a lot!!

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 Oct 15, 2012, 5:14 a.m. EDT
Hi

once you have run a simulation you can see the results at any of the intermediated stored solutions (time or spatial all depends onyour model), or you can define a Data-Set extrapolating to the spatial or time desired value, when you have not stored the exact value, but twopositions around the point of interest

--
Good luck
Ivar
Hi once you have run a simulation you can see the results at any of the intermediated stored solutions (time or spatial all depends onyour model), or you can define a Data-Set extrapolating to the spatial or time desired value, when you have not stored the exact value, but twopositions around the point of interest -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2012, 5:22 a.m. EDT
Ey, thanks a lot for the incredibly quick reply!

Yeah, I am sure there should be a way to do it, since the data is calculated and stored.

I might by skipping something, but my question was how to plot those results at a certain time? Because I know how to plot a variable vs. time, vs. and expression, etc. But I do not know how to make a plot like:

y vs. x at t=0.57s

Sorry if I misunderstand something in your reply, but I still do not know how to do it.

Thanks a lot in advance!
Ey, thanks a lot for the incredibly quick reply! Yeah, I am sure there should be a way to do it, since the data is calculated and stored. I might by skipping something, but my question was how to plot those results at a certain time? Because I know how to plot a variable vs. time, vs. and expression, etc. But I do not know how to make a plot like: y vs. x at t=0.57s Sorry if I misunderstand something in your reply, but I still do not know how to do it. Thanks a lot in advance!

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 Oct 15, 2012, 6:33 a.m. EDT
Hi

I then propose that you study the doc around Data Set and how to create a derived database structure and calculate on thet

--
Good luck
Ivar
Hi I then propose that you study the doc around Data Set and how to create a derived database structure and calculate on thet -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2012, 6:39 a.m. EDT
Hi, Adrián and Ivar,

As Ivar says, you can select the particular time in the GUI. When you have chosen a time dependent study, at the settings for "Plot", there you can select a particular time (in the "Data"/"Time" list). Nevertheless, you can still select some solution at a particular time through the "at(time, expression)" operator. For instance:

at(5, solid.mises)

gives the von Misses stress at t = 5 s.

Bye,

Jesus.
Hi, Adrián and Ivar, As Ivar says, you can select the particular time in the GUI. When you have chosen a time dependent study, at the settings for "Plot", there you can select a particular time (in the "Data"/"Time" list). Nevertheless, you can still select some solution at a particular time through the "at(time, expression)" operator. For instance: at(5, solid.mises) gives the von Misses stress at t = 5 s. Bye, Jesus.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2012, 7:12 a.m. EDT
argggg, now I feel very stupid, I already did that in the past with deformations in 3D.

:P

Excuses for the extra question ;)

Thanks a lot!!!
argggg, now I feel very stupid, I already did that in the past with deformations in 3D. :P Excuses for the extra question ;) Thanks a lot!!!

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.