Main Content

Results for

function varargout = Ring6GeVAB(K1,AntiB,LA,MB,BLen,DLen)
%%%% parameters
if 0
K1=[3.1846 -3.1943 -2.7480 2.7482 2.4617 -1.7087 2.9818 ...
3.6102 0 -0.1129 -1.5851 -1.7727];
AntiB=[-0.0020 -0.0061];
LA=[0.5303 5.9419 0.6043];
MB=[1.2000 1.1000 1.0000 0.8000];
BLen=[1.8000 1.8000 1.0000 0.8000];
DLen=[0 0 0 0];
end
Energy=6.0*10^9;
%%Standard Cell
DS0H =atdrift('DS0H', (2.96+DLen(4))/5 ,'DriftPass');
DS0={DS0H DS0H DS0H DS0H DS0H }';
DS1 =atdrift('DS1', 0.28 ,'DriftPass');
DS2 =atdrift('DS2', 0.14 ,'DriftPass');
DB1 =atdrift('DB1', 0.12 ,'DriftPass');
DB2 =atdrift('DB2', 0.12 ,'DriftPass');
DB3 =atdrift('DB3', 0.43+DLen(1) ,'DriftPass');
DB4 =atdrift('DB4', 0.12 ,'DriftPass');
DB5 =atdrift('DB5', 0.12 ,'DriftPass');
DB6 =atdrift('DB6', 0.43+DLen(1) ,'DriftPass');
DB7 =atdrift('DB7', 0.12 ,'DriftPass');
DB8 =atdrift('DB8', 0.12 ,'DriftPass');
DA1 =atdrift('DA1', 0.12+DLen(2) ,'DriftPass');
DA2 =atdrift('DA2', 0.20,'DriftPass');
DA3 =atdrift('DA3', 0.14,'DriftPass');
DA4 =atdrift('DA4', 0.28+DLen(3),'DriftPass');
KQ=K1(1:8);
QS1=atquadrupole('QS1' , 0.30 ,KQ(1),'StrMPoleSymplectic4RadPass');
QS2=atquadrupole('QS2' , 0.20 ,KQ(2),'StrMPoleSymplectic4RadPass');
QB1=atquadrupole('QB1' , 0.20 ,KQ(3),'StrMPoleSymplectic4RadPass');
QB2=atquadrupole('QB2' , 0.20 ,KQ(4),'StrMPoleSymplectic4RadPass');
QB3=atquadrupole('QB3' , 0.20 ,KQ(5),'StrMPoleSymplectic4RadPass');
QB4=atquadrupole('QB4' , 0.20 ,KQ(6),'StrMPoleSymplectic4RadPass');
QA1=atquadrupole('QA1' , 0.50 ,KQ(7),'StrMPoleSymplectic4RadPass');
QA2=atquadrupole('QA2' , 0.60 ,KQ(8),'StrMPoleSymplectic4RadPass');
AntiB1=AntiB(1);
QB3=atrbend('QB3', 0.20, AntiB1, KQ(5),'BndMPoleSymplectic4RadPass','EntranceAngle',AntiB1/2, 'ExitAngle',AntiB1/2);
AntiB2=AntiB(2);
QA2=atrbend('QA2', 0.60, AntiB2,KQ(8),'BndMPoleSymplectic4RadPass', 'EntranceAngle',AntiB2/2, 'ExitAngle',AntiB2/2);
SD1 = atsextupole('SD' , 0.30, -28.365*0.0000001,'StrMPoleSymplectic4Pass');%%%-113.5678*0.00000000001,'StrMPoleSymplectic4Pass');
SD2 = atsextupole('SD' , 0.30, -28.365*0.0000001,'StrMPoleSymplectic4Pass'); %%%-113.5678*0.00000000001,'StrMPoleSymplectic4Pass');
SF = atsextupole('SF' , 0.30, 39.139*0.0000001,'StrMPoleSymplectic4Pass');%156.7516*0.00000000001,'StrMPoleSymplectic4Pass');
KB=K1(9:12);KB(1)=0;%KB(2)=0;
BAngle_p=MB;
BAngle=BAngle_p*2*pi/48/(sum(BAngle_p(1:3)*2)+BAngle_p(4))-[0 AntiB1 0 2*AntiB2];
N_Slice=5;
GRAD_Slice1=[];GRAD_Slice2=[];GRAD_Slice3=[];GRAD_Slice4=[];
for j_Slice=1:N_Slice
GRAD_Slice1=[GRAD_Slice1 KB(1)];GRAD_Slice2=[GRAD_Slice2 KB(2)];
GRAD_Slice3=[GRAD_Slice3 KB(3)];GRAD_Slice4=[GRAD_Slice4 KB(4)];
end
ANGLE_Slice1=1./(1+LA(1).*[1:N_Slice]*BLen(1)/N_Slice);
ANGLE_Slice2=flip(ANGLE_Slice1);
ANGLE_Slice3=1./(1+LA(2).*[1:N_Slice]*BLen(3)/N_Slice);
ANGLE_Slice3=[flip(ANGLE_Slice3(1:2:length(ANGLE_Slice3))) ANGLE_Slice3(3:2:length(ANGLE_Slice3))];
ANGLE_Slice4=1./(1+LA(3).*[1:N_Slice]*BLen(4)/N_Slice);
ANGLE_Slice4=[flip(ANGLE_Slice4(1:2:length(ANGLE_Slice4))) ANGLE_Slice4(3:2:length(ANGLE_Slice4))];
ANGLE_Slice1=ANGLE_Slice1/sum(ANGLE_Slice1)*BAngle(1);
ANGLE_Slice2=ANGLE_Slice2/sum(ANGLE_Slice2)*BAngle(2);
ANGLE_Slice3=ANGLE_Slice3/sum(ANGLE_Slice3)*BAngle(3);
ANGLE_Slice4=ANGLE_Slice4/sum(ANGLE_Slice4)*BAngle(4);
% figure;plot(ANGLE_Slice2*Energy/C0/BLen(1)*N_Slice,'.-r');hold on;
% figure;plot(ANGLE_Slice4*Energy/C0/BLen(4)*N_Slice,'.-b');hold on;
Bend1=LongiVFDipole_R('Bend1',BLen(1),BAngle(1),N_Slice,ANGLE_Slice1,GRAD_Slice1,'BndMPoleSymplectic4RadPass');
Bend7=LongiVFDipole_R('Bend7',BLen(1),BAngle(1),N_Slice,flip(ANGLE_Slice1),GRAD_Slice1,'BndMPoleSymplectic4RadPass');
Bend2=LongiVFDipole_R('Bend2',BLen(2),BAngle(2),N_Slice,ANGLE_Slice2,GRAD_Slice2,'BndMPoleSymplectic4RadPass');
Bend6=LongiVFDipole_R('Bend6',BLen(2),BAngle(2),N_Slice,flip(ANGLE_Slice2),GRAD_Slice2,'BndMPoleSymplectic4RadPass');
Bend3=LongiVFDipole_R('Bend3',BLen(3),BAngle(3),N_Slice,ANGLE_Slice3,GRAD_Slice3,'BndMPoleSymplectic4RadPass');
Bend5=LongiVFDipole_R('Bend5',BLen(3),BAngle(3),N_Slice,ANGLE_Slice3,GRAD_Slice3,'BndMPoleSymplectic4RadPass');
Bend4=LongiVFDipole_R_H2H('Bend4',BLen(4),BAngle(4),N_Slice,ANGLE_Slice4,GRAD_Slice4,'BndMPoleSymplectic4RadPass');
CellSR=[{DA4 QA2 DA3}'; Bend5;{ DA2 QA1 DA1}'; ...
Bend6;{ DB8 QB4 DB7 SD2 DB6 QB3 DB5 SF DB4 QB2 DB3 SD1 DB2 QB1 DB1}'; Bend7;{ DS2 QS2 DS1 QS1}'; DS0];
CellSL=[DS0 ;{QS1 DS1 QS2 DS2}'; Bend1;{ DB1 QB1 DB2 SD1 DB3 QB2 DB4 SF DB5 QB3 DB6 SD2 DB7 QB4 DB8}'; Bend2; ...
{DA1 QA1 DA2}'; Bend3;{ DA3 QA2 DA4}'];
CELL=[CellSL ;Bend4; CellSR ];
L0 = findspos(CELL,length(CELL)+1) * 48;
C0 = 299792458;
f = 500 * 10^6;
HarmNumber = round(f*L0/C0);
CAV = atrfcavity('CAV' , 0.0 ,4e+6 , HarmNumber*C0/L0, HarmNumber ,[],'CavityPass');
RING=[CELL ;{CAV} ;CELL; CELL; CELL ;CELL; CELL ;CELL; CELL; CELL; CELL;CELL;CELL; ...
CELL; CELL ;CELL; CELL ;CELL; CELL; CELL; CELL; CELL; CELL;CELL ;CELL; ...
CELL; CELL; CELL ;CELL ;CELL; CELL ;CELL ;CELL ;CELL; CELL;CELL;CELL; ...
CELL; CELL; CELL ;CELL ;CELL; CELL ;CELL ;CELL ;CELL; CELL;CELL;CELL ];
THERING =RING;
THERING = setcellstruct(THERING, 'Energy', 1:length(THERING), Energy);
varargout{1}=THERING;
%THERING = Ring6GeVAB(K1,AntiB,LA,MB,BLen,DLen)
The main round of Cody Contest 2025 kicks off today! Whether you’re a beginner or a seasoned solver, now’s your time to shine.
Here’s how to join the fun:
  • Pick your team — choose one that matches your coding personality.
  • Solve Cody problems — gain points and climb the leaderboard.
  • Finish the Contest Problem Group — help your team win and unlock chances for weekly prizes by finishing the Cody Contest 2025 problem group.
  • Share Tips & Tricks — post your insights to win a coveted MathWorks Yeti Bottle.
  • Bonus Round — 2 players from each team will be invited to a fun live code-along event!
  • Watch Party – join the big watch event to see how top players tackle Cody problems
Contest Timeline:
  • Main Round: Nov 10 – Dec 7, 2025
  • Bonus Round: Dec 8 – Dec 19, 2025
Big prizes await — MathWorks swag, Amazon gift cards, and shiny virtual badges!
We look forward to seeing you in the contest — learn, compete, and have fun!
Hi everyone!
I’m Kishen Mahadevan, Senior Product Manager at MathWorks, where I focus on controls and deep learning. I’m excited to be speaking at MATLAB EXPO this year!
In one of my sessions, I’ll share how AI-based reduced order models (ROMs) are transforming engineering workflows—using battery fast charging as an example—making it easier to reuse high-fidelity models for real-time control and deployment.
I’d love to have you join the conversation at the EXPO and right here in the community!
Feel free to drop any questions or thoughts ahead of the event.
Jack and Cleve had famously noted in the "A Preview of PC-MATLAB" in 1985: For those of you that have not experienced MATLAB, we would like to try to show you what everybody is excited about ... The best way to appreciate PC-MATLAB is, of course, to try it yourself.
Try out the end-to-end workflow of developing touchless applications with both MathWorks' tools and STM Dev Cloud from last year!
You can check out the exercises and the manual.
You can also register this year's EXPO. Join the Hands-On workshops to learn the latest features that make the design and deployment workflow even easier!
David
David
Last activity on 6 Nov 2025 at 20:47

Parallel Computing Onramp is here! This free, one-hour self-paced course teaches the basics of running MATLAB code in parallel using multiple CPU cores, helping users speed up their code and write code that handles information efficiently.
Remember, Onramps are free for everyone - give the new course a try if you're curious. Let us know what you think of it by replying below.
Run MATLAB using AI applications by leveraging MCP. This MCP server for MATLAB supports a wide range of coding agents like Claude Code and Visual Studio Code.
Check it out and share your experiences below. Have fun!
We’re excited to invite you to Cody Contest 2025! 🎉
Pick a team, solve Cody problems, and share your best tips and tricks. Whether you’re a beginner or a seasoned MATLAB user, you’ll have fun learning, connecting with others, and competing for amazing prizes.
How to Participate
  • Join a team that matches your coding personality
  • Solve Cody problems, complete the contest problem group, or share Tips & Tricks articles
  • Bonus Round: Two top players from each team will be invited to a fun code-along event
Contest Timeline
  • Main Round: Nov 10 – Dec 7, 2025
  • Bonus Round: Dec 8 – Dec 19, 2025
Register for the Contest
Registration is open now! Join your team, meet other coders, and get ready to learn and have fun!
Hey Cool Coders! 😎
Let’s get to know each other. Drop a quick intro below and meet your teammates! This is your chance to meet teammates, find coding buddies, and build connections that make the contest more fun and rewarding!
You can share:
  • Your name or nickname
  • Where you’re from
  • Your favorite coding topic or language
  • What you’re most excited about in the contest
Let’s make Team Cool Coders an awesome community—jump in and say hi! 🚀
Welcome to the Cody Contest 2025 and the Cool Coders team channel! 🎉
You stay calm under pressure. No panic, no chaos—just smooth problem-solving. This is your space to connect with like-minded coders, share insights, and help your team win. To make sure everyone has a great experience, please keep these tips in mind:
  1. Follow the Community Guidelines: Take a moment to review our community standards. Posts that don’t follow these guidelines may be flagged by moderators or community members.
  2. Ask Questions About Cody Problems: When asking for help, show your work! Include your code, error messages, and any details needed to reproduce your results. This helps others provide useful, targeted answers.
  3. Share Tips & Tricks: Knowledge sharing is key to success. When posting tips or solutions, explain how and why your approach works so others can learn your problem-solving methods.
  4. Provide Feedback: We value your feedback! Use this channel to report issues or share creative ideas to make the contest even better.
Have fun and enjoy the challenge! We hope you’ll learn new MATLAB skills, make great connections, and win amazing prizes! 🚀
Get ready to roll up your sleeves at MATLAB EXPO 2025 – our global online event is back, and this year we’re offering 10 hands-on workshops designed to spark innovation and deepen your skills with MATLAB Online and Simulink Online.
Whether you're exploring AI, modeling batteries, or building carbon trackers, these live workshops are your chance to:
  • Work directly in MATLAB and Simulink Online
  • Solve real-world challenges with guidance from MathWorks experts
  • Connect with peers across industries
  • Ask questions and get live feedback
Join the Experience to learn more about each workshop below!
Which workshop are you most excited to attend?!
Day 1:
  • Beyond the Labels: Leveraging AI Techniques for Enlightened Product Choices
  • A Hands-On Introduction to Reinforcement Learning with MATLAB and Simulink
  • Curriculum Development with MATLAB Copilot and Generative AI
  • Simscape Battery Workshop
  • Generating Tests for your MATLAB code
Day 2:
  • Hands-On AI for Smart Appliances: From Sensor Data to Embedded Code
  • A Hands-On Introduction to Reduced Order Modeling with MATLAB and Simulink
  • Introduction to Research Software and Development with Simulink
  • Hack Your Carbon Impact: Build and Publish an Emissions Tracker with MATLAB
  • How to Simulate Scalable Cellular and Connectivity Networks: A Hands-On Session
We look forward to Accelerating the Pace of Engineering and Science together!
It’s an honor to deliver the keynote at MATLAB EXPO 2025. I'll explore how AI changes the game in engineered systems, bringing intelligence to every step of the process from design to deployment. This short video captures a glimpse of what I’ll share:
What excites or challenges you about this shift? Drop a comment or start a thread!
David
David
Last activity on 20 Oct 2025 at 21:26

I just learned you can access MATLAB Online from the following shortcut in your web browser: https://matlab.new
I'm developing a comprehensive MATLAB programming course and seeking passionate co-trainers to collaborate!
Why MATLAB Matters:Many people underestimate MATLAB's significance in:
  • Communication systems
  • Signal processing
  • Mathematical modeling
  • Engineering applications
  • Scientific computing
Course Structure:
  1. Foundation Module: MATLAB basics and fundamentals
  2. Image Processing: Practical applications and techniques
  3. Signal Processing: Analysis and implementation
  4. Machine Learning: ML algorithms using MATLAB
  5. Hands-on Learning: Projects, assignments.
What I'm Looking For:
  • Enthusiastic educators willing to share knowledge
  • Experience in any MATLAB application area
  • Commitment to collaborative teaching
Interested in joining as a co-trainer? Please comment below or reach out directly!
Arkadiy Turevskiy
Arkadiy Turevskiy
Last activity on 15 Oct 2025 at 16:08

Please share with us how you are using AI in your control design workflows and what you want to hear most in our upcoming talk, 4 Ways to Improve Control Design Workflows with AI.
Arkadiy
Hello Everyone, I’m Vikram Kumar Singh, and I’m excited to be part of this amazing MATLAB community!
I’m deeply interested in learning more from all of you and contributing wherever I can. Recently, I completed a project on modeling and simulation of a Li-ion battery with a Battery Management System (BMS) for fault detection and management.
I’d love to share my learnings and also explore new ideas together with this group. Looking forward to connecting and growing with the community!