Page 1 of 1

Error in the adjust command

Posted: Fri 20 Mar 2026 10:05
by FrancescoS
Hello,

I am trying to use the diag_size_max but I am having this error:
ADJUST command
Parameter number:0 of element:'DRIFT' cannot be adjust,
it exceeds the maximum number of 'DRIFT' parameters
From -> [ELEMENTS]: get or Set element data
From -> [DIAGNOSTIC]: Plot asjust calculation
From -> [DIAGNOSTIC]: Criteria calculation
From -> [OPTIMIZATION]: Optimi3
From -> [DIAGNOSTICS]: Calculation

The code I am using is below, there are some fieldmaps that are pretty big, I can in case share everything, if needed, but I think the error can be reproduced changing the maps with quads or any other element.
I can place several DIAG_SIZE and the simulation works, but as soon as I add a DIAG_SIZE_MAX I have this error and I don't understand why.

Can you please help?

Thanks
F.

; Structure file
Drift 35 75

adjust 1 1 1 40; 150
DRIFT 63.5338 50



FIELD_MAP 70 120 0 15 -0.90801 0 0 0 B120mmIron

adjust 1 1 7 40; 150 100
DRIFT 40 50


FIELD_MAP 70 80 0 15 +0.9004 0 0 0 B80mmIron

adjust 1 1 2 40; 150 100
DRIFT 123.305 50


FIELD_MAP 70 80 0 15 -0.9004 0 0 0 B80mmIron


adjust 1 1 6 40; 150 100
DRIFT 70.2302 50


adjust 1 1 3 10 30; 150 100
DRIFT 10 50

Drift 1236 50
DIAG_SIZE 1 5 5 (2)



superpose_map_out 800 70.5649 0 0 0 -10.047
superpose_map 0 30 0 0 0 0
FIELD_MAP 70 800 0 50 0.17474 0 0 0 Rog3Blineb ;0.36 riscala da 1.465 al valore di .0448 per i protoni da 60 MeV

drift 95.0334 300


superpose_map_out 800 -70.5649 0 0 0 10.047
superpose_map 0 -30 0 0 0 0
FIELD_MAP 70 800 0 50 -0.17474 0 0 0 Rog3Blineb


drift 22.5167 300


diag_size_max 1 10 10 0 0.01 (1)
Aperture 8 20 0
drift 50 300

Aperture 8 20 0;0.5 10 0
diag_size 1 5 8 0 0.01 (1)

drift 22.5167 300

superpose_map_out 800 -70.5649 0 0 0 10.047
superpose_map 0 -30 0 0 0 0
FIELD_MAP 70 800 0 50 -0.17474 0 0 0 Rog3Blineb

drift 95.0334 300

superpose_map_out 800 70.5649 0 0 0 -10.047
superpose_map 0 30 0 0 0 0
FIELD_MAP 70 800 0 50 0.17474 0 0 0 Rog3Blineb



DIAG_SIZE 1 5 5 0 0.01 (2)
Aperture 20 20 1; 10 10 1

DRIFT 500 50
END

Re: Error in the adjust command

Posted: Fri 20 Mar 2026 13:05
by Didier
Dear Francesco,

Unfortunately, simply by replacing your FIELD_MAP with quadrupoles, I can’t see any errors like the one you’ve described.
You’ll need to send me your entire project.

Regards,

Didier