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: Ezgi Sunar <ezgi.sunar AT mnt.com.tr>
  • To: "Calvo Portela, Pedro" <Pedro.Calvo AT ciemat.es>, "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: Tue, 25 Jun 2024 10:15:33 +0000
  • Accept-language: tr-TR, en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mnt.com.tr; dmarc=pass action=none header.from=mnt.com.tr; dkim=pass header.d=mnt.com.tr; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YSo2loTowJtMEAwDEhKb4sLcEtFhrZ4+GXrNY7+YXVc=; b=CeRry7+uBXGBZfOwohWVC94z47VJZ8n60Ifwf0UBU7JmrXmQurUnLvBGAyyVjDouTo9ZIi3VNwPgTOlDcqsihWH+nU73+v6hCF7WFzFJ2C5IfMKirgOSCiD1WX1zmQ34Iuzr40VeaPNdh7OkkNWpTXjZeE9hiQee0VPouLRV5bgcBCYsipJmM70x2TqGl1iEcaPjcsBW7s4NympCYQyQVlQ95smAZtW7vyXYTJ7Z9QGQku3xHlGbRXAwEA2s0GGxxAqlRx2ugphJWtrJZjDWktsoEd4Bi0gO8Xnyh3rJtifxxpY0+YgjMI4iaKNeMnpiEOj4pfAWsajWvjRLZnmfIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=frLLKYDku1Vdmq39+7GtTexE/gKzdSa4tRkXrsfdpjOvm4ZgWKyxoqBogoP0uPU6RtUrqbz/ZpCELReJti3AuB61CmPx08d7Pxwq0wgRV4wj9JPXGpKUsbGWgOpvMpzKXQTz5e4mYnqCWVTe25NOU1Cm4dbdsSIoqtC8xhbJXcGvxGF7035Wixqd/hEwGwDQaioC5ccNnIA5Mzd5nwixGUst+vbZ0OzLbMHp8VXRJcE2wEwo+UmJDWmunlufCTAnBYEAmCgzk25lkqH0wqaqmL7q9zZJFD6TZC4MOMKiy2wSfEMzgGJbN7q5cLgC1bTsQDoUyO1otHwG3bL/xIt4ow==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mnt.com.tr;

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

 

PNG image




Archive powered by MHonArc 2.6.24.

Top of Page