Family Of Curves

William Fish's picture

Can anybody tell me how to plot a family of indexed curves without having to type each one in the plot command?

View 4937_page 27.mw on MapleNet or Download 4937_page 27.mw
View file details

I'd like to see anything anybody would do differently.

Comments

gkokovidis's picture

Worksheet

I tried to download your worksheet, but it was blank.   

A simple example using the sequence command to plot a parabola a*x^2 with the variable a changing over a specified range.

>restart:

>p1:=seq(a*x^2,a=1..10):

>plot([p1],x);

P.S. Try reposting your worksheet. 

Later edit.  A more compact version of the code above:

>plot([seq((a*x^2),a=1..10)],x);

Regards,
Georgios Kokovidis
Dräger Medical


William Fish's picture

2nd Try

View 4937_page27.mw on MapleNet or Download 4937_page27.mw
View file details

I had a space in the file name.  I wonder if that could be the problem.  I took it out.

I like compact above.

Here is a fragment of the worksheet that you couldn't get:

> plot([T(1, theta), T(2, theta), T(3, theta), T(4, theta), T(5, theta)], theta = 0 .. Pi);

William Fish's picture

I'm A Convert

View 4937_page27.mw on MapleNet or Download 4937_page27.mw
View file details

I hope you can see the above worksheet.  I've converted to your way.  Now if I can just start thinking like you.  Thank you very much.

procedures work, too

An alternate approach is to pass procedures rather than expressions to plot.  For example,

plot(map2(curry,T,[$1..5]),0..Pi);

Possibly a nicer approach is the following

T := (nk,theta) -> 2*cos((theta+beta)/2) + theta/nk:
plots[animate](plot, [curry(T,nk),0..Pi], nk=1..3);

William Fish's picture

Animation

Joe,

Thanks.  That's the first Maple animation that I've seen.

View 4937_page27.mw on MapleNet or Download 4937_page27.mw
View file details

Does anybody know why there was a problem downloading the worksheet?  When I tried the download worked.  I'd like to try to avoid that problem in the future.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}