Skip to content

Instantly share code, notes, and snippets.

View matthewshawnkehoe's full-sized avatar
Coffee

Matthew Kehoe matthewshawnkehoe

Coffee
View GitHub Profile
% dno_tfe_helmholtz_m_and_n.m
% Calculates the upper layer DNO for the TFE method (2d): Small perturbation.
function [Gnm] = dno_tfe_helmholtz_m_and_n(unm,f,p,Dz,a,Nx,Nz,N,M)
% MSK 7/26/21: Changed the size of Gnm from (Nx,N+1,M+1) to (Nx,M+1,N+1)
Gnm = zeros(Nx,M+1,N+1);
ell_bottom = Nz + 1;
f_x = ifft( (1i*p).*fft(f) );
% field_tfe_helmholtz_m_and_n.m
% Calculates field data in the upper layer for the TFE method (2d): Small perturbation.
function [unm] = field_tfe_helmholtz_m_and_n(...
xi_n_m,f,p,gammap,alpha,gamma,Dz,a,Nx,Nz,N,M,identy)
% MSK 7/26/21: Changed the size of unm from (Nx,Nz+1,N+1,M+1) to (Nx,Nz+1,M+1,N+1)
% MSK 7/26/21: xi_n_m should be size (Nx,M+1,N+1);
% MSK 7/30/21: Vectorized (most of) j loop
% driver_tfe_small.m
% Script to test the TFE method for DNOs (2d): Small perturbation.
clear all; close all; SavePlots = 0;
% alpha, gamma are the underscore values
alpha = 0; gamma = 1.21; gammaw = 1.15; Eps_Max = 1e-3; Delta_Max = 1e-5;
d = 2*pi; a = 1; Nx = 48; Nz = 32; N = 8; M = 8; b = 1; Test_Case = 17;
Upper_Field = true;
k = sqrt(alpha^2 + gamma^2);
/**************************************************************************
**
** Apply Riemann-Siegel Formula for Lehmer's Phenomenon
**
**************************************************************************
** Matthew Kehoe
** 09/30/2015
**************************************************************************/
import java.util.Iterator;
@matthewshawnkehoe
matthewshawnkehoe / CharacterCreationWithImage.java
Last active October 1, 2015 03:12
Character Creation Screen
/*
Matthew Kehoe
*/
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.applet.*;
/*
Matthew Kehoe
*/
import javax.swing.*;
import javax.swing.border.Border;
import java.util.EmptyStackException;
import java.util.Stack;
import java.util.Random;
import java.awt.*;
/*
Matthew Kehoe
*/
public class GenericShip
{
private int crew;
private int cost;
private String shipName;
@matthewshawnkehoe
matthewshawnkehoe / Life.Java
Created October 1, 2015 02:37
Game Of Life
/**
This program is created in order to simulate Conway's Game of Life.
@author Matthew Kehoe
@version June 6th, 2014
*/
import java.io.*;
import java.util.Scanner;
@matthewshawnkehoe
matthewshawnkehoe / RiemannSiegel.java
Last active April 17, 2019 06:37
RiemannSiegel.java
/**************************************************************************
**
** Riemann-Siegel Formula for roots of Zeta(s) on critical line.
**
**************************************************************************
** Matthew Kehoe
** 07/31/2015
**
** This program finds the roots of Zeta(s) using the well known Riemann-
** Siegel formula. The RiemannSiegel theta function is approximated
@matthewshawnkehoe
matthewshawnkehoe / CoffeeCalculator.java
Created September 27, 2015 05:30
CoffeeCalculator.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CoffeeCalculator
{
public static void main(String [] args)
{
NewFrame coffee = new NewFrame("Delicious Coffee Calculator");
coffee.pack();