Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Parametric plot of electric field lines' topicStudent Support Forum > General > "Parametric plot of electric field lines"

Help | Reply To Topic
Author Comment/Response
Juan Herrera
11/25/09 8:37pm

I'm trying to plot electric field lines as tubes with a parametric plot. I build a list with n points as

pts = BuildPointList[pa_,pb_,v_]

so that pts[[1]] is the list of points, and pts[[2]], pts[[3]] are lists giving two vectors perpendicular to the field line at each point. I go on to define

F[p_,i_,t_]:=p[[1, i]] + p[[2, i]] Cos[t] + p[[3, i]] Sin[t]

When I plot with

ParametricPlot3D[
F[pts, i, t],
{i, 1, n , 1},
{t, 0, 2π}]

I obtain a field line as a tube. But when I try plotting two lines as

ParametricPlot3D[
{F[pts1, i, t],
F[pts2,i,t]},
{i, 1, n, 1},
{t, 0, 2π}]

I get

ParametricPlot3D::ppfun: Argument {F[pts1, i, t], F[pts2, i, t]} is not a list with three or four elements.

What's wrong here? Thanks

Juan 〚

URL: ,
Help | Reply To Topic