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 calculate forces/torques between two magnets in various positions, orientations, sizes, etc..

Please login with a confirmed email address before reporting spam

Hi,

I am a new user of Comsol.

I would like to have your opinion about the following analysis.

I would like to calculate the force and torque between two cylindrical permanent magnets.

I am able to get the force and torque for a given position/orientation between the 2 magnets.

Now, I would like to calculate the force and torque for multiple size, position, orientation of the magnets.

What is the best way to do that? Do I need to use Matlab and create script that rebuild the model for a given situation, then caluculate the force and torque via comsol, import the result to matlab, update parameters and start again.?
Or can I do that only via Comsol?

Thanks for the help!

Lionel



4 Replies Last Post 2009年10月23日 GMT-4 10:36
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2009年10月21日 GMT-4 18:15
Hi

Unless you have got hold on a V4, I'm afraid the only way out is with a Matalb script. Probably you can survive with just a few calculations and then interpolate analytically for the rest

Good luck
Ivar
Hi Unless you have got hold on a V4, I'm afraid the only way out is with a Matalb script. Probably you can survive with just a few calculations and then interpolate analytically for the rest Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2009年10月22日 GMT-4 04:09
Hi Lionel,
I think you can do the analysis you want also with 3.5a version of Comsol without using Matlab.
Clearly with 4.0 version everything will be easier.
In 3.5a version, you have to use the Comsol module Deformed Mesh/Moving Mesh (ALE)/static analysis togheter with the module for your magnetic problem.
Just add first in the model navigator the Moving Mesh module and then the magnetic module.
In this way the magnetic module will be referred to the frame "ale".
Then go in the subdomain settings of the deformed mesh application mode and set your displacement function (dx, dy, dz components if you are in 3D) in the field "prescribed displacement".
Suppose that you want to parametrize the distance between the two magnets.
In the field prescribed displacement you have to set a function of the X Y Z coordinates that scales the distance. This same function should also depend on a parameter (let's call it "my_pam") which has to be used to run the parametric analysis.
Once you set up your function, go in "solver parameters" and choose the parametric solver. Set "my_pam" in paramters name and the range you desire in parameters values.
Then run your analysis.
You will obtain the results as function of "my_pam". In this particulare case you will have the results for different values of the distance between the 2 magnets.
I don't know it my explanation is clear or not.... I hope it is...!
Tomorrow, if you want, I can upload a model to showing how to set up such an analysis.
Hi!

Alessandro
Hi Lionel, I think you can do the analysis you want also with 3.5a version of Comsol without using Matlab. Clearly with 4.0 version everything will be easier. In 3.5a version, you have to use the Comsol module Deformed Mesh/Moving Mesh (ALE)/static analysis togheter with the module for your magnetic problem. Just add first in the model navigator the Moving Mesh module and then the magnetic module. In this way the magnetic module will be referred to the frame "ale". Then go in the subdomain settings of the deformed mesh application mode and set your displacement function (dx, dy, dz components if you are in 3D) in the field "prescribed displacement". Suppose that you want to parametrize the distance between the two magnets. In the field prescribed displacement you have to set a function of the X Y Z coordinates that scales the distance. This same function should also depend on a parameter (let's call it "my_pam") which has to be used to run the parametric analysis. Once you set up your function, go in "solver parameters" and choose the parametric solver. Set "my_pam" in paramters name and the range you desire in parameters values. Then run your analysis. You will obtain the results as function of "my_pam". In this particulare case you will have the results for different values of the distance between the 2 magnets. I don't know it my explanation is clear or not.... I hope it is...! Tomorrow, if you want, I can upload a model to showing how to set up such an analysis. Hi! Alessandro

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2009年10月22日 GMT-4 11:04
Hi Alessandro,

Thanks a lot for your input. I could create the model as you advise me.

I can move the mesh, but geometries stay fixed. Is there any way to move the geometry with the mesh?

Cheers,

Lionel
Hi Alessandro, Thanks a lot for your input. I could create the model as you advise me. I can move the mesh, but geometries stay fixed. Is there any way to move the geometry with the mesh? Cheers, Lionel

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 2009年10月23日 GMT-4 10:36
Hi!

I create a simple 2D mode of two cylindrical magnets (see attached). I able the move something, but the results are wrong...

The subdomain is moving but the results stay the same which is not correct.

What do I do wrong?

I wanted to explore also the solution from Ivar, using matlab script, but I can not connect comsol to matlab.
I spend like 2 hours to make it work, but no way!
I am working on Mac OS 10.6, and it may be the reason. Anyway, I just contacted the Comsol support.

Have a nice weekend,

Lionel
Hi! I create a simple 2D mode of two cylindrical magnets (see attached). I able the move something, but the results are wrong... The subdomain is moving but the results stay the same which is not correct. What do I do wrong? I wanted to explore also the solution from Ivar, using matlab script, but I can not connect comsol to matlab. I spend like 2 hours to make it work, but no way! I am working on Mac OS 10.6, and it may be the reason. Anyway, I just contacted the Comsol support. Have a nice weekend, Lionel

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.