Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matthieu Jacobs
Python Scripts
Commits
0375fcb7
Commit
0375fcb7
authored
3 years ago
by
Jacobs Matthieu
Browse files
Options
Downloads
Patches
Plain Diff
extra efielddescr
parent
e1527836
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Scripts_Matthieu/AnalyticalPrescriptions.py
+21
-1
21 additions, 1 deletion
Scripts_Matthieu/AnalyticalPrescriptions.py
Scripts_Matthieu/PrepareGeometryDescription1.py
+1
-1
1 addition, 1 deletion
Scripts_Matthieu/PrepareGeometryDescription1.py
with
22 additions
and
2 deletions
Scripts_Matthieu/AnalyticalPrescriptions.py
+
21
−
1
View file @
0375fcb7
# This file contains the analytical functions describing potential, efield and magnetic field for different cases
import
math
import
PlottingFunctions
# Magnetic Fields
def
b_field_description1
(
r
,
z
,
theta
,
Rmajor
,
Rminor
):
# Radial B-field (linear and max at central surfaces of the torus
...
...
@@ -32,6 +33,11 @@ def potential_description2(r,z,theta,Rmajor,Rminor):
potval
=
math
.
exp
(
-
R
)
*
100
return
potval
def
potential_description3
(
r
,
z
,
theta
,
Rmajor
,
Rminor
):
r
=
(
r
-
Rmajor
)
/
100
z
=
z
/
100
potval
=
500
*
math
.
cos
(
4
*
math
.
atan2
(
z
,
r
))
return
potval
# Electric Fields
def
e_descr1
(
r
,
z
,
theta
,
Rmajor
):
r
=
r
/
100
...
...
@@ -48,4 +54,18 @@ def e_descr2(r,z,theta, Rmajor):
Er
=
-
100
*
math
.
exp
(
-
D
)
Ephi
=
0
Ez
=
0
return
[
Er
,
Ephi
,
Ez
]
\ No newline at end of file
return
[
Er
,
Ephi
,
Ez
]
def
e_descr3
(
r
,
z
,
theta
,
Rmajor
,
rminor
):
r
=
(
r
-
Rmajor
)
/
100
z
=
z
/
100
Er
=
2000
*
math
.
sin
(
4
*
math
.
atan2
(
z
,
r
))
*
z
/
(
z
**
2
+
r
**
2
)
Ephi
=
0
Ez
=
2000
*
math
.
sin
(
4
*
math
.
atan2
(
z
,
r
))
*-
r
/
(
z
**
2
+
r
**
2
)
# return [Er,Ephi,Ez]
return
Ez
Rmajor
=
500
rminor
=
100
ns
=
100
PlottingFunctions
.
plot2DContour
(
ns
,
ns
,
Rmajor
-
rminor
,
Rmajor
+
rminor
,
-
rminor
,
rminor
,
Rmajor
,
rminor
,
e_descr3
,
'
X [cm]
'
,
'
Y [cm]
'
,
'
Potential [V]
'
,
True
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Scripts_Matthieu/PrepareGeometryDescription1.py
+
1
−
1
View file @
0375fcb7
...
...
@@ -4,7 +4,7 @@ import shutil
import
AnalyticalPrescriptions
# The folder where the different cases should be stored is
basepath
=
"
D:\Matthieu\Documents
\\
1.Master\Thesis\Data
\\
"
folder
=
"
D:\Matthieu\Documents
\\
1.Master\Thesis\Data\Description
1
"
folder
=
"
D:\Matthieu\Documents
\\
1.Master\Thesis\Data\Description
2
"
if
os
.
path
.
isdir
(
folder
):
Flag
=
int
(
input
(
"
Do you want to remove
"
+
folder
+
"
Answer should be 1/0
"
))
if
Flag
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment