Storing Cookies (See : http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm ) help us to bring you our services at overunity.com . If you use this website and our services you declare yourself okay with using cookies .More Infos here:
https://overunity.com/5553/privacy-policy/
If you do not agree with storing cookies, please LEAVE this website now. From the 25th of May 2018, every existing user has to accept the GDPR agreement at first login. If a user is unwilling to accept the GDPR, he should email us and request to erase his account. Many thanks for your understanding

User Menu

Custom Search

Author Topic: FEMM simulation showing COP 3 and 7  (Read 74772 times)

broli

  • Hero Member
  • *****
  • Posts: 2245
Re: FEMM simulation showing COP 3 and 7
« Reply #120 on: February 14, 2011, 10:08:30 AM »
I attached the sim and script. The scale is in mm, the script is set to a distance of 50mm, which you can adjust. Results are stored in the text file that is created.

Low-Q

  • Hero Member
  • *****
  • Posts: 2847
Re: FEMM simulation showing COP 3 and 7
« Reply #121 on: February 14, 2011, 12:21:59 PM »
I attached the sim and script. The scale is in mm, the script is set to a distance of 50mm, which you can adjust. Results are stored in the text file that is created.
This is GREAT! Thanks for your help :) :)

Vidar

Low-Q

  • Hero Member
  • *****
  • Posts: 2847
Re: FEMM simulation showing COP 3 and 7
« Reply #122 on: February 14, 2011, 01:38:26 PM »
Do you know where to modify to move a group sideways?

Here is the original script:
mydir="./"
outforcefile = mydir .. "ForceResults.txt"
open(mydir .. "Forcetest.fem")

mi_saveas(mydir .. "temp.fem") --make a temp file for the processing

-- the step size
increment = 1

-- determines the total distance to move up
distance = 50

-- calculates the amount of steps
steps = distance/increment

-- this part empties an already exsting file.
handle = openfile(outforcefile,"w")
write(handle, "")
closefile(handle)
   
   -- The main loop
   for n=0,steps do
      mi_clearselected()
      mi_selectgroup(1) --select the TT shape
      mi_movetranslate(0, increment) --move up

      mi_analyze()
      mi_loadsolution()
      mo_groupselectblock(1)
      
      forceY = mo_blockintegral(19)
      position = n
      
      handle = openfile(outforcefile,"a")
      write(handle, position, "\t", forceY, "\n")
      closefile(handle)
   end

        mi_clearselected()
        mi_selectgroup(1) --select the TT shape

Vidar

broli

  • Hero Member
  • *****
  • Posts: 2245
Re: FEMM simulation showing COP 3 and 7
« Reply #123 on: February 14, 2011, 01:42:55 PM »
Depends when you want to move it. If it's after you moved the TT's up then just copy and paste the entire for loop so you have two for loops. Then adjust the content of it appropriately. I can do it quickly if you give me the needed info.

http://pastebin.com/tpB4xdSG

Low-Q

  • Hero Member
  • *****
  • Posts: 2847
Re: FEMM simulation showing COP 3 and 7
« Reply #124 on: February 14, 2011, 01:56:09 PM »
Depends when you want to move it. If it's after you moved the TT's up then just copy and paste the entire for loop so you have two for loops. Then adjust the content of it appropriately. I can do it quickly if you give me the needed info.
Basicly I want group 1 (not necesserely the TT shape) to move to the right 50mm with 1mm steps. Well, basicly the same as the "upwards" script, but I want it to move to the right - not up.

Hope this information helps - I am too rookie with scripts to ask the right questions I guess :)

Vidar

broli

  • Hero Member
  • *****
  • Posts: 2245
Re: FEMM simulation showing COP 3 and 7
« Reply #125 on: February 14, 2011, 02:18:46 PM »
Basicly I want group 1 (not necesserely the TT shape) to move to the right 50mm with 1mm steps. Well, basicly the same as the "upwards" script, but I want it to move to the right - not up.

Hope this information helps - I am too rookie with scripts to ask the right questions I guess :)

Vidar

Oke just ignore the above link. I just made two script, one for up movement and one for side movement. In the side one you can add a negative sign, to choose either left or right movement.  Also don't forget to fill in your group number as I just left it on x.

Using lua scripts is pretty easy, just look at the skeleton of it and copy and paste to learn and experiment.

Low-Q

  • Hero Member
  • *****
  • Posts: 2847
Re: FEMM simulation showing COP 3 and 7
« Reply #126 on: February 14, 2011, 02:24:45 PM »
Oke just ignore the above link. I just made two script, one for up movement and one for side movement. In the side one you can add a negative sign, to choose either left or right movement.  Also don't forget to fill in your group number as I just left it on x.

Using lua scripts is pretty easy, just look at the skeleton of it and copy and paste to learn and experiment.
Thanks again! Superb :)