Skip to content

Instantly share code, notes, and snippets.

clear;
clc;
RA = 0.1;
RB = 0.1;
Power = 50;
RO = (28^2)/Power;
@n7275
n7275 / heatOutput.m
Created January 16, 2024 21:10
NASSP Crew Heat Output
%Heat Output Data
function [heat,water] = heatOutput(temperature)
radiated = [4.351581809194265 162.4752545248869
5.004325259515571 157.88909313725492
7.3232822540781015 140.690987933635
8.30239742956006 134.54880750377075
@n7275
n7275 / TunnelDepressVelocity
Created August 14, 2023 20:06
Tunnel depress velocity
clear;
clc;
diameter = 32/12/3.28;
length = 20/12/3.28;
P = 1.0*6894.76;
mass1 = 60000/2.204;
mass2 = 30000/2.204;
#!/usr/bin/env python3
#***************************************************************************
# This file is part of Project Apollo - NASSP
#
# Copyright 2023 Matthew Hume
#
# Scenerio Update Utility
#
# Project Apollo is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@n7275
n7275 / RK4FlowRates.m
Last active March 1, 2023 21:40
RK4FlowRates
#Flow rate
clear;
clc;
size = 0.00500;
dt = .005;
Volume1 = 120;
Volume2 = 240;
mass = 300;
@n7275
n7275 / heater_ramp.m
Last active February 14, 2023 21:32
Heater Ramp Simulation
%Tank Heater
clear;
clc;
nominal_heat = 200; %Watts
ramp_rate = 10.0;
Dt = .1;
heat = 0;
@n7275
n7275 / VDWDensityCalc.m
Created January 31, 2023 19:22
VanDerWaalDensityCalculator
clear;
clc;
T = linspace(0,500,2000);
V1 = [];
V2 = [];
V3 = [];
R = 8.31446261815324E-2; #L.bar.K^-1.mol^-1
@n7275
n7275 / o2h2n2density.m
Last active April 18, 2023 01:43
N2, O2 and H2 density
clear;
clc;
#O2 and H2 density
O2Tcrit = 154.7;
H2Tcrit = 33.2;
N2crit = 126.2;
temp1 = linspace(0,O2Tcrit,75);
temp2 = linspace(O2Tcrit,500,100);
temp3 = linspace(0,H2Tcrit,15);
@n7275
n7275 / AgZnBatteryDischargeVoltage.m
Created January 10, 2023 20:35
AgZn Battery Discharge Voltage
function [V] = BatVoltage(ChargeLevel,MaxChargeVoltage)
## ChargeLevel = 0.0 -- 1.0
## MaxChargeVoltage, voltage when ChargeLevel == 1.0
V = (1.007921192669853 - 0.009537198357788667./(ChargeLevel+0.09727407714017093).^2).*MaxChargeVoltage;
end
@n7275
n7275 / ThreadPoolTest.cpp
Last active February 26, 2022 18:38
Better (but still broken) Thread Pool
#include <iostream>
#include <thread>
#include <vector>
#include <mutex>
#include <functional>
#include <cmath>
//simple test function to give the CPU something to do
void JobFunction(double dt) {
double dtTemp = 0;