[MatLab] Edit Delete Help with ion beam with many charge states

In summary, the author is simulating an ion beam with different charge states passing through two pinholes. They are using a random angle to evaluate the velocity components along the axes and solving the differential equation. They are also using y_sorgente and Event_Stop_Sorgente which are specific to the ODE they are working on. Their problem is with the random extraction of direction cosines.
  • #1
1Keenan
101
4
I'm simulating an ion beam with different charge states passing through two pinholes. I'm using random angles, from an external function, to evaluate the velocity components along the axes and solving the differential equation:

O=[0 0 0]';
f = @(t,ys) [ys(4:6); O];
options=odeset('RelTol',1e-7,'Events',@(t,ys)Event_Stop_Sorgente(t,ys,Pinhole1));
[t,ys] = ode23t(f,tspan,y_sorgente(i,:),options);

for the particle motion. The external function get some points from a sferic surface and uses their coordinates as direction cosine to get the velocity components from its modulus.

The problem I have is that only few particle with charge state 1+ can pass the pinhole, all the others can not and it doesn't make any sense if each particle has the same modulus of velocity. I'm doing something wrong, but I can't understand what, any suggestion?
 
Physics news on Phys.org
  • #2
you haven't shown us y_sorgente or Event_Stop_Sorgente which are the two custom files specific to the ODE you're working on. You also haven't explained what your inputs (ys) are and what ys(4:6) consists of.

Just posting the code won't garner much replies though, either, you really have to debug a bit and nail your problem down so that you can ask a more specific question. Try tracking your problem down. You may even solve it without our help!
 
  • #3
Sorry, I made a mistake in the title.
It was supposed to be "Help with ion beam with many charge states"
I don't know where "edit delete" comes from... :(
 
  • #4
Pythagorean said:
you haven't shown us y_sorgente or Event_Stop_Sorgente which are the two custom files specific to the ODE you're working on. You also haven't explained what your inputs (ys) are and what ys(4:6) consists of.

Just posting the code won't garner much replies though, either, you really have to debug a bit and nail your problem down so that you can ask a more specific question. Try tracking your problem down. You may even solve it without our help!

I don't have problem in the ode solver. I posted it just to say that I was solving the motion in a drift zone, with no field applied on the particles. it works fine for a beam with 0 angular spread.
Anyway y_sorgente is the initial condition vector it looks like: y_sorgente=[0 0 0 v_x v_y v_z]
Event_Stop is a function to stop the ode solver when the particles reach a certain point.

My problem is with the random extraction of direction cosines, I think.

P.S.: sorry for disturbing, you can delete this thread if it bothers you, I don't care.
 
  • #5


It seems like you are trying to simulate an ion beam with multiple charge states passing through two pinholes. It is important to note that the behavior of ions with different charge states can vary significantly due to their different masses and electric fields. Therefore, it is not surprising that only a few particles with a specific charge state are able to pass through the pinhole.

One suggestion would be to check if your random angle function is properly accounting for the different charge states. It may be helpful to also consider the electric field at the pinhole and how it affects the trajectory of the ions. Additionally, it may be beneficial to compare your simulation results with experimental data to validate your model.

Overall, it is important to thoroughly understand the physical properties of ions with different charge states and their interactions with electric fields in order to accurately simulate their behavior. I hope this helps and good luck with your simulation.
 

1. How do I edit the charge states in MatLab for an ion beam?

To edit the charge states in MatLab for an ion beam, you can use the built-in function "ionBeamEdit". This function allows you to specify the charge states and their corresponding probabilities for the ion beam.

2. Can I delete certain charge states from my ion beam in MatLab?

Yes, you can delete specific charge states from your ion beam in MatLab using the "ionBeamDelete" function. This function allows you to specify the charge states that you want to remove from the ion beam.

3. How can I add new charge states to my ion beam in MatLab?

You can add new charge states to your ion beam in MatLab using the "ionBeamAdd" function. This function allows you to specify the charge states and their corresponding probabilities that you want to add to the ion beam.

4. How do I get help with using ion beams in MatLab?

To get help with using ion beams in MatLab, you can use the "help" function or type "help ionBeam" in the MatLab command window. This will provide you with information on how to use the built-in functions for ion beams in MatLab.

5. Can I plot the charge state distribution of an ion beam in MatLab?

Yes, you can plot the charge state distribution of an ion beam in MatLab using the "ionBeamPlot" function. This function will generate a bar graph showing the probabilities of each charge state in the ion beam.

Similar threads

  • Introductory Physics Homework Help
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • High Energy, Nuclear, Particle Physics
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
10K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
5K
  • Introductory Physics Homework Help
Replies
6
Views
2K
  • Mechanical Engineering
Replies
1
Views
2K
Replies
29
Views
5K
Back
Top