Skip to Content.
Sympa Menu

opal - Re: [Opal] Problem with Cyclotron Tune and Phase Calculation

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Problem with Cyclotron Tune and Phase Calculation


Chronological Thread  
  • From: "Calvo Portela, Pedro" <Pedro.Calvo AT ciemat.es>
  • To: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>, "opal AT lists.psi.ch" <opal AT lists.psi.ch>
  • Cc: Milo Conard <milo AT pac.be>, Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>, Ezgi Sunar <sunarezgi AT gmail.com>
  • Subject: Re: [Opal] Problem with Cyclotron Tune and Phase Calculation
  • Date: Wed, 17 Jul 2024 09:01:22 +0000
  • Accept-language: es-ES, en-US

Dear Ezgi


I have run your input file using the field provided (B_data_carboncycl), and have not gotten any errors. I am providing you with the standard OPAL output in a text file.


In order to solve your problem, I need more detail on what is the error you are getting or what are the points you do not understand about the simulation. 

The latest version of the manual (https://amas.web.psi.ch/opal/Documentation/2024.1/) is quite well described and updated, and you will find information on all OPAL commands. In addition, it has many simulation examples in the regression tests for cyclotrons (https://gitlab.psi.ch/OPAL/regression-tests/-/tree/master/RegressionTests?ref_type=heads). Try to have a look into CompactCyclotron and RingCyclotron 

Best regards
Pedro


-----------------------------------------------
Dr. Pedro Calvo Portela
Particle Accelerator Unit
Technology Department
CIEMAT - Av. Complutense 40, 28040 Madrid (Spain)
Tel: (+34) 914962542 / ext. 362542




De: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
Enviado: martes, 16 de julio de 2024 11:41
Para: Calvo Portela, Pedro; Adelmann Andreas
Cc: Milo Conard; Uğur Bozluolcay; Ezgi Sunar
Asunto: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation
 

Dear Andy and Pedro,

Thank you for your time in addressing my issues with OPAL. Unfortunately, my problems with the OPAL-cyclotron routine remain unsolved. It has been a couple of weeks since our last email, during which I have tried to familiarize myself more with the outputs generated by the program. As I have become more acquainted with it, I would appreciate your assistance once again. Here is a summary of the issues:

  1. I run the program with the cyclcarbon type and encounter a problem with the format of the B-field data. I am unable to determine the proper data format.
  2. Additionally, I ran the program blindly and discovered an approach with several regular steps in the two orders of the mode (SPT - SEO). Given my beginner level with this program, I would like to confirm my approach and steps.

Pedro, could you please reply to my last email regarding this approach? You mentioned that you managed to run my configuration input file but didn't explain the process nor the results in detail. Could you please provide more information about the outputs you obtained?

Finally, is there any training course or session available for OPAL programming? Or could you recommend some users (within PSI or any other) who could provide assistance. Since it is a powerful tool for cyclotron design, I am eager to educate myself and become a proficient user.

Thank you again for your time and understanding.

Best regards,
Ezgi

 

 

From: Ezgi Sunar
Sent: Tuesday, June 25, 2024 3:28 PM
To: Calvo Portela, Pedro <Pedro.Calvo AT ciemat.es>; opal AT lists.psi.ch
Cc: Milo Conard <milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Pedro,

 

Thank you very much for your reply! I'm glad to hear that the fieldmaps for the ring and carboncycl configurations I sent previously are working well. What kind of output data did you obtain? Because I have also successful runs with them; although, I couldn’t get the desired output files(tracking orbit data for each orbit/energy step, phase and time information regarding those orbits).

 

Regarding the error given with B_data, one possible explanation is a unit inconsistency between bfield_ring.dat and B_data. Could this be the case? bfield_ring.dat is in Gauss, and I believe B_data is in Tesla. I fix this inconsistency during run by changing the BSCALE in the main input file. For Gauss, BSCALE=1E-3. For Tesla, BSCALE=10.
Besides that, is there any obligation for fieldmap file format except the first couple of header lines, especially the restriction on the number of grid points (number of radial and azimuthal steps)? 

 

In addition to the fieldmaps, may I ask you how you get the position data for each orbit based on a given energy deviation ? Moreover, what is the right approach for such a design of carboncycl ?

 

Here's my proposed approach for obtaining the desired data:

 

  1. Single particle Tracking (SPT): Run the simulation in single orbit tracking mode with one particle to determine the orbital positions for each energy step. (In our case, we use 0.05 MeV and give this information in the main input file.) This mode will also provide data for the tune diagram (tunes.dat).
  2. SEO Mode (Two Particles): After obtaining the orbits' information with single particle, run the simulation in SEO mode with two particles to analyze particle tracking within those orbits.

How should I run SEO mode based on the output data coming from SPT mode?

 

Additionally, I've attached the modified Bfield data (B_data_carboncycl.dat) specific to the carboncycl configuration (based on my understanding). As mentioned in our initial communication, our primary goal is to design a low-energy cyclotron for industrial applications using carboncycl. However, I also included ring simulations for troubleshooting purposes. Ideally, I'd like to successfully run the simulation with the carboncycl configuration.

 

Thank you again for your time and assistance.

Best Regards,

Ezgi

 

From: Calvo Portela, Pedro <Pedro.Calvo AT ciemat.es>
Sent: Tuesday, June 25, 2024 2:06 PM
To: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>; opal AT lists.psi.ch
Cc: Milo Conard <milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: Re: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Ezgi

 

I have been able to simulate without error with the bfield_ring and bfield_carboncycl fields, but the B_data field comes out with error. I was checking the code but I can't find the problem.

I am not familiar with TYPE=RING format, maybe if you could send me the B_data field in a format suitable for CARBONCYL I can find the source of the error.

 

Best regards

Pedro


De: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
Enviado: martes, 25 de junio de 2024 12:15:33
Para: Calvo Portela, Pedro;
opal AT lists.psi.ch
Cc: Milo Conard; Uğur Bozluolcay; Ezgi Sunar
Asunto: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Pedro,

 

 

Hope things are going well!

Just wanted to check in and see if there's any update on the issue I'm having with [Program Name]. It's been a while since I first contacted support about [brief description of the issue].

This issue is pretty critical for my ongoing studies, so any news you could share would be fantastic. I know you guys are busy, so no worries if it's still in the queue.

Thanks for your time!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Do you have any change to look at the problem?

 

From: Ezgi Sunar
Sent: Friday, June 21, 2024 11:37 AM
To: Calvo Portela, Pedro <
Pedro.Calvo AT ciemat.es>; opal AT lists.psi.ch
Cc: Milo Conard <
milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Pedro,

This is following up on my previous email regarding a potential issue with the fieldmap format

Fieldmap Format:

  • Cyclotron Type Dependence:
  • Carboncycl: The field map for a carboncycl cyclotron should begin with 6 lines specifying the following parameters:
  • r_min: Minimum radius value.
  • delta_r: Step size for the radius.
  • theta_min: Minimum theta value (in degrees).
  • delta_theta: Step size for theta (in degrees).
  • Number of theta steps (#theta).
  • Number of radial steps (#r).
  • Ring: The field map for a ring cyclotron requires 9 (or possibly 10) initial lines with the same four parameters as carboncycl. However, the following lines differ:
  • Lines 5 and 6 likely describe the program that generated the field data. The format appears to be SO3AV.NAR, but the meaning of the specific values LPAR, IENT, and IPAR is unclear. Understanding these values is crucial for writing the correct data in these lines

4.0

4.0

0.0

2.0

LABEL=S03AV

CFELD=FIELD NREC= 60 NPAR= 3

LPAR= 7 IENT= 1 IPAR= 1

3 60 179 30 8 8 70

LPAR= 2169 IENT= 2 IPAR= 2

0.100000000E+01 0.190000000E+04 0.200000000E+02 0.000000000E+00 0.333333343E+00

  • B-Field Format: Is there a specific reason for requiring 5 columns and 15 characters for each B-field value?

Cyclotron.cpp Behavior: The program crashes despite having the correct number of lines in my fieldmap. Here's an example:

My interpretation is that cyclotron.cpp can't read certain variables even though it processes the header lines correctly (grid points are calculated/read correctly according to the starting lines).

  • Title Inconsistencies: The program always reads the map title as "READ IN RING FIELD MAP" regardless of the actual cyclotron type (ring or carboncycl). Is this intentional, or might my comments be misplaced?

 

 

 

Question: In my previous attempt to resolve the program crashing, I unfortunately sent you a modified fieldmap where I increased the number of B-field lines by copying and pasting the section. While this workaround allowed the program to compile and run to completion, it's important to understand that this doesn't necessarily reflect a proper simulation. The additional lines are simply duplicates and don't contain valid data for the cyclotron physics.
I've attached a correctly generated fieldmap created by COMSOL for your reference. This map contains the accurate header information with the appropriate B-field data for ring type.

  • Cyclotron radius: 240mm
  • Starting radius: 4mm
  • Number of radial steps: 60 (calculated as 240mm / 4mm)
  • Starting theta: 0 degrees
  • Delta theta: 2 degrees
  • Number of azimuthal steps: 180 (corrected to 179 as 0 counts as the first index)
  • Expected number of B-field lines: 10,800 (180 azimuthal steps * 60 radial steps)
  • Total number of lines with 5-column format: 2,160 (10,800 lines / 5 columns/line)

I hope this explanation clarifies my observations and questions. Please let me know if you have any insights or require further details.

Many thanks.

Regards,

Ezgi

 

 

From: Ezgi Sunar
Sent: Wednesday, June 19, 2024 5:38 PM
To: 'Calvo Portela, Pedro' <
Pedro.Calvo AT ciemat.es>
Cc: Milo Conard <
milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Pedro,

I apologize for the confusion and for not explaining the fieldmap format beforehand.

I need the equilibrium orbit information for my magnet design, including phase and time. To achieve this, I used both ring and carboncycl cyclotron simulations. Therefore, I modified my original fieldmap file to be compatible with the formats described in the manual. You can find both modified versions attached:

  • bfield_ring.dat (equivalent to your bfield_nm1.dat format)
  • bfield_carboncycl.dat

I look forward to your findings. Thank you very much for your help.

Many thanks,
Ezgi

 

 

From: Calvo Portela, Pedro <Pedro.Calvo AT ciemat.es>
Sent: Wednesday, June 19, 2024 4:49 PM
To: Ezgi Sunar <
ezgi.sunar AT mnt.com.tr>
Cc: Milo Conard <
milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: Re: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Ezgi

 

The format of the fieldmap header you are using is not correct. Therefore, it does not perform anything in the simulation, since the grid point parameters along the radial and azimuthal coordinates are missing. You can take a look at the documentation (https://amas.web.psi.ch/opal/Documentation/master/#sec.opalcycl.fieldmap)

OPAL should detect the error and send a message in case the fields are not properly defined. I will open an issue to fix it.

 

When you adapt the magnetic field to the right format, please send it to me and I will keep working on it.

 

Best regards

Pedro

 


De: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
Enviado: martes, 18 de junio de 2024 16:09:03
Para: Calvo Portela, Pedro
Cc: Milo Conard; Uğur Bozluolcay; Ezgi Sunar
Asunto: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Pedro,

I'm attaching the files for a simple run I'm using for training purposes. The field map and parameter values are just examples.
I've already tried activating the option for generating the gnu.out and eb.out files, but unfortunately, they remain empty after the simulation.

Thanks in advance for your help.

Sincerely,
Ezgi

 

 

From: Calvo Portela, Pedro <Pedro.Calvo AT ciemat.es>
Sent: Tuesday, June 18, 2024 4:00 PM
To:
opal AT lists.psi.ch; Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
Cc: Milo Conard <
milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: Re: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Ezgi

 

Could you please provide me the input file, as well as the fieldmap and the distribution you are using? So I can try to run your simulation and find the specific error.

 

Regarding the gnu.out and eb.out files you need "OPTION INFO=TRUE to be activated.

 

Best regards

Pedro

 

-----------------------------------------------

Dr. Pedro Calvo Portela
Particle Accelerator Unit

Technology Department

CIEMAT - Av. Complutense 40, 28040 Madrid (Spain)
Tel: (+34) 914962542 / ext. 362542

 


De: opal-request AT lists.psi.ch <opal-request AT lists.psi.ch> en nombre de Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
Enviado: martes, 18 de junio de 2024 13:41
Para: Adelmann Andreas;
opal AT lists.psi.ch
Cc: Milo Conard; Uğur Bozluolcay; Ezgi Sunar
Asunto: RE: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Dear Andy,

 

Thank you so much for your prompt reply. The insightful explanation regarding the repository page helped me a lot. However, I need your support one more time. 

I've thoroughly explored the repository, but I'm stuck finding information on how to calculate orbits in this specific mode. Here's what I've encountered during my trials:

  1. Single Particle Distribution: When running in single-particle mode, I utilize a "one particle distribution" with the "fromfile" type.
    This approach, according to the documentation, should generate output files named "gnu.out" and "eb.out." However, these files remain empty after the simulation.
    I can successfully generate a "track-Orbit.dat" file. Unfortunately, this file only shows the positions of the reference particle at only one orbit.
  2. Gaussmatched Distribution: Switching to the "gaussmatched" distribution offers valuable insights into energy increase per orbit using Gordon Units. It generates a "tunes.dat" file containing data like energy increase, average radius, momentum, nu_R, and nu_Z, useful for the tune diagram, but lacking the detailed information needed for a full understanding of the orbits themselves.
  3. Two-Particle Test: I also attempted to use two particles for Static Equilibrium Orbit (SEO) information. Unfortunately, this approach didn't yield significant insights.
  4. Tuning Script Error: Additionally, I attempted running the "tuning.sh" script for Static Equilibrium Orbit (SEO) calculations using the cyclotron example from the OPAL wiki, but the script returned an "invalid file descriptor" error.

My understanding (please correct me if I'm wrong) is that the workflow involves running a single-particle simulation first. This analyzes the orbits at increasing energy levels. Subsequently, a two-particle simulation would be used with the aim of obtaining accurate tune calculations. However, even if this is the correct approach, I'm unsure how to use the output from the single-particle simulation as input for the two-particle one.

I've attached all the relevant output files for your reference.

Thank you once again for your continued support. I greatly appreciate your assistance in navigating this challenge.

Sincerely,
Ezgi

 

From: Adelmann Andreas <andreas.adelmann AT psi.ch>
Sent: Wednesday, May 29, 2024 9:54 AM
To: Ezgi Sunar <
ezgi.sunar AT mnt.com.tr>
Cc:
opal AT lists.psi.ch; Milo Conard <milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: Re: [Opal] Problem with Cyclotron Tune and Phase Calculation

 

Hi Sunar

 

1. How and where can I define the initial and final energies in the input file?

 

You specify the injection energy in the input file, check line 44 in 

P0 will then be used on line 282 on the BEAM command

 

2. Which type of cyclotron should I run for this application? I suppose it would be CARBONCYCL. If so, I have some difficulties with the necessary structures of the data files; like BFIELD.

 

YES, CARBONCYCL and the detailed description can be found in the manual section 7.4.1.

 

3. How and where can I define and calculate the orbit coordinates according to the given energies in the input file? I found that OPAL uses the external program FIXPO for calculating the initial orbit coordinates based on our desired energy range. If this is correct, I cannot find how and where to set these parameters. 

 

FIXPO is used to calculate the reference solution only. This is only for making sure the OPAL tune calculation is correct. 

 

To me your particle (initial condition) starts out of the field map, please check.

 

Cheers Andy 
------
Dr. sc. math. Andreas (Andy) Adelmann
Paul Scherrer Institut OHSA/D17 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Zoom ID: 470-582-4086 Password: AdA
Zoom Link: 
https://ethz.zoom.us/j/4705824086?pwd=dFcvT1pMMGY0bHg0dTNncUNZZTJkZz09

-------------------------------------------------------
Friday: ETH HPK G 28   +41 44 633 3076
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================

 

On 28 May 2024, at 16:16, Ezgi Sunar <ezgi.sunar AT mnt.com.tr> wrote:

 

Hello again,

 

I apologize for the oversight in my previous email. The error message encountered during the run is provided in the attachment.


Thanks for your time.

 

Best Regards,

Ezgi

 

From: Ezgi Sunar 
Sent: Tuesday, May 28, 2024 5:02 PM
To: 
opal AT lists.psi.ch
Cc: Milo Conard <
milo AT pac.be>; Uğur Bozluolcay <ugur.bozluolcay AT bozlu.com.tr>; Ezgi Sunar <sunarezgi AT gmail.com>
Subject: Problem with Cyclotron Tune and Phase Calculation

 

Dear Sir/Madam,

 

I am working on the design of a low energy cyclotron (for industrial applications).

The first result I’d like to get is a simple tune calculation in order to optimise the magnetic field

To achieve this, I have modified the cyclotron example file from the OPAL wiki page to suit my design parameters. Here is the relevant section of the input file:

 

Name_Cycl: CYCLOTRON, TYPE=CARBONCYCL, CYHARMON=4, FMLOWE=0.5, FMHIGHE=3.0, PHIINIT=0.0, PRINIT=pr0, RINIT=r0, SYMMETRY=4.0, RFFREQ=f1, FMAPFN="bfield.dat", BSCALE=1E-3;

L1: LINE = (Name_Cycl);

Dist1: DISTRIBUTION, TYPE=FILENAME, NSTEPS=100, SECTOR=FALSE, FNAME="dist1.dat";

Fs1: FIELDSOLVER, FSTYPE=NONE, MX=64, MY=64, MT=64, PARFFTX=true, PARFFTY=true, PARFFTT=false, BCFFTX=open, BCFFTY=open, BCFFTT=open;

Beam1: BEAM, PARTICLE=PROTON, PC=P0, NPART=2, BCURRENT=1.0E-6, BFREQ=f1;

SELECT, LINE=L1;

TRACK, LINE=L1, BEAM=Beam1, MAXSTEPS=nstep*turns, STEPSPERTURN=nstep;

RUN, METHOD="CYCLOTRON-T", BEAM=Beam1, FIELDSOLVER=Fs1, DISTRIBUTION=Dist1;

 

As part of the tune calculation mode, I am using data distribution for two particles: one as the reference particle with all data set to zero and another one off-center. The `dist1.dat` file includes the following information:

 

2

0.0         0.0           0.0           0.0          0.0           0.00

0.005       0.001         0.005         0.001        0.005         0.001

 

Additionally, the B-field data is created with:

- Grid points along azimuth (ntet): 239

- Grid points along radius (nrad): 4

 

4

4

0.0

1.5

239

48

11296.6  11317.7  11327.6  11337.9  11354.2

11367.0  11378.0  11393.0  11412.4  11435.4

11453.5  11472.2  11495.2  11523.0  11551.7 ......

 

Upon running this configuration, I encountered a few issues and a failure during execution. I would appreciate your guidance on the following points:

 

1. How and where can I define the initial and final energies in the input file?

2. Which type of cyclotron should I run for this application? I suppose it would be CARBONCYCL. If so, I have some difficulties with the necessary structures of the data files; like BFIELD.

3. How and where can I define and calculate the orbit coordinates according to the given energies in the input file? I found that OPAL uses the external program FIXPO for calculating the initial orbit coordinates based on our desired energy range. If this is correct, I cannot find how and where to set these parameters.

 

I have attached the error message encountered during the run for your reference.

 

Thank you for your assistance.

 

Best regards,  

Ezgi Sunar

 

Attachment: cyclotron1-trackOrbit.dat
Description: cyclotron1-trackOrbit.dat

Attachment: output.out
Description: output.out

Attachment: cyclotron1.in
Description: cyclotron1.in



  • Re: [Opal] Problem with Cyclotron Tune and Phase Calculation, Calvo Portela, Pedro, 07/17/2024

Archive powered by MHonArc 2.6.24.

Top of Page