Code Monkey home page Code Monkey logo

mirrors.jl's Introduction

Mirrors.jl

This repository contains my thesis and its associated code. It's a Julia package, and can be installed with:

pkg> add https://github.com/mjg0/Mirrors.jl

The thesis, which goes into detail on the research that requires this code, can be built with make if you have bash, lualatex, and pygments installed.

This document will focus more on the code itself since the thesis covers the math and purpose behind Mirrors.jl. In short, a Mirror is a circular conducting mirror, possibly with some surface roughness:

using Mirrors, Plots

radius = 5.0 # wavelengths
N = 20       # number of rings; more rings means more precision and more memory use
rms = 0.1    # RMS surface roughness
sigma = 3.0  # standard deviation of surface roughness

M = Mirror(radius, N, rms, sigma)
heatmap(M) # plot the mirror's height

The impedance of the mirror (how each point on the mirror interacts with each other point when the mirror is charged) is a matrix of complex doubles, and scales quartically in memory use with the number of rings in the mirror:

Z = impedance(M)

Given the impedance matrix and an electric field on the mirror's surface:

# Profile of the illuminating beam; default is a uniform plane wave
sigma = 2.0 # wavelengths
function gaussianprofile(r, θ)
    return exp(-r^2/2sigma^2)
end
# Angle of incident beam relative to normal
angle = π/6
# Electric field
E = electricfield(M, angle, beamprofile=gaussianprofile)
heatmap(M, real.(E))

...the current on the mirror's surface can be found:

J = Z \ E
heatmap(M, real.(J))

Once the surface current is calculated, reflectance can be found:

R = Reflectance(M, J)
heatmap(R)

A Reflectance represents the far field reflectance from a Mirror in the mirror's entire upper hemisphere as an azimuthal equidistant projection, centered normal to the mirror and extending 90 degrees to the plane of the mirror.

mirrors.jl's People

Contributors

mjg0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.