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.

How to divide a solution by another solution

Please login with a confirmed email address before reporting spam

Greetings all, I am solving Darcy's Law and Solute Transport in a 2D rectangular model domain (using Comsol 4.2). I would like to normalize the solution by a known solution. This would basically entail dividing my solution by another solution.

More detailed explanation:

I am calculating groundwater solute concentrations using the solute transport model for 2 scenarios: one is an isotropic hydraulic conductivity (Darcy's Law), and the second is an anisotropic hydraulic conductivity. I would like to divide the anisotropic results by the isotropic results for visualization on a surface plot. Can anybody provide an explanation for how to divide a solution by another solution?

Thanks for your help!

E.J.E.H.


4 Replies Last Post 04.05.2012, 15:19 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 02.05.2012, 16:31 GMT-4
It can be automated in 'Comsol with Matlab':
1. Run a first loop of your base case
2. Extract data from your base case with mpheval
3. Run a second loop of your modified case
4. Extract data again with mpheval, of course you assign different names to extracted variables. If the mesh hasn't changed, all dependent variables values will be stored in the same order.
5. divide the 2 sets of data as you wish

For the looping and extracting procedure, look here : www.comsol.com/community/forums/general/thread/8840/
It can be automated in 'Comsol with Matlab': 1. Run a first loop of your base case 2. Extract data from your base case with mpheval 3. Run a second loop of your modified case 4. Extract data again with mpheval, of course you assign different names to extracted variables. If the mesh hasn't changed, all dependent variables values will be stored in the same order. 5. divide the 2 sets of data as you wish For the looping and extracting procedure, look here : http://www.comsol.com/community/forums/general/thread/8840/

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.05.2012, 15:05 GMT-4
Thanks, but I am hoping to find a way to do this in the COMSOL GUI. It seems like if you have two study's it shouldn't be difficult to do some simple algebra of the two solutions...

Thanks, but I am hoping to find a way to do this in the COMSOL GUI. It seems like if you have two study's it shouldn't be difficult to do some simple algebra of the two solutions...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.05.2012, 15:18 GMT-4
Once I have a solution in MATLAB and have exported it as a txt, how do I import it into COMSOL for visualization? I do not have the Comsol-Matlab license, so I have to do things piecemeal...

Once I have a solution in MATLAB and have exported it as a txt, how do I import it into COMSOL for visualization? I do not have the Comsol-Matlab license, so I have to do things piecemeal...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.05.2012, 15:19 GMT-4
In Results-Data Sets you can choose Join to combine two solutions. There are options to add, subtract or multiply the solutions. Unfortunately, you can't divide them. But maybe difference will work for you?
In Results-Data Sets you can choose Join to combine two solutions. There are options to add, subtract or multiply the solutions. Unfortunately, you can't divide them. But maybe difference will work for you?

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.