Updates from April, 2020 Toggle Comment Threads | Keyboard Shortcuts

  • mbenkerumass 6:00 am on April 3, 2020 Permalink | Reply
    Tags:   

    Applications of the Paraxial Approximation 

    It was discussed in a previous article, Mirrors in Geometrical Optics, Paraxial Approximation that the paraxial approximation is used to consider an apparently imperfect or flawed system as a perfect system.

    Paraxial Approximation

    The paraxial approximation was proposed in response to a normal occurrence in optical systems where the focal point is inconsistent for incident rays of higher incidence angles.The focal point F for a spherical mirror is understood under the paraxial approximation to be half the radius of curvature. Without the paraxial approximation, the system becomes increasingly complicated, as the focal point is a varying trigonometric function of the angle of incidence. The paraxial approximation assumes that all incident angles will be small.

    par

    The paraxial approximation can be likened (and when analyzed fully, this is it exactly) to a case of a triangle of base B, hypotenuse H and angle θ. Consider a case where H/B is very close to 1. θ will also be very small. In this case, it is of little harm to consider such a triangle as a triangle with θ=0, virtually to lines on top of each other, H and B, and more explicitly, H=B. This is precisely what is done when using the paraxial approximation.

     

    An interesting question to ask is, what angle should be the limit to which we allow a paraxial approximation? The answer would be, it depends on how accurate, or clear the image must be. When discussing optical systems, an aberration is a case in which rays are not precisely focused at the focal point of a mirror (or another type of optical system involving focusing). An aberration will actually cause the image clarity to be reduced at the output of the system. The following image would be an example of the result of an aberration to an image in an optical system:

    Chromatic_aberration_(comparison)

    Here is an example of a problem that makes clear an example of the issue of an aberration. Two rays appear to be correctly aligned to the focal point, however another ray with angle of incidence of 55 degrees is not focused at the focal point. A system that would allow a ray of incidence of 55 degrees may be acceptable under some circumstances, however one would expect to have an aberration or some level of blurriness to the image.

    op7

     
  • jalves61 8:19 pm on April 2, 2020 Permalink | Reply
    Tags:   

    Thermoelectric Effect, Thermoelectric current and the Seebeck Effect 

    There are three types of current flow in a semiconductor: Drift, diffusion, and thermoelectric. Drift current is very familiar as the study of conductors leads us to know that when a potential gradient (voltage) is established, electrons will flow in a conductor to balance this out. The same effect happens in semiconductors. However, there are two types of charge carriers in semiconductors: electrons AND holes. This leads to diffusion current, which is caused by a concentration gradient rather than a potential gradient.

    The third kind of current within a semiconductor is called thermoelectric current. which involves the conversion of a temperature gradient to a voltage. A thermocouple is a device which measures the difference in potential across two dissimilar materials where one end is heated and the other is cold. It was found that the temperature difference was proportional to the potential difference. Although Alessandro Voltage first discovered this effect, it was later rediscovered by Thomas Seebeck. The combination of potential differences leads to the full definition of current density.

    j1

    eemf

    S is called as the “thermopower” or “Seebeck coefficient” which is units of Volts/Kelvin. The two equations of Ohm’s law (point form) and E_emf look remarkably similar.

    thermo

    The Seebeck coefficient is negative for negative charge carriers and positive for positive charge carriers, leading to a difference in the Seebeck Coeffecient between the P and N side of the PN junction above. This leads to the above circuit being used as a thermoelectric generator. If a voltage source replaces the resistor, the circuit becomes a thermal sensor. These (thermoelectric generators) are often employed by power plants to convert wasted heat energy into additional electric power. They are also used in car engine engines for the same reason (fuel efficiency). Solid state devices have a huge advantage in the sense that they require no moving parts or fluids which eliminates much of the need for maintenance. They also reduce environmental impact by converting waste heat into electrical energy.

     
  • jalves61 4:53 pm on April 1, 2020 Permalink | Reply
    Tags:   

    Object Oriented Programming and C#: Simple Program to add three numbers 

    The following is a simple program that takes a user input of three numbers and adds them but does not crash when an exception is thrown (eg. if a user inputs a non integer value). The “int?” variable is used to include the “null” value used to signify that a bad input was received. The user is notified instantly when an incorrect input is received by the program with a “Bad input” command prompt message.

    c1

    The code above shows that the GetNumber() method is called (shown below) three times, and as long as these are integers, they are summed and printed to the console after being converted to a string.

    c2

    The code shows that as long as the sum of the three integers is not equal to null (anything plus null is equal to null, so if at least one input is a non-integer this will be triggered) the Console will print the sum of the three numbers. The GetNumber() method uses the “TryParse” method to convert each string input to an integer. This will handle exceptions that are triggered by passing a non-integer to the command line. It also gives a convenient return of “null” which is used above.

    The following shows the effect of both a summation and an incorrect input summation failure.

    correct

    incorrect

     
  • jalves61 11:23 pm on March 31, 2020 Permalink | Reply
    Tags:   

    Object Oriented Programming and C#: Shallow vs Deep Copying 

    The following will be a brief but important post illustrating the difference between reference and value types. In C#, value types are things like integers, floats, enumerations and doubles. A value type holds the data assigned to it in its own memory allocation whereas a reference type only holds an address which points to the actual data. A reference type is anything that is not an int, float or double, etc such as a dynamic array (list), static array, class objects, or strings. It is important to know the difference because when code such as the code below is executed, it can have some confusing effects.

    shallow copy

    The image above illustrates what is known as a “shallow copy”. Because instances of classes are not storing actual data but are used as pointers, when the object is copied to the second object, the memory address is copied instead of the data contained within “obj”. Therefore, any changes made to “obj2” will also affect “obj” because they point to the same data. The following image shows the difference between deep and shallow copies.

    diff

    To do a deep copy of an array, for instance, every element of that array must be copied to the new array. You can do that using the “Array.Copy(source array, copy array)” method. As shown in the image, this will create two references and two data instead of 2 references pointing to the same data. Shallow copying only copies a memory pointer.

     
  • jalves61 8:28 pm on March 30, 2020 Permalink | Reply  

    Power Factor and the Power Triangle 

    Power factor is very important concept for commercial and industrial applications which require higher current draw to operate than domestic buildings. For a passive load (only containing resistance, inductance or capacitance and no active components), the power factor range from 0 to 1. Power factor is only negative with active loads. Before delving into power factor, it is important to discuss different types of power. The type of power most are familiar with is in Watts. This is called active or useful power, as it represents actual energy or time dissipated or “used” by the load in question. Another type of power is reactive power, which is caused by inductance or capacitance, which leads to a phase shift between voltage and current. To demonstrate how a lagging power factor causes “wasted” power, it would be helpful to look at some waveforms. For a purely resistive load, the voltage and current are in phase, so no power is wasted (P=VI is never zero at any point).

    eli

    The above image captures the concept of leading and lagging power factor (leading and lagging is always in reference to the current waveform). For a purely inductive load, the current will lag because the inductor will create a “back EMF” or inertial voltage to oppose changes in current. This EMF leads to a current within the inductor, but only comes from the initial voltage. It can also be seen that this EMF is proportional to the rate of change of the current, so when the current is zero the voltage is maximum. For a capacitive load, the power factor is leading. A capacitor must charge up with current before establishing a voltage across the plates. This explains the PF “leading” or “lagging”. Most of the time, when power factor is decreased it is because the PF is lagging due to induction motors. To account for this, capacitors are used as part of power factor correction.

    The third type of power is apparent power, which is the complex combination of real and reactive power.

    triangle

    The power factor is the cosine of the angle made in this triangle. Therefore, as the PF angle is increased the power factor decreases. The power factor is maximum when the reactive power is zero. Ideally, the PF would be between 0.95 and 1, but for many industrial buildings this can fall to even 0.7. This leads to higher electric bills for this buildings because having a lower power factor leads to increases current in the power lines leading to the building which causes higher losses in the lines. It also leads to voltage drops and wastage of energy. To conserve energy, power factor correction must be employed. Often capacitors are used in conjunction with contactors that are controlled by regulators that measure power factor. When necessary, the contactors will be switched on and allow the capacitors to improve the power factor.

    For linear loads, power factor is called as displacement power factor, as it only accounts for the phase difference between the voltage and current. For nonlinear loads, harmonics are added to the output. This is because nonlinear loads cause distortion, which changes the shape of the output sinusoids. Nonlinear loads and power factor will be explored in a subsequent post.

     
  • jalves61 8:00 pm on March 29, 2020 Permalink | Reply
    Tags: , ,   

    Photovoltaic Effect and Theory of Solar Cells 

    Just as plants receive energy from the sun and use it to produce glucose, a photovoltaic cell receive energy from the sun and generates an electrical current. The working principle is based on the PN junction, which will be revisited here.

    Silicon can be subdivided into several discrete energy levels called “bands”. The major bands of concern are the valence and conduction bands. The bottom bands are fully occupied and don’t change.

    siliconenergy

    For silicon, the bandgap energy is 1.1eV. For an intrinsic semiconductor, the Fermi level is directly between the conduction and valence band. This is because there is an equal number of holes in the valence band as electrons in the conduction band. This means the probability of occupation of energy levels in both bands are equal. The Fermi level rises in the case of an n-type semiconuctor (doped with Phosphorous) and declines towards the valence band in a p-type (doped with Boron).

    The following illustrates an energy band diagram for a semiconductor with no bias across it. Photodiodes (light sensors) operate in this manner.

    intrinsicenergy

    The Fermi energy is shown to be constant. On the far right hand side away from the depletion region, the PN junction appears to be only P-type (hence the low Fermi level with respect to the conduction band). Likewise, on the left the Fermi level is high with respect to the conduction band. The slope of the junction is proportional to the electric field. A strong electric field in the depletion region makes it harder for holes and electrons to move away from the region. When a forward bias is applied, the barrier decreases and current begins to flow (assuming the applied voltage is higher than the turn on voltage of 0.7V). Current flows whenever recombination occurs. This is because every time an electron recombines on the P side, an electron is pushed out of the N side and beings to flow in an external circuit. The device wants to stay in equilibrium and balance out. This is why solar cells (as opposed to photodiodes) are designed to operate in a forward bias mode.

    The sunlight produces solar energy in the frequency bands of Ultraviolet, infrared and visible light. In order to harness this energy, silicon is employed (made from sand and carbon). Silicon wafers are employed in solar cells. The top layer of the silicon is a very thin layer doped with phosphorous (n-type). The bottom is doped with P-type (doped with Boron). This forms the familiar PN junction. The top layer has thin metal strips and the bottom is conductive as well (usually aluminum). Only frequencies around the visible light spectrum are absorbed into the middle region of the solar cell. The photon energy from the sun knocks electrons loose in the depletion region which causes a current to flow. The output power of a single solar cell is only a few watts. To increase power, solar cells are wired in series and parallel to increase the voltage and current. Because the output of the solar cells is DC, the output is run through an inverter, a high power oscillator that converts the DC current to an 240V AC current compatible with household appliances.

    solar_16x9_2

     
  • mbenkerumass 5:01 am on March 27, 2020 Permalink | Reply
    Tags:   

    Principles of Ray Tracing (1) 

    In geometrical optics, light is treated as rays, typically drawn as lines that propagate in a straight line from one point to another. Ray tracing is a method of determining how a ray will react to a surface or mirror. Rays are understood to propagate always in a straight line, however when entering an angled surface, rebounding from an angled surface or propagating through a different medium, there are a few techniques that are needed to reliably determine the direction and path of a light ray. The following properties are the basis for ray tracing.

    Refractive Index

    The refractive index is a property intrinsic to a medium that describes how fast or slow light propagates in the medium. Light speed in a vacuum is 3*10^8 m/s. Light speed will only get slower in real mediums. The formula for refractive index is the speed of light c devided by the velocity of light in the medium.

    op2

    The refractive index of air is approximately 1. The refractive index of glass for instance is about 1.5. This has implications on how light will propage when changing from one medium to another.

    refractivein1

     

     

    Snell’s Law

    Snell’s law uses the angle of incidence (incoming ray), the angle of refraction (exiting ray) and the refractive indexes of each medium at a boundary to determine the path of propagation. Consider the example below:

    op1

    Snell’s Law: η1*sin(θ1) = η2*sin(θ2)

    The angle of incidence and the angle of refraction are both with respect to the normal of the surface!

     

    Fermat’s Principle

    Fermat’s Principle is also demonstrated in the above figure. Fermat’s Principle states that the angle of incidence of a ray will be equal to the angle of reflection, but exiting from the other side of the normal of the surface.

     

    Using these principles alone, many optical instruments and technologies can be designed and built that manipulate the direction of light rays.

     
  • jalves61 9:23 pm on March 26, 2020 Permalink | Reply
    Tags: ,   

    RFID – Radio Frequency Identification 

    RFID is an important concept in the modern era. The basic principle of operation is simple: radio waves are sent out from an RF reader to an RFID tag in order to track or identify the object, whether it is a supermarket item, a car, or an Alzheimer patient.

    RFID tags are subdivided into three main categories: Active, passive and semipassive. Active RFID tags employ a battery to power them whereas passive tags utilize the incoming radio wave as a power source. The semipassive tag also employs a battery source, but relies on the RFID reader signal as a return signal. For this reason, the active and semi passive tags have a greater range than the passive type. The passive types are more compact and also cheaper and for this reason are more common than the other two types. The RFID picks up the incoming radio waves with an antenna which then directs the electrical signal to a transponder. Transponders receive RF/Microwaves and transmit a signal of a different frequency. After the transponder is the rectifier circuit, which uses a DC current to charge a capacitor which (for the passive tag) is used to power the device.

    The RFID reader consists of a microcontroller, an RF signal generator and a receiver. Both the transmitter and receiver have an antennas which convert radio waves to electrical currents and vice versa.

    The following table shows frequencies and ranges for the various bands used in RFID

    RFIDtable

    As expected, lower frequencies travel further distances. The lower frequencies tend to be used for the passive type of RFID tags.

    For LF and HF tags, the working principle is inductive coupling whereas with the UHF and Microwave, the principle is electromagnetic coupling. The following image shows inductive coupling.

    inductive coupling

    A transformer is formed between the two coils of the reader and tag. The transformer links the two circuits together through electromagnetic induction. This is also known as near field coupling.

    Far field coupling/radiative coupling uses backscatter by reradiating from the tag to the reader. This depends on the load matching, so changing the load impedance will change the intensity of the return wave. The load condition can be changed according to the data in order for the data to be sent back to the reader. This is known as backscatter modulation.

     
  • jalves61 8:14 pm on March 25, 2020 Permalink | Reply  

    Automotive Electrical System 

    In the early days of automobiles, electricity was not utilized within these machines. Car lights were powered by gas and engines were started by crank rather than a chemical battery.

    The three major components within a car’s electrical system are the battery (12Vdc), the alternator and the starter. The battery is the backbone of the car’s electrical system, which is the main source of electrical current. The electrical system can be split into two main parts. The main feed goes from the battery’s positive terminal to the starter motor. This cable is attached to the battery are capable of carrying up to 400 Amperes of current. This is the high current part of the circuit. The other part of the electrical system is from the ignition switch and carries a lower current. When the ignition switch is turned all the way to the “engine start” position, the starter motor is powered which begins the engine process. What actually happens is the starter solenoid is engaged is that when a small current is received from the ignition switch, the solenoid closes a pair of contacts and sends a large current to the starter. The starter needs a huge amount of current to spin the engine, which most humans cannot physically do.

    The starter motor rotates the flywheel, which turns the crankshaft on the engine. This allows the engine’s pistons to move and begin the process of internal combustion. Fuel is injected into the pistons and combined with air and spark, creates explosions which drive the engine.

    The alternator uses the principle of electromagnetic induction to supply energy to the battery and other electrical components. It is important to note that although the alternator produces AC (this is always the case for inductions), this is rectified much like a Dynamo so the output is DC. The alternator is driven by a serpentine belt which causes the rotor to rotate and in the presence of a stator, induces a current. The stator is made of tightly wound copper and the rotor is made of a collection of magnets, which produces the familiar Faraday induction effect. Diodes are used to rectify the output and also to direct current from the alternator to the battery to charge it.

    alternator

     
  • jalves61 8:45 pm on March 24, 2020 Permalink | Reply  

    Using GIT – Introduction 

    Git is essentially a version control system for tracking changes in computer files. This can be used in conjunction with Visual Studio to program in C#, for example. Git can be accessed through commands through the command window in windows. Git is generally to coordinate changes to code between multiple developers and is also used to work in a local repository which is then “pushed” to a remote depository such as Github.com

    Git tracks changes to files by taking snapshots. This is done by the user by typing “git commit ….” in the command prompt. The files should be added to the staging area first by using the command “git add <filename>”. “Git push” and “git pull” are used to interact with the remote repository. “Git clone” will copy and download a repository to your local machine. Git saves every version that gets committed, so a previous version can always be accessed if necessary. The following image illustrates the concept of committing.

    gitcommit

    You can essentially “branch” your commits which can later be merged together by using “git commit” command with multiple parents. The master branch is the main/linear list of saves. This can be done in the remote repository or the local. A “pull request” essential means taking changes that were made in a certain branch and pulling them into another branch. This means multiple people can be editing multiple branches which can then be merged together.

    Git is extremely useful for collaboration (as with websites such as google docs) where multiple authors can work on something at the same time. It also is excellent for keeping track of the history of projects.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel