Problems with the use of streamline for a magnetic field
Hi,
I’m trying to plot the streamlines of a magnetic field generated by a magnet and a coil. I have my Field generated in 6 vectors, XYZ for the coordinates et UVW for the components. I managed to reorganize those data in 6 3D-arrays. I ploted the quiver and the plot seems satisfying. Now I wanted to plot the streamlines in order to observe the loopback. Unfortunately, the streamlines are not really good and does not follow the vectors ploted by quiver. Here is the figure :
when i use the following xyz 3D arrays and i have the error sample points must be unique and i don’t understand why becuase all the couples are unique.
x=
val(:,:,1) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
y=
val(:,:,1) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
z=
val(:,:,1) =
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
val(:,:,2) =
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
val(:,:,3) =
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01Hi,
I’m trying to plot the streamlines of a magnetic field generated by a magnet and a coil. I have my Field generated in 6 vectors, XYZ for the coordinates et UVW for the components. I managed to reorganize those data in 6 3D-arrays. I ploted the quiver and the plot seems satisfying. Now I wanted to plot the streamlines in order to observe the loopback. Unfortunately, the streamlines are not really good and does not follow the vectors ploted by quiver. Here is the figure :
when i use the following xyz 3D arrays and i have the error sample points must be unique and i don’t understand why becuase all the couples are unique.
x=
val(:,:,1) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
y=
val(:,:,1) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
z=
val(:,:,1) =
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
val(:,:,2) =
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
val(:,:,3) =
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01 Hi,
I’m trying to plot the streamlines of a magnetic field generated by a magnet and a coil. I have my Field generated in 6 vectors, XYZ for the coordinates et UVW for the components. I managed to reorganize those data in 6 3D-arrays. I ploted the quiver and the plot seems satisfying. Now I wanted to plot the streamlines in order to observe the loopback. Unfortunately, the streamlines are not really good and does not follow the vectors ploted by quiver. Here is the figure :
when i use the following xyz 3D arrays and i have the error sample points must be unique and i don’t understand why becuase all the couples are unique.
x=
val(:,:,1) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -2.000000000000000e-01 -2.000000000000000e-01
-1.387778780781446e-17 -1.387778780781446e-17 -1.387778780781446e-17
2.000000000000000e-01 2.000000000000000e-01 2.000000000000000e-01
y=
val(:,:,1) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,2) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
val(:,:,3) =
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
-2.000000000000000e-01 -1.387778780781446e-17 2.000000000000000e-01
z=
val(:,:,1) =
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
-5.000000000000000e-02 -5.000000000000000e-02 -5.000000000000000e-02
val(:,:,2) =
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
1.500000000000000e-01 1.500000000000000e-01 1.500000000000000e-01
val(:,:,3) =
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01
3.500000000000000e-01 3.500000000000000e-01 3.500000000000000e-01 streamlines MATLAB Answers — New Questions