Hello Aditya K
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年10月31日 GMT-4 19:41
Hi Aditya,
Did you ever get an answer? I have the same problem.
--Josh
Hi Aditya,
Did you ever get an answer? I have the same problem.
--Josh
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年11月1日 GMT-4 10:00
Dear Josh,
I got a work-around, rather than a solution. I simulate the model and do the particle tracing with an m x 1 row of points, export the results into a spreadsheet and save the model. I then save the model as an m-file, which auto-generates the all the commands used in the model. I then open comsol with matlab and create a new m-file. I import the saved model, and run a loop 'n' times with just three commands -
1. define the new y-coordinate of the row (equivalent to shifting the row of points laterally)
2. re-calculate the particle tracing
3. export the result into a new spreadsheet each time.
The result is 'n' spreadsheets each containing the particle tracing data of one 'm x 1' row of points, to give the total of 'm x n' points traced.
I then use the data in the way I want using another matlab script.
Hope this helps ! If you need more info on what exact commands to pick out from the model's m-file, let me know.
- Aditya
Dear Josh,
I got a work-around, rather than a solution. I simulate the model and do the particle tracing with an m x 1 row of points, export the results into a spreadsheet and save the model. I then save the model as an m-file, which auto-generates the all the commands used in the model. I then open comsol with matlab and create a new m-file. I import the saved model, and run a loop 'n' times with just three commands -
1. define the new y-coordinate of the row (equivalent to shifting the row of points laterally)
2. re-calculate the particle tracing
3. export the result into a new spreadsheet each time.
The result is 'n' spreadsheets each containing the particle tracing data of one 'm x 1' row of points, to give the total of 'm x n' points traced.
I then use the data in the way I want using another matlab script.
Hope this helps ! If you need more info on what exact commands to pick out from the model's m-file, let me know.
- Aditya
Daniel Smith
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年11月1日 GMT-4 12:23
The Particle Tracing Module was not released until V4.2a, so you must be using the extremely limited particle tracing functionality available in the base COMSOL Multiphysics package. In the Particle Tracing Module you can easily release particles using uniform or graded grids. There are also lots of other ways of releasing particles on domains and boundaries. See slides 17-21 of this presentation:
www.comsol.com/showroom/documentation/model/12009/
The Particle Tracing Module was not released until V4.2a, so you must be using the extremely limited particle tracing functionality available in the base COMSOL Multiphysics package. In the Particle Tracing Module you can easily release particles using uniform or graded grids. There are also lots of other ways of releasing particles on domains and boundaries. See slides 17-21 of this presentation:
http://www.comsol.com/showroom/documentation/model/12009/
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年11月1日 GMT-4 12:31
That's true, I was using particle tracing from the base package. Thanks for the new information, Daniel !
That's true, I was using particle tracing from the base package. Thanks for the new information, Daniel !
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年11月1日 GMT-4 13:38
Thanks Daniel and Aditya for your replies. I am also using the basic particle tracking functionality in Multiphysics, although if I continue using it regularly I will definitely consider purchasing the new particle tracking module.
Aditya, my version of Matlab is so old, I'm not sure your solution will work for me. I did find one other workaround. I realized that it is possible to enter a long sequence of coordinates without using the range command. For example:
x: 1, 2, 3, 1, 2, 3, 1, 2, 3
y: 1, 1, 1, 2, 2, 2, 3, 3, 3
So if you want a grid that is 3 rows and 10 points in each row, you have to enter 30 numbers in both the x and y input boxes. This is a real pain, especially if you need to calculate odd spacing. But it is possible to generate the correct sequence in Excel (where you can use equations to create the proper spacing as needed), and then export to a CSV. Then you can open the CVS in a text editor, copy the number sequence and paste into the Comsol GUI. Still kind of a pain but it did work for me. I think it would also be possible to create a serpentine polygon in the domain that you can define as a selectable boundary. Then you can define points evenly spaced along this polygon using boundary coordinates. I didn't try this yet because the CSV trick ended up working for me.
Thanks Daniel and Aditya for your replies. I am also using the basic particle tracking functionality in Multiphysics, although if I continue using it regularly I will definitely consider purchasing the new particle tracking module.
Aditya, my version of Matlab is so old, I'm not sure your solution will work for me. I did find one other workaround. I realized that it is possible to enter a long sequence of coordinates without using the range command. For example:
x: 1, 2, 3, 1, 2, 3, 1, 2, 3
y: 1, 1, 1, 2, 2, 2, 3, 3, 3
So if you want a grid that is 3 rows and 10 points in each row, you have to enter 30 numbers in both the x and y input boxes. This is a real pain, especially if you need to calculate odd spacing. But it is possible to generate the correct sequence in Excel (where you can use equations to create the proper spacing as needed), and then export to a CSV. Then you can open the CVS in a text editor, copy the number sequence and paste into the Comsol GUI. Still kind of a pain but it did work for me. I think it would also be possible to create a serpentine polygon in the domain that you can define as a selectable boundary. Then you can define points evenly spaced along this polygon using boundary coordinates. I didn't try this yet because the CSV trick ended up working for me.