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

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 15 Oct 2012 07:12 GMT-04:00
Posted: 5 years ago 13 Oct 2012 12:22 GMT-04:00
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

Posted: 5 years ago 15 Oct 2012 05:01 GMT-04:00
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!!

Posted: 5 years ago 15 Oct 2012 05:14 GMT-04:00
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

Posted: 5 years ago 15 Oct 2012 05:22 GMT-04:00
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!

Posted: 5 years ago 15 Oct 2012 06:33 GMT-04:00
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

Posted: 5 years ago 15 Oct 2012 06:39 GMT-04:00
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.

Posted: 5 years ago 15 Oct 2012 07:12 GMT-04:00
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.