# Finding where graphs intersect each other command tia sal2

Discussion in 'Maple' started by temp, May 24, 2006.

1. ### tempGuest

Greetings All

I have plotted several sine waves on a graph and would like to know where
all 8 sin waves or 3 sine waves graphs intersect. Is this possible? Can I
have each point highlighted on the graph?

Tia

PS: here's the plot I'm using in maple

plot({sin(x), 2*sin(2*x), 4*sin(4*x), 8*sin(8*x), 7*sin(7*x), 5*sin(5*x)},
x = 0 .. 8, color = [red, yellow, green, cyan, blue, magenta], title =
"Rodinmath graph")

Tia sal2

temp, May 24, 2006

2. ### Walter RobersonGuest

_EnvAllSolutions := true:
FS := {sin(x), 2*sin(2*x), 4*sin(4*x), 8*sin(8*x), 7*sin(7*x), 5*sin(5*x)}:

# for 3 at a time
R := [seq(seq(seq(solve({FS[J]=FS[K],FS[J]=FS[L]},[x]),L=K+1..nops(FS)),K=J+1..nops(FS)),J=1..nops(FS)-2)];

R := [[[x = 2 Pi _Z44~], [x = Pi + 2 Pi _Z45~]],
[[x = 2 Pi _Z46~], [x = Pi + 2 Pi _Z47~]],
[[x = 2 Pi _Z48~], [x = Pi + 2 Pi _Z49~]],
[[x = 2 Pi _Z50~], [x = Pi + 2 Pi _Z51~]],
[[x = 2 Pi _Z52~], [x = Pi + 2 Pi _Z53~]],
[[x = 2 Pi _Z54~], [x = Pi + 2 Pi _Z55~]],
[[x = 2 Pi _Z56~], [x = Pi + 2 Pi _Z57~]],
[[x = 2 Pi _Z58~], [x = Pi + 2 Pi _Z59~]],
[[x = 2 Pi _Z60~], [x = Pi + 2 Pi _Z61~]],
[[x = 2 Pi _Z62~], [x = Pi + 2 Pi _Z63~]],
[[x = 2 Pi _Z64~], [x = Pi + 2 Pi _Z65~]],
[[x = 2 Pi _Z66~], [x = Pi + 2 Pi _Z67~]],
[[x = 2 Pi _Z68~], [x = Pi + 2 Pi _Z69~]],
[[x = 2 Pi _Z70~], [x = Pi + 2 Pi _Z71~]],
[[x = Pi _Z72~], [x = 1/2 Pi + Pi _Z73~]],
[[x = 2 Pi _Z74~], [x = Pi + 2 Pi _Z75~]],
[[x = 2 Pi _Z76~], [x = Pi + 2 Pi _Z77~]],
[[x = 2 Pi _Z78~], [x = Pi + 2 Pi _Z79~]],
[[x = 2 Pi _Z80~], [x = Pi + 2 Pi _Z81~]],
[[x = 2 Pi _Z82~], [x = Pi + 2 Pi _Z83~]]]

Manually expecting, we see that nearly all of these effectively are
"any integral multiple of Pi". One of them, though, adds in
"1/2 Pi plus any integral multiple of Pi".

We cannot find the points at which "all 8 sine waves intersect" because
you only gave six sine waves ;-)

For all of the functions simultaneously:
{x = 2 Pi _Z84~}, {x = Pi + 2 Pi _Z85~}

Manually inspecting, we see that this is any multiple of Pi.

It would be possible to analyze the results more automatically and
programmatically reduce them down to the unique solutions, but it's
a slight nuisance to do so:
Ru := [x = Pi Z, x = Pi + 2 Pi Z, x = 2 Pi Z, x = 1/2 Pi + Pi Z]
8 Pi - 8 4
[[[0 <= Z, Z <= ----]], [[Z <= - ------, -1/2 <= Z]], [[0 <= Z, Z <= ----]],
Pi 2 Pi Pi

Pi - 16
[[Z <= - -------, -1/2 <= Z]]]
2 Pi

Then you get to convert those to integer ranges... and push them back up
through the Ru formulae to find the appropriate x values... and then
figure out which range goes with which element of R, so that you can
find the appropriate y value.

Walter Roberson, May 25, 2006