Question about SPACE_CHARGE_COMP and FIELD_MAP (Ki parameter) in TraceWin  [SOLVED]

https://www.dacm-logiciels.fr/tracewin
Post Reply
ChinaZY Song
Beginner
Beginner
Posts: 9
Joined: Mon 27 Oct 2025 15:53
Country:
China (cn)
China

Question about SPACE_CHARGE_COMP and FIELD_MAP (Ki parameter) in TraceWin

Post by ChinaZY Song »

Dear Didier,
I have a few questions regarding the use of space charge compensation in TraceWin that I would like to clarify.
For a proton beam, I understand that the space charge compensation can often be approximated as about 90%. Therefore, I set in my data file:
SPACE_CHARGE_COMP 0.9
Based on this, I would like to confirm the following points:
1. Scope of SPACE_CHARGE_COMP
Does the command `SPACE_CHARGE_COMP`: apply only to the immediately following element, or act as a persistent state that applies to all subsequent elements until another `SPACE_CHARGE_COMP` command is defined?

2. Interaction with FIELD_MAP when Ki = 0**
If I want to apply a uniform space charge compensation of 0.9 along the entire beamline, for example:

SPACE_CHARGE_COMP 0.9
DRIFT 109 130 0 0 0
FIELD_MAP 007 880 0 100 0 1 0 20250902
DRIFT 109 130 0 0 0
END

I would like to confirm: When **Ki = 0** in the `FIELD_MAP` element (i.e., no `.scc` file is used), does the FIELD_MAP element still use the compensation defined by `SPACE_CHARGE_COMP 0.9`?
In other words:
When Ki = 0, is the space charge compensation inside FIELD_MAP controlled by the previously defined `SPACE_CHARGE_COMP`?
3. Behavior after FIELD_MAP using .scc

If a FIELD_MAP uses a `.scc` file (Ki > 0), what happens for the elements after it?
For example:

SPACE_CHARGE_COMP 0.9
DRIFT ...
FIELD_MAP ... (Ki = 1, using .scc)
DRIFT ...
END


After the FIELD_MAP, does the following DRIFT element: automatically return to the previous `SPACE_CHARGE_COMP 0.9`, or do I need to explicitly redefine `SPACE_CHARGE_COMP 0.9` again?

Thank you very much for your help.
User avatar
FranceDidier
Administrator
Administrator
Posts: 1262
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Question about SPACE_CHARGE_COMP and FIELD_MAP (Ki parameter) in TraceWin  [SOLVED]

Post by FranceDidier »

Hi,

1) It acts as a persistent state that applies to all subsequent elements until another `SPACE_CHARGE_COMP` command is defined.

2) Ki is only used if an .scc file is present. When the map is exited, the value normally reverts to that defined by SPACE_CHARGE_COMP. It's not certain, but it's not very difficult to check and see and yes, if it doesn’t work, simply repeat the command.

Regards,

Didier
Post Reply