Example Design Programs on the WWW

Jack W Ponton
Email: j.ponton@ed.ac.uk

29 August 1996

The sample programs here are currently all to do with inductor design. They also represent two of the three main ways we have explored for delivering software accross the Internet. This document briefly describes the programs and the technology used to run them over the Web.

Solenoid coil design

This program designs single layer solenoidal inductors using the well known [1] equation:

L (microHenries) = ( d 2 n 2 ) / (18 d + 40 l )

d and l are diameter and length of the coil in inches, and n is the number of turns. The equation is accurate only for length to diameter ratios greater than about 0.4.

To obtain the number of turns for a coil of specified inductance and diameter, either the length must be fixed, which is inconvenient in many situations since it is usually desirable to wind turns adjacent to each other, or an iterative trial and error calculation performed. Both options are available in this program.

Iterative calculations are usually most conveniently programmed in scientific programming languages such as Fortran. This coil design program is written in Fortran 90. To run such a program over the WWW we make use of the CGI (Common Gateway Interface) facility. In principle any program can be run across the WWW this way. Data required by the program is entered into an HTML form, using standard features [2] of the HTML language. An active link from the form to a special URL for the program, or to a script which runs the program, causes calculations to be carried out and results written back to the user in the form of a new HTML document.

Advantages of this approach are that essentially any program can be run this way. The program runs on the provider's server, which can be a powerful computer. Hence large existing programs can be made available without having to be rewritten to run on the type of small PC often used for WWW access. A disadvantage in some circumstances is that rapid interaction with the program is not possible. The process essentially consists of three steps which must be carried out in sequence:

If this sequence has to be repeated frequently, then communication delays may become obtrusive.

This approach is thus best suited to providing access to existing programs which are primarily computational in nature, e.g. as here, iterative calculations written in Fortran.

Toroid design

Working out the number of turns on a toroid to give a specified inductance is not a trial and error calculation as the turns are assumed to be spread out over the whole of the toroid. The design equation [1] is simply:

n 2 = 10 4 L / A L

A L is a constant for each size and material of toroid, and can found in many reference books.

The programs have data for some of the more common iron dust toroids built in. For less usual size and material combinations, A L values are estimated from known toroids of the same size asuming that the parameter is proportional to the permeability of the material.

Since the calculations involved are very straightforward, a large Fortran program is not necessary. New programs were written in two languages intended to be hardware and operating system independent: Java and JavaScript.

In this case the programs are loaded from the WWW URL on the server, and executed on the user's machine or client.

The JavaScript demonstrator is a very simple program which is written as part of the HTML document. The program code can be viewed using the browser `View document source' option. This is a very convenient approach for simple calculations made into what is in effect an `intelligent form'. Disadvantages are that computation is extremely slow. This can be noticable on even moderately complicated calculations, which this however is not. A more relevant disadvantage at present is the availability of JavaScript. It is a Netscape invention [3] and is probably only available in Netscape browsers. So users of Mosaic or Another Product TM from a Very Large Software Company (probably also TM ) will not be able to run this demonstration.

Java is a more advanced language which has obtained wider recognition, even by the Very Rich Software Company TM . The Java `Applet' is partly compiled and loaded from the server to the client. Quite extensive calculations, and in addition, graphics, can be provided this way. The Java program is more comprehensive than the JavaScript. It took longer to write (i.e. a full day rather than just a lunch hour) but this is mostly due to have ing more features and because writing pretty graphics is always time consuming.

The third method

We have been developing a third method of software delivery for the WWW. I have no radio-relevant examples of this at present, but will set one up, probably for filter design, when time permits.

This method uses a form input to a server based program like the first method, but the server, rather than solving the problem, creates a customized program to solve the problem. This is generated in some widely acceptable format, e.g. as a Lotus .wk1 spreadsheet file, and emailed to the user.


[1] The ARRL handbook , section 2 contains details of coil and toroid data and equation.

[2] See e.g. HTML 2.0 Standards

[3] Netscape: JavaScript Authoring Guide

[4] S. Koch, Introduction to JavaScript , 1996

[5] Sun Microsystems Java homepage , see in particular the Java Tutorial.

[6] JW Ponton Creating and Solving Flowsheets over the WWW (This is not radio or even electronics, be warned!)