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.

Loop in Comsol without using MAtlab

Please login with a confirmed email address before reporting spam

Hi guys !

I assume I have 2 physics, how can I set up only in Comsol to make sure that I get as I expect :
A-->B-->A-->B-->A--> ...

Fully couple can not do that, so really need help from people here.

Thank you very much!

5 Replies Last Post 15 mars 2016, 13:57 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 mars 2016, 16:45 UTC−4
You can write a method in Application builder and run it.
In method you can have a for loop.

for (i=1, i<=10, i++){

model.study("std1").run(); // Study A

model.study("std2").run();// Study B

}
You can write a method in Application builder and run it. In method you can have a for loop. for (i=1, i

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 mars 2016, 17:36 UTC−4
Alternatively, you can use a segregated approach. For a conceptual introduction, see:
www.comsol.com/blogs/improving-convergence-multiphysics-problems/
Or, if you want to be a bit more explicit, add a series of study steps wherein you solve the different physics sequentially.
Alternatively, you can use a segregated approach. For a conceptual introduction, see: http://www.comsol.com/blogs/improving-convergence-multiphysics-problems/ Or, if you want to be a bit more explicit, add a series of study steps wherein you solve the different physics sequentially.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 15 mars 2016, 05:17 UTC−4
Hi all,

Thanks a lot for your help !

Sorry but my problem is still not be solved as I expect.
For example, I use ODE in Time-Dependent Study:
Name: x, f(u,ut,utt,t)= x*t[1/s]-2*y-1
Name: y, f(u,ut,utt,t)= y-3*x
I want to let Comsol solve x-->y-->x-->y-->x....
At t=0, x=0 --> y=0
At t=1[s], --> x=1 --> y=3
At t=2[s], --> x=3.5 --> y= 10.5

But when I use Segerated Approach in Comsol, the result is different.
Can you help me how to get the result I want ?

Best regards,
N. N
Hi all, Thanks a lot for your help ! Sorry but my problem is still not be solved as I expect. For example, I use ODE in Time-Dependent Study: Name: x, f(u,ut,utt,t)= x*t[1/s]-2*y-1 Name: y, f(u,ut,utt,t)= y-3*x I want to let Comsol solve x-->y-->x-->y-->x.... At t=0, x=0 --> y=0 At t=1[s], --> x=1 --> y=3 At t=2[s], --> x=3.5 --> y= 10.5 But when I use Segerated Approach in Comsol, the result is different. Can you help me how to get the result I want ? Best regards, N. N

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 15 mars 2016, 11:48 UTC−4
Hi Walter,

Thanks a lot for your help !
Thank you very much.

Best regards,
N. N
Hi Walter, Thanks a lot for your help ! Thank you very much. Best regards, N. N

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 15 mars 2016, 13:57 UTC−4
Hi Sohan,

Thanks a lot for your help !

Sorry for repeating my question but my problem is still not be solved as I expect.
For example, I use ODE in Time-Dependent Study:
Name: x, f(u,ut,utt,t)= x*t[1/s]-2*y-1
Name: y, f(u,ut,utt,t)= y-3*x
I want to let Comsol solve x-->y-->x-->y-->x....
At t=0, x=0 --> y=0 (loop number 1)
At t=1[s], --> x=1 --> y=3 (loop number 2)
At t=2[s], --> x=3.5 --> y= 10.5 (loop number 3)

But when I use Segerated Approach in Comsol, the result is different.
Can you help me how to get the result I want ?

Best regards,
N. N
Hi Sohan, Thanks a lot for your help ! Sorry for repeating my question but my problem is still not be solved as I expect. For example, I use ODE in Time-Dependent Study: Name: x, f(u,ut,utt,t)= x*t[1/s]-2*y-1 Name: y, f(u,ut,utt,t)= y-3*x I want to let Comsol solve x-->y-->x-->y-->x.... At t=0, x=0 --> y=0 (loop number 1) At t=1[s], --> x=1 --> y=3 (loop number 2) At t=2[s], --> x=3.5 --> y= 10.5 (loop number 3) But when I use Segerated Approach in Comsol, the result is different. Can you help me how to get the result I want ? Best regards, N. N

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.