Is there any way to debug in COMSOL? I mean, to solve step by step

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   7 Replies   Last post: October 15, 2012 11:12am UTC
Adrián Lara

Adrián Lara

October 12, 2012 9:21am UTC

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!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

October 13, 2012 4:22pm UTC in response to Adrián Lara

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Adrián Lara

Adrián Lara

October 15, 2012 9:01am UTC in response to Ivar Kjelberg

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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!!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

October 15, 2012 9:14am UTC in response to Adrián Lara

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Adrián Lara

Adrián Lara

October 15, 2012 9:22am UTC in response to Ivar Kjelberg

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

October 15, 2012 10:33am UTC in response to Adrián Lara

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jesus Lucio

Jesus Lucio

October 15, 2012 10:39am UTC in response to Adrián Lara

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Adrián Lara

Adrián Lara

October 15, 2012 11:12am UTC in response to Jesus Lucio

Re: Is there any way to debug in COMSOL? I mean, to solve step by step

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!!!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines