Installing Linux on a machine without CD-ROM

November 6, 2009 by flamendialis

Quite a few of the new machines (called Netbooks) arrive without an optical drive. However, they are capable of booting off their USB drives, and installing Linux on them is not too difficult. Just get one of the USB distributions from the Net.

However, if you have a laptop without an optical drive, and cannot boot from the USB port either, then the following might be of some help.

  1. Remove the HD from the laptop and install it in a USB enclosure
  2. Attach this drive to a machine with Linux already installed
  3. Use cfdisk to assign partitions.
  4. Format the first partition on the disk as ext3 using the mkfs.ext3 command
  5. Mount the new partition (say /mnt/disk).
  6. Copy the /boot of the machine onto /mnt/disk
  7. Edit /mnt/disk/boot/grub/menu.lst, but leave it as hd0
  8. Start grub as root, and type:
    root (hd1,0)
    setup (hd1)
    quit
  9. Copy the installation boot image on to /mnt/disk/, and the installation ISO image on to another partition on the drive in the USB enclosure

  10. Unmount all partitions on that drive and disconnect it from the host machine.
  11. Remove the drive from the enclosure and install it on the laptop
  12. When the system boots, go into the grub shell, and type :
    kernel "path to vmlinuz"
    initrd "path to initrd"
    boot
  13. When prompted, point to the ISO on the disk, and proceed with the normal installation.

Printing

November 6, 2009 by flamendialis

A lot has been said about eliminating paper altogether, but printing documents is something we cannot seem to get enough of.

Printing Speed

The number of pages per minute printed is something that is quoted by all printer manufacturers, and we tend to compare numbers from different catalogs without giving it a second thought. However, what exactly is being printed? The printer manufacturers have not, so far, published the documents that they used for the tests. Even the driver setting used to print is usually the draft mode of the printer. All that is about to change with the ISO standards for printer speeds. Now, you can argue that the pages the ISO considers are not representative, but at least it seems to have forced companies to publish according to those standards.

A notorious company with regard to published printing speeds is Canon. Test according to the latest standards show that the printing speed for the their latest and greatest inkjets is only about 20% of the older models. Now, they have not moved the old models from their website, and they mention that they will only benchmark the new (2009) printers with the ISO standard. Lest their duplicity be discovered, they have come up with a new term called ipm–images per minute. The term would make sense if they were printing photos–they are after all, images. However, the standard ISO files are NOT images–they are regular documents, the kind that you would prepare for a report or paper. Note that as of writing of this blog, there is no ISO standard for photo printing.

Print Cartridge Life

A similar idea is that of the life of the cartridge. Once again, the companies that make these cartridges claim all sorts of things with all sorts of details like coverage areas and the like. A 5% coverage area has been bandied about. Once again, ISO has introduced a standard, which is now being followed by the companies concerned.

Cost of Printing

The actual cost of printing is always more than the cost of the paper and ink for a given number of pages. As the printer ages, the problems like paper management grow, and wastage is quite high. If the printer is not brand new, you can forget about things like duplex printing, as there is bound to be an error somewhere, and you might end up discarding the whole lot.

One idea most people would have, considering the cost of print cartridge is–why can’t we refill the cartridges? This would be quite economical, and there are two ways to go about it. One is to manually refill them, with a syringe. Here the quality of the replacement ink is important. Equally important is the need to maintain a good vacuum while refilling. The other method is to have a continuous ink system. This means that you have an external tank(s) which you pour ink into. You can see the level of ink and can probably do it till the head wears out.

ANSYS

October 29, 2009 by flamendialis

ANSYS has become the de-facto standard for engineering analysis for generic engineering analysis. One of the advantages is that the command line exposes all that can be done in the GUI and more.

WARNING: ANSYS is not free software–it is not even affordable software, with license fees running in the thousands of dollars (still cheaper than ABAQUS though). You will have to seriously consider how you will access this software once you graduate. You can look at the CAELinux software, which is a bootable DVD. It contains quite a lot of analysis software, and even though it is Linux, there is no installation problems to worry about.

The analysis type is set to static for the static structural analysis. The following lines are equivalent.

antype,0
antype,static

The pre-preprocessor is using the /prep7 command. In ANSYS, only the first four characters of the command are relevant. More may be used to enhance readability. However, commands like /prep7 are the exception. Some commands can only be invoked in certain modes. The major modes are /prep7, /solu and /post1. /post1 is the general post processor. /solu is the solution mode. You can get out of a particular mode by typing fini.

The usual elements are beam, shell and solid elements. link1 is one the simplest elements. The common beam element is beam3. Springs are modeled using the combin14 element.

There are quite a large number of elements of each type. shell63 is a common shell element.

The default value for the Poisson’s ratio is 0.3.

The element type is specified using the et command.

et,1,beam3

The above code declares the element type 1 to be of the beam type.
The material properties can be specified in great detail. However, the simplest case is that of a linear, isotropic material. In this case the material properties could be:

mp,ex,1,210e9
mp,nu,1,0.3

Of course, the declaration of the value 0.3 is superfluous as it the default anyway. You can also give the density using

mp,dens,1,1e3

but this is not used if you are not interested in the eigenvalues.

The real constants can be likewise specified

r,1,0.1

The above code gives the real value to be 0.1 for set 1.

How can we use this? When elements are defined, we can set the types, material properties, and the real constants like so:

type,1
real,1
mat,1

Of course, the real constants should supply what is expected by the element type. For instance, the element type shell expects a thickness, so we need only one value in the real constant set.

Contact Problems

Modeling contact problems in ANSYS is not that easy. Perhaps this is because it is a relatively new feature. Unlike software like ABAQUS, where contact is automatic, in ANSYS, you have to specify the contact surfaces.

Non-Linear Problems

Quite a lot of engineering problems are of the linear type. The reasons for this is quite clear–the components are designed with some factor of safety, so that it will seldom go into yield in a large fraction of the component. Yielding, if it occurs, will be quite localized, and will be acceptable.

Once in a while, however, you will end up with a problem that requires non linear analysis. It may be that the material is non linear even in the elastic region. Or more commonly, the material is thin enough so that there is significant geometric flexing. In any case, these are the cases where computer analysis is weakest, and where you encounter the dreaded convergence problem.

Fluid Mechanics

February 25, 2009 by flamendialis
Body in a Fluid

Body in a Fluid

Consider a body with a flat bottom placed inside an empty vessel. As water is poured into the vessel, the body will be submerged. If the body is less dense compared to water, it will float if placed in a vessel containing water. However, if the vessel is initially empty, adding water will cause a force due to pressure on the sides and top but not at the bottom. The question is, what is the condition for the pressure to act at the bottom? It is likely that water should get under the body in order to cause it to rise up due to buoyancy. What part will surface tension play in this particular case?

Optics

January 26, 2009 by flamendialis

Images formed by Two Plane Mirrors

The number of images formed by two plane mirrors forming an angle depends on the angle between them and whether the object is placed symmetrically between the mirrors. The image formed by one mirror acts as the object for the other, as long as the image lies in the object half of the plane for the other mirror. If the object is at the back of the mirror, no light from the object can fall on the mirror. All the images will be of the same intensity of the mirrors are infinite (semi-infinite), so that the amount of light that is seen to form an image is the same for all images. However, for finite mirrors, the amount of light is substantially lower for the images after the first couple of images, so that they would be fainter. The above statements assume that there is no loss in reflection.

Mirrors and Image forming space

Mirrors and Image forming space

If an object is placed between three mutually perpendicular mirrors, there are 7 images produced. Let the co-ordinates of the point be (a, b, c). The total images formed due to the mirrors in the xy, yz, and zx planes are all the different combinations of a, -a, for the first, b, -b for the second, and c, -c for the third respectively. This gives rise to 2 x 2 x 2 = 8 possibilities, where one of them coincides with the object (a, b, c).

Images by Perpendicular Mirrors

Images by Perpendicular Mirrors

The intensity of Light

VCD in Linux

January 3, 2009 by flamendialis

The automatic mounting process in Mandriva fails for a vcd. Attempts to mount will mount the first track, which is about 2 MB, and gives a bunch of errors in dmesg. However, the installed k3b program handles it well, with some quirks.

The Windows™ operating system is able to read files off the vcd, and you can copy the dat file from it. This file can be played in Linux using xine or kmplayer. However, k3b cannot make a vcd out of it–it demands an mpeg file. You can try and use some utilities to convert this dat file to an mpeg, but that is probably too much bother.

In k3b, there is a copy cd option, but that cannot copy a vcd as it has more than one track. You will need to rip the vcd onto your hard drive. k3b uses the vcdxrip program to do this and this will create an mpeg on the hard drive. This can also be played in all the standard media players in Linux. This file can be burned with k3b using the create vcd command. The vcd so created works well in standalone vcd players.

Electrostatics

December 11, 2008 by flamendialis

Consider a non-conducting sphere with a uniform charge density ρ. Since the material is a non conductor, the charge will not move around. The non-conductor, is also known as a dielectric. If it is a linear dielectric, it will have a dielectric constant εr, also denoted by K, which is greater than 1. In this case, the bound charge density is proportional to the free charge ρ. Thus the electric field inside is reduced by that factor.

Electric Field of a uniformly charged sphere

Electric Field of a uniformly charged sphere

The above figure shows the usual analysis of the problem. Note that the field is identical to that of a sphere of uniform mass density, a usual textbook approximation for the interior of the earth (although the density of the earth is highly non-uniform, increasing to a value of 13 g/cc at the center). Of course, since there is no negative mass, there is no question of polarization or some such in the case of the earth.

Electric Field inside a uniformly charged dielectric

Electric Field inside a uniformly charged dielectric

The electric field is discontinuous at the surface as there is surface charge buildup there. The field outside is unchanged from the original, but the field inside is reduced.

The real question is: what is meant by charge density? If it is the total charge density, then as Gauss’s law is always given by \oint \mathbf{E}\cdot d\mathbf{S} = Q_{enc}/\epsilon_0, and the electric field is immediately obtained. If the charge density is the free charge density, then the value of Q_{enc} is not immediately known, so that the field is different. Only in the case of a linear dielectric under very special circumstances can we give the “modification” of Gauss’s law as \oint \mathbf{E}\cdot d\mathbf{S} = Q_{enc}/\epsilon where ε is the absolute permittivity of the medium. These include that the material be a linear dielectric.

If the question is posed as follows: a sphere of radius R carries a charge Q, uniformly distributed in the volume. Plot the electric field vs r, the distance from the center of the sphere. Can we avoid the buildup of surface charge in the case of a linear dielectric? I think not. If the statement is about a charge density ρ = ρ0 for 0 ≤ r ≤ R, and zero everywhere else, then there is no ambiguity at all. A surface charge will involve an infinite volume charge density there, so that is impossible. Another way of stating the same thing is this: consider a charge Q distributed uniformly over a spherical region of radius R.

The Atmosphere

November 10, 2008 by flamendialis

The gases in the atmosphere are held on the earth due to its gravity. The conventional explanation is that light gases are not present in the atmosphere as they escape easily due to their higher velocities for the same temperature. From kinetic theory of gases, the rms value of the velocity of a gas at a temperature T is proportional to square root of T, and inversely proportional to the square root of the molecular mass. For instance, the rms speed of hydrogen should be more than 5 times that of nitrogen. But we end up in some trouble when the rms velocity is equated to escape velocity. The temperature ends up about ten thousand Kelvin! Where is the catch? The answer is simply this: the gases have escaped from the atmosphere during the thousands and millions of years. Of course, we lose all gases, including oxygen and nitrogen, to space. Fortunately for us, the rate is not too high.

Open Office

October 26, 2008 by flamendialis

The goal seek function in Open Office can be used to solve equations. Consider the Planck radiation law. With a change of variables, we have, the function that is required is \frac{x^5}{e^x -1}. Taking derivative, and setting it to zero, we have x – 5*(1-e-x) = 0. Enter this equation in Open Office calc in the cell A1 as follows: =b1 – 5 * (1 – exp(-b1)). In the cell b1 enter a starting value of 5. Go to Tools->Goal Seek and in the formula cell, enter $a$1, and target enter 0. In the variable cell, enter $b$1. Now click OK, and you will be asked if you want to replace the value with the computed value. That’s all there is to it. How well does it work? This gives a value of 2.895×10-3, very close to the accepted value of 2.93×10-3.

Elastic Collision of a Point Object with a Rigid Body

October 8, 2008 by flamendialis

An elastic collision is defined as one in which there is no energy loss. According to Newtonian mechanics, the momentum and angular momentum are conserved in an elastic collision. The simplest case that we can consider is the head on elastic collision of two masses m and M. Here, if we apply the conservation of momentum, angular momentum, and energy, we see that velocity of approach is equal to the velocity of separation.

Point Object to a Rigid body

Point Object to a Rigid body

Consider a rigid body of mass M which is at rest and a point object of mass m moving with a velocity v0. Let the mass impact the rigid body at a point P. Let the normal vector at P be given by n. Let the velocity of the point mass after collision be v1, and that of the center of mass of the rigid body be v. Let the angular velocity of the rigid body be ω after collision. Let the vector joining the center of mass with the point P be r. Let the moment of inertia of the rigid body about an axis passing through the center of mass and along ω be I.

Conservation of momentum gives

mv0 = m v1 + Mv—(1)

Conservation of angular momentum gives

r×mv0 = r×m v1 + Iω—(2)

The above equation can be re-written as

r×Mv = Iω

which is another way of saying that the angular momentum about the point P is conserved. Of course, for an isolated system, the angular momentum about any point is conserved.

Conservation of energy gives

½mv0² = ½mv1² + ½Mv² + ½Iω²—(3)

In the case of the collision of a point object with a rigid body, it is the normal component of the velocity that is to be considered. The velocity of approach is given by va

va = -v0.n

The velocity of separation is given by vs

vs = (v1vω×r).n

vs – va = (v1 + v0vω×r).n

During collision, the impulse acting is along the normal vector n, so that

n = -Mv/J = m(v1v0)/J

where J is the magnitude of the impulse acting at P.

vs – va = 1/J[ (v1 + v0).m(v1 - v0) + v.Mv - ω×r.Mv]

But ω×r = (r×Mvr/I = 2/J(½mv12 – ½mv02 + ½Mv2 + ½Iω2) = 0

using (3) (Conservation of energy)