News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ComSoft6128

Wave Interference by John Kennedy

Started by ComSoft6128, 07:51, 23 March 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ComSoft6128

Type-in from a May 1985 issue of 'Popular Computing Weekly' magazine by "Auntie" John Kennedy (as he was later known as a WACCI member).
The program is Listed at end of video.

Magazine info ( from CPCRulez ):
"Great simulation
Making waves on any Amstrad machine - from the keyboard of John Kennedy

This program simulates the superposition of light - that is the resultant wave formed by two combined incident waves. It should be of interest to physics students as it shows constructive and destructive interference in a simple and easily understood manner. When the program is run, it will ask for some data. The user should enter the wavelength of the two waves, noting that only wavelengths between 1cm and 1m are accepted. The computer will then ask for the wave offset. This is the number of degrees that B is ahead of A, eg 180 is half a wavelength ahead; 90 is a quarter; 0 and 360 will produce a zero offset.
The program will then draw a grid in which each square represents 1 cm and with a horizontal axis across from left to right representing zero displacement. The waves and their resultant will be drawn out in different colors and then made to flash, highlighting the two sets. Pressing space at this point will re-run the program. Some example input data is given above.

Wavelengths Offset Result
8 and 5 180 destructive
5 and 5 0 constructive
5 and 5 90 mixture
2 and 1.5 0 'beats'
Beats are the regular changes in the amplitude of the resultant waves. They can be heard when two sound sources of similar amplitude but slightly different wavelength are used. Even the sound generator of the Amstrad will cause beats, try; Sound 1,1500,30000 followed by Sound 2,1601,30000.

Program Notes
The program has so many REM statements notes are almost unnecessary.

Line
70 If program broken into, re-run.
150-540 Get data from user.
490-630 Draw grid and axis.
640-770 Draw actual waves.
780-950 Rerun?
960-970 On error routine."


Links:
https://www.cpc-power.com/index.php?page=detail&num=10723
https://en.wikipedia.org/wiki/Wave_interference
https://www.cpcwiki.eu/index.php/Auntie_John
https://www.cpcwiki.eu/index.php/WACCI

Not emulated - original hardware and software.
Please note that  the aspect ratio for this YouTube video is 16:9 but the CPC monitor has an aspect ratio of 4:3 so you may wish to adjust your viewing device accordingly.

Powered by SMFPacks Menu Editor Mod