Week 4 and 5

This commit is contained in:
Aidan Sharpe 2025-02-24 22:16:41 -05:00
parent e95865b7e3
commit 9b4f36ab47
99 changed files with 117460 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@ -0,0 +1,35 @@
---
title: BIOL01113 Vocabulary Assignment 4
author: Aidan Sharpe
geometry: margin=1in
---
# Atrium
A chamber in the heart that receives blood from veins.
# Ventricle
A chamber in the heart that pumps blood into arteries.
# Artery
A large blood vessel that carries blood away from the heart.
# Vein
A large blood vessel that carries blood towards the heart.
# Capillary
A narrow blood vessel that carries blood to and from individual cells.
# Systemic circuit
The main cardiovascular circuit that transports blood to and from most of the body.
# Pulmonary circuit
The cardiovascular circuit that transports blood to and from the lungs.
# Erythrocytes
Cells that are specialized to transport oxygen and carbon dioxide.
# Leucocytes
Immune cells also known as white blood cells.
# Platelets
One of the major components of blood responsible for creating clots and stopping bleeding.

View File

@ -0,0 +1,36 @@
---
title: BIOL01113 Vocab 5
author: Aidan Sharpe
date: February 24th, 2025
geometry: margin=1in
---
# Lymph Vessels
Lymphatic system structures that transport interstitial fluid called lymph.
# Lymph Nodes
Lymphatic system structures that collect and disinfect lymph.
# Spleen
A large secondary lymphatic organ responsible for storing and purifying blood.
# Thymus
A primary lymphatic organ responsible for maturing T cells and stimulates immune cells.
# B Cells
A type of immune cell responsible for antibody-mediated immunity, which targets free antigens present in bodily fluids.
# T Cells
A type of immune cell responsible for cell-mediated immunity, meaning any cells with a detected antigen are destroyed.
# Inflammation
An immune response that employs neutrophils and macrophages to surround and kill pathogens.
# Complement
A series of proteins in plasma that form a non-specific defense mechanism that complements the antibody response.
# Antibody
A protein produced in response to a specific antigen.
# Clonal Selection
Since B-cell receptors (BCRs) only bind one specific type of antigen, B cells produce multiple identical copies of themselves to create more cells that can bind to the same antigen.

View File

@ -0,0 +1,14 @@
---
title: Interview Experience
author: Aidan Sharpe
date: February 17th, 2025
geometry: margin=1in
---
I have found that there is only so much you can do to prepare for a technical interview, at least in the short term. Of course, maintaining fundamentals is always helpful. When it comes to behavioral interviews, there is much more preparation work to be done. In behavioral interviews, the most important aspect is simply raw interview skills, and the best way to get good at interviewing is through practice. When I was preparing for interviews this Fall, I asked my Aunt, who conducts behavioral interviews as part of her job, if we could set up a mock interview, and she happily agreed. Importantly, at the end, I asked for feedback and took notes.
In addition to being prepared for the act of interviewing, it is important to come in knowledgeable about the position you are interviewing for. For example, when I was interviewing for a job at SpaceX, I researched the different projects associated with that job. Fortunately, with SpaceX being a company in the public spotlight, there were multiple Wikipedia articles about the projects that proved to be valuable resources.
When it actually came to the beavioral interviews, I was glad that I did my research, because it helped me answer questions like "why do you want to work here?" and "what skills do you think you can bring to this role?" with details more specific to the company and role.
When it comes to technical interviews, however, it is important to take your time and carefully explain your thought process. Most of the time, as long as you have sound reasoning and show significant understanding, it does not matter if you get the exact correct answer.

View File

@ -0,0 +1,36 @@
---
title: ECE09488 Chapter 2 Questions
author: Aidan Sharpe
date: February 20th, 2025
geometry: margin=1in
---
### 1. Which of the following functions most like a typical operating system?
a. Type 1 hypervisor
### 2. Which rule would ensure two VMs are always hosted on different physical machines?
c. Required anti-affinity rule
### 3. What CSP cost-saving strategy can you overcome by using a dedicated host?
b. Overcommitment
### 4. Which driver type will likely provide the most functionality for a device
b. Vendor
### 5. Which is largest?
b. GiB (Gibibyte)
### 6. What resource can provide file access to several containers over a long period of time?
d. Persistent storage
### 7. Which technology enables a CPU core to function as two threads?
c. SMT
### 8. Where does an AWS VM instance find its OS files?
a. AMI
### 9. Which technique enables a client service to adjust its rate of requests to accommodate service overload?
b. Concurrency control
### 10. What kind of service do you need to store and access container images?
d. Repository

View File

Before

Width:  |  Height:  |  Size: 538 KiB

After

Width:  |  Height:  |  Size: 538 KiB

View File

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

View File

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

View File

@ -0,0 +1,7 @@
@online{All3DP,
title = {3D Printing Tolerances: How to Test & Improve Them},
author = {Ofir Galiki and Hironori Kondo and Zachary Wilson},
year = 2023,
url = {https://all3dp.com/2/3d-printing-tolerances-test-fdm/},
urldate = {2025-02-18}
}

View File

@ -0,0 +1,60 @@
---
title: Project 1C - Traffic Light Enclosure
subtitle: Rapid Prototyping & Fabrication
author:
- Aidan Sharpe (916373346)
- Michelle Frolio
- Karl Dyer
date: February 3rd, 2025
geometry: margin=1in
bibliography: citations.bib
output:
pdf_document:
md_extension: native_numbering
---
\newpage
## Introduction
The purpose of this project was to construct an enclosure for the previously protoboarded circuit. The circuit board has three LEDs aranged in a line, resembling a traffic light. Additionally, the protoboard has a 1x6 right angle pin header with 100 mil pitch at the base. These pins are to be connected to a breadboard. The purpose of the enclosure is to protect the electronics from the outside environment and give it a more "finished" look.
## Requirements
1. Enclosure must have two pieces
2. Enclosure must achieve an IP20 rating
3. LEDs and header pins must extend through case walls
4. All screws must fasten to heat set inserts
5. Two halves must mate mechanically
## Procedure
First, we created a low-resolution mockup of the protoboard, with its most prominent features present. This was done in ECAD with standard component libaries to ensure proper sizing. The board edges were also measured, and the final PCB was exported as a STEP file for use in MCAD. This model is seen in the figure below:
![](stripboard.png)
Next, the enclosure front was built up around the model with 25 mil gaps on all sides of the board except the edge with pins to add some wiggle room for the PCB. This shape was extruded vertically, both above and below the board to create the walls of the enclosure. Then the top face was added, using the protoboard model as a guide to cut holes for the LEDs to poke through. Finally, another body, the back panel, was added. This panel adds both a back to the enclosure, further protecting the electronics, and internal support for the PCB to restrict its motion inside the enclosure. Grooves and tabs were added to the front and back pieces respectively to allow them to slide together. The final model is seen in the figure below:
![](exploded.png)
Once the model was done, we exported the two bodies as STL files, and sliced them using Orca Slicer. The sliced gemetries are seen below:
![](slicer.png)
The two parts, fresh off the 3D printer are seen below:
![](inside-iso.png)
We assembeled the two halves in a final test fit. First, we tested the board fit, as seen below:
![](board-inside.png)
We had used a 20mil (~0.5mm) tolerance for the sliding fit [@All3DP]. The final fit was loose, but still acceptable. The fully assembled case with board inside is seen below:
![](front-iso.png)
Plugging it in, we can confim that the circuitry still works, and the pins are able to plug fully into the breadboard still, as seen below:
![](lit.png)
## Reflection
Initially, we planned for the top of the enclosure to slide with dovetail-like joints into the bottom half. That way, when the board slid in with the top, it would fall into a pocket, securing the enclosure together. Unfortunately, this design made the pins less accessable, since the board had to be surrounded on all four edges. Fortunately, this was easily remidied, since the design could be easily modified. Speaking of ease of modification, using realtive measurements proved to be highly valuable. Going back and making changes was very simple this way. Additionally, we learned that doing small test prints was very helpful for testing fit, to see if dimensions had to be made smaller or larger. Finally, we learned that using ECAD and MCAD tools together, to combine their strenths, is super useful. Using ECAD to make the PCB model with standard library parts was way faster than measuring all the dimensions of the parts on the board.
## References

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 255 KiB

View File

@ -0,0 +1,83 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "All Layers",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "stripboard.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
{
"board": {
"active_layer": 44,
"active_layer_preset": "All Layers",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "stripboard.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@ -0,0 +1,584 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"apply_defaults_to_fp_fields": false,
"apply_defaults_to_fp_shapes": false,
"apply_defaults_to_fp_text": false,
"board_outline_line_width": 0.05,
"copper_line_width": 0.2,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.05,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.1,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.1,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.1,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.1,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.5
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_symbol_mismatch": "warning",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"holes_co_located": "warning",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.0,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.5,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.2,
"min_microvia_drill": 0.1,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.0,
"min_text_height": 0.8,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.0,
"min_via_annular_width": 0.1,
"min_via_diameter": 0.5,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [],
"tuning_pattern_settings": {
"diff_pair_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 1.0
},
"diff_pair_skew_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
},
"single_track_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
}
},
"via_dimensions": [],
"zones_allow_external_fillets": false
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "stripboard.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.2,
"via_diameter": 0.6,
"via_drill": 0.3,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "stripboard-elise.step",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"page_layout_descr_file": "",
"plot_directory": "",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"b07b8b77-96cd-47e3-b56d-cf4f70498dad",
"Root"
]
],
"text_variables": {}
}

View File

@ -0,0 +1,791 @@
(kicad_sch
(version 20231120)
(generator "eeschema")
(generator_version "8.0")
(uuid "b07b8b77-96cd-47e3-b56d-cf4f70498dad")
(paper "A4")
(lib_symbols
(symbol "Connector:Conn_01x06_Pin"
(pin_names
(offset 1.016) hide)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(property "Reference" "J"
(at 0 7.62 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "Conn_01x06_Pin"
(at 0 -10.16 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" ""
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Generic connector, single row, 01x06, script generated"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_locked" ""
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "ki_keywords" "connector"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_fp_filters" "Connector*:*_1x??_*"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(symbol "Conn_01x06_Pin_1_1"
(polyline
(pts
(xy 1.27 -7.62) (xy 0.8636 -7.62)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 -5.08) (xy 0.8636 -5.08)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 -2.54) (xy 0.8636 -2.54)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 0) (xy 0.8636 0)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 2.54) (xy 0.8636 2.54)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 5.08) (xy 0.8636 5.08)
)
(stroke
(width 0.1524)
(type default)
)
(fill
(type none)
)
)
(rectangle
(start 0.8636 -7.493)
(end 0 -7.747)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(rectangle
(start 0.8636 -4.953)
(end 0 -5.207)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(rectangle
(start 0.8636 -2.413)
(end 0 -2.667)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(rectangle
(start 0.8636 0.127)
(end 0 -0.127)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(rectangle
(start 0.8636 2.667)
(end 0 2.413)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(rectangle
(start 0.8636 5.207)
(end 0 4.953)
(stroke
(width 0.1524)
(type default)
)
(fill
(type outline)
)
)
(pin passive line
(at 5.08 5.08 180)
(length 3.81)
(name "Pin_1"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "1"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 5.08 2.54 180)
(length 3.81)
(name "Pin_2"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "2"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 5.08 0 180)
(length 3.81)
(name "Pin_3"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "3"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 5.08 -2.54 180)
(length 3.81)
(name "Pin_4"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "4"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 5.08 -5.08 180)
(length 3.81)
(name "Pin_5"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "5"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 5.08 -7.62 180)
(length 3.81)
(name "Pin_6"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "6"
(effects
(font
(size 1.27 1.27)
)
)
)
)
)
)
(symbol "Device:LED"
(pin_numbers hide)
(pin_names
(offset 1.016) hide)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(property "Reference" "D"
(at 0 2.54 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "LED"
(at 0 -2.54 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" ""
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Light emitting diode"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_keywords" "LED diode"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_fp_filters" "LED* LED_SMD:* LED_THT:*"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(symbol "LED_0_1"
(polyline
(pts
(xy -1.27 -1.27) (xy -1.27 1.27)
)
(stroke
(width 0.254)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy -1.27 0) (xy 1.27 0)
)
(stroke
(width 0)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy 1.27 -1.27) (xy 1.27 1.27) (xy -1.27 0) (xy 1.27 -1.27)
)
(stroke
(width 0.254)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy -3.048 -0.762) (xy -4.572 -2.286) (xy -3.81 -2.286) (xy -4.572 -2.286) (xy -4.572 -1.524)
)
(stroke
(width 0)
(type default)
)
(fill
(type none)
)
)
(polyline
(pts
(xy -1.778 -0.762) (xy -3.302 -2.286) (xy -2.54 -2.286) (xy -3.302 -2.286) (xy -3.302 -1.524)
)
(stroke
(width 0)
(type default)
)
(fill
(type none)
)
)
)
(symbol "LED_1_1"
(pin passive line
(at -3.81 0 0)
(length 2.54)
(name "K"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "1"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 3.81 0 180)
(length 2.54)
(name "A"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "2"
(effects
(font
(size 1.27 1.27)
)
)
)
)
)
)
)
(symbol
(lib_id "Device:LED")
(at 142.24 63.5 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "0b56fffc-a285-46d6-ad5e-680b3a30a464")
(property "Reference" "D1"
(at 140.6525 57.15 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "LED"
(at 140.6525 59.69 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" "LED_THT:LED_D5.0mm"
(at 142.24 63.5 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 142.24 63.5 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Light emitting diode"
(at 142.24 63.5 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "359e0e1e-6ace-434c-80b3-ca76a5d37232")
)
(pin "2"
(uuid "cba29ca0-5113-47fb-a9c8-70be913ec824")
)
(instances
(project ""
(path "/b07b8b77-96cd-47e3-b56d-cf4f70498dad"
(reference "D1")
(unit 1)
)
)
)
)
(symbol
(lib_id "Connector:Conn_01x06_Pin")
(at 171.45 76.2 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "498ba333-ad71-490d-ad4f-6b20d72ef8cf")
(property "Reference" "J1"
(at 172.085 66.04 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "Conn_01x06_Pin"
(at 172.085 68.58 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Horizontal"
(at 171.45 76.2 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 171.45 76.2 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Generic connector, single row, 01x06, script generated"
(at 171.45 76.2 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "6"
(uuid "672c6ff4-f81c-401f-a696-2f3e030ffc47")
)
(pin "5"
(uuid "8c7c95ef-c386-4189-ab5f-c7d4e7282209")
)
(pin "1"
(uuid "109861d7-9c4f-44b7-8bd2-dfb57665023d")
)
(pin "4"
(uuid "9b5cb3ba-8af1-48f2-be96-25030fe5d6ac")
)
(pin "3"
(uuid "e7861a0b-3c86-4194-beaf-b57fb8fb1295")
)
(pin "2"
(uuid "27d82d81-bd88-4c85-9cb7-54c9277c44e6")
)
(instances
(project ""
(path "/b07b8b77-96cd-47e3-b56d-cf4f70498dad"
(reference "J1")
(unit 1)
)
)
)
)
(symbol
(lib_id "Device:LED")
(at 142.24 77.47 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "60ad0fd4-1e32-4c9e-b020-aa413e7e8b5a")
(property "Reference" "D2"
(at 140.6525 71.12 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "LED"
(at 140.6525 73.66 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" "LED_THT:LED_D5.0mm"
(at 142.24 77.47 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 142.24 77.47 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Light emitting diode"
(at 142.24 77.47 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "8729d143-41b3-4d0a-8e7d-ab7067b06fb3")
)
(pin "2"
(uuid "b04b0eb0-a0df-40a4-ac9e-6d3bc8edea8e")
)
(instances
(project "stripboard"
(path "/b07b8b77-96cd-47e3-b56d-cf4f70498dad"
(reference "D2")
(unit 1)
)
)
)
)
(symbol
(lib_id "Device:LED")
(at 142.24 90.17 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "90c967ef-4ea0-4dbd-8b14-f2cf9fe37978")
(property "Reference" "D3"
(at 140.6525 83.82 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Value" "LED"
(at 140.6525 86.36 0)
(effects
(font
(size 1.27 1.27)
)
)
)
(property "Footprint" "LED_THT:LED_D5.0mm"
(at 142.24 90.17 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 142.24 90.17 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" "Light emitting diode"
(at 142.24 90.17 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "7b4a6701-b43f-446d-bb79-f45a6ed61432")
)
(pin "2"
(uuid "c07bd06a-275f-433f-b855-136cd5185c30")
)
(instances
(project "stripboard"
(path "/b07b8b77-96cd-47e3-b56d-cf4f70498dad"
(reference "D3")
(unit 1)
)
)
)
)
(sheet_instances
(path "/"
(page "1")
)
)
)

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -16,7 +16,7 @@ def pressure(altitude):
if altitude > 25000:
kpa = 2.488 * ((T+273.1)/216.6)**(-11.388)
elif altitude > 11000:
kpa = 22.65 * np.exp(1.73 - 0.000157*alititude)
kpa = 22.65 * np.exp(1.73 - 0.000157*altitude)
else:
kpa = 101.29 * ((T+273.1)/288.08)**5.256
return 1000*kpa

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

@ -1,4 +1,4 @@
import atmospheric_model as atmos
import atmosphere as atmos
import axial_drag
import numpy as np
import matplotlib.pyplot as plt

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,45 @@
import numpy as np
import matplotlib.pyplot as plt
TARGET_RANGE = 20E3
MIN_RANGE = 2E3
MIN_DELAY = 5
T_HOMING = 8
V_MISSILE = 700
def depth_of_fire(target_range, min_range, t_homing, v_target, v_missile):
t_engagement = (target_range - min_range) / v_target
t_flight = target_range / (v_missile + v_target)
return (t_engagement + t_flight)/t_homing
def launch_delay(t_homing, v_missile, v_target):
return t_homing*(1 + v_target/v_missile)
def main():
# Range of target speeds from 0 to 1200 (inclusive)
v_target = np.arange(1200+1)
# Delta T_L for each target speed
t_L = launch_delay(T_HOMING, V_MISSILE, v_target)
plt.plot(v_target, t_L, label=r"$\Delta T_L$")
plt.hlines(0, v_target[-1], MIN_DELAY, label=r"$\Delta T_{L_\text{min}}$", color='r')
plt.legend()
plt.savefig("launch-delay.png")
plt.show()
dof = depth_of_fire(TARGET_RANGE, MIN_RANGE, T_HOMING, v_target, V_MISSILE)
print("DOF for V_T=200:", depth_of_fire(TARGET_RANGE, MIN_RANGE, T_HOMING, 200, V_MISSILE))
plt.plot(v_target, dof, label="Depth of Fire")
plt.savefig("depth-of-fire.png")
plt.show()
if __name__ == "__main__":
main()

View File

@ -0,0 +1,73 @@
---
title: Weapon Systems Homework 3
author: Aidan Sharpe
date: February 17th, 2025
geometry: margin=1in
---
# 1. Rocket Motor Equation
```python
def specific_impulse(v_burnout, w_launch, w_burnout):
return v_burnout / (g*np.log(w_launch/w_burnout))
def main():
v_burnout = 1000
w_rocket = 300
w_propellant_0 = 800
w_lauch = w_rocket + w_propellant_0
I_sp = specific_impulse(v_burnout, w_lauch, w_rocket)
v_exit = I_sp * g
print("I_sp:", I_sp)
print("V_e:", v_exit)
# Assume constant weight flow rate
a_burnout = 18*g
weight_flow_rate = a_burnout*w_rocket/v_exit
dt = 0.1
t = np.arange(0, 12, dt)
w_propellant = w_propellant_0 - weight_flow_rate*t
w_propellant = np.maximum(w_propellant, 0)
thrust = weight_flow_rate*v_exit/g
w_total = w_rocket + w_propellant
# Acceleration in g is force/weight
acceleration_g = thrust/w_total
v_no_gravity = np.cumsum(acceleration_g*g)
v_gravity_45_x = v_no_gravity*np.cos(np.pi/4)
v_gravity_45_y = v_no_gravity*np.sin(np.pi/4) - np.cumsum(g*np.ones_like(acceleration_g))
v_gravity_45 = np.sqrt(v_gravity_45_x**2 + v_gravity_45_y**2)
```
$I_{SP} = 78.46$
$V_e = 769.66$
![](rocket_motor.png)
# 2. Projectile with Attack Angle
I have been re-writing the math from the cannonball exercise to make it easier to expand in the future. For this reason, I am still working on my simulation routine:
```python
def simulate(mass, position, velocity, acceleration, attack_angle):
altitude = position[1]
speed = np.linalg.norm(velocity, 2)
Mach = atmosphere.Mach(altitude, speed)
axial_drag = np.array([-axial_drag.CA(Mach), 0])
dynamic_pressure = atmosphere.dynamic_pressure(altitude, velocity)
elevation = np.atan(velocity[1]/velocity[0]) + attack_angle
gravity = mass*g*np.array([np.cos(-angle-np.pi/2), np.sin(-angle-np.pi/2)])
normal_force = np.zeros(2)
normal_force[1] = TARGET_ACCEL - np.linalg.norm(axial_drag + gravity, 2)
```

View File

@ -0,0 +1,14 @@
import numpy as np
import matplotlib.pyplot as plt
def main():
if __name__ == "__main__":
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,101 @@
---
title: Lecture 5 Homework
author: Aidan Sharpe
date: February 24th, 2025
geometry: margin=1in
---
### 1.1 What are the individual principles used to create a balanced weapon system?
The weapon system should be robust, simple, and predictable.
### 1.2 Name three of the measures of weapon effectiveness.
Weapon systems may be measured in terms of circular error probability ($\text{CEP}_\text{XX}$), probability of mission kill ($P_\text{MK}$), probability of guidance ($P_G$), and probability of hit, damage, or kill ($P_H$, $P_D$, $P_K$).
### 1.3 Is the ENU coordinate system in invariant?
No, because all three directions (East, North, and up) are dependent on where on the surface you are.
### 1.4 Assume only one illuminator and one launcher in the combat system, what two limitations of the combat system determine the depth of fire?
With only one illuminator, only one semi-active missle can be supported at a time. With only one launcher, the time between firings is limited by the the launchers minimum time between missile launches ($\Delta T_{L_\text{min}}$).
### 1.5 What are the two main philosophies in weapon scheduling? How are they different?
#### Quickdraw
Shoot early and often to maximize the number of shot opportunities.
#### Sharpshooter
Maximize the performance of every shot by trading firing rate for shot quality.
### 2.1 Delay between missile launches ($\Delta T_L$)
$$\Delta T_L = T_H \left(1 + \frac{v_t}{v_m}\right)$$
```python
import numpy as np
import matplotlib.pyplot as plt
MIN_DELAY = 5
T_HOMING = 8
V_MISSILE = 700
def launch_delay(t_homing, v_missile, v_target):
return t_homing*(1 + v_target/v_missile)
def main():
# Range of target speeds from 0 to 1200 (inclusive)
v_target = np.arange(1200+1)
# Delta T_L for each target speed
delays = launch_delay(T_HOMING, V_MISSILE, v_target)
plt.plot(v_target, delays, label=r"$\Delta T_L$")
plt.hlines(0, v_target[-1], MIN_DELAY,
label=r"$\Delta T_{L_\text{min}}$", color='r')
plt.legend()
plt.savefig("launch-delay.png")
plt.show()
```
![](./launch-delay.png)
Since the homing time is longer than the minimum time between missile launches, there is no such target speed where $\Delta T_{L_\text{Min}} = \Delta T_L$.
### 2.2 Depth of Fire
$$\text{TET} = \frac{\text{ROF} - R_\text{min}}{V_T}$$
$$\text{TOF}_1 = \frac{\text{ROF}}{V_M + V_T}$$
$$\text{DOF} = \frac{\text{TET} + \text{TOF}_1}{T_H} + 1$$
```python
import numpy as np
import matplotlib.pyplot as plt
TARGET_RANGE = 20E3
MIN_RANGE = 2E3
MIN_DELAY = 5
T_HOMING = 8
V_MISSILE = 700
def depth_of_fire(target_range, min_range, t_homing, v_target, v_missile):
t_engagement = (target_range - min_range) / v_target
t_flight = target_range / (v_missile + v_target)
return (t_engagement + t_flight)/t_homing
def main():
# Range of target speeds from 0 to 1200 (inclusive)
v_target = np.arange(1200+1)
dof = depth_of_fire(TARGET_RANGE, MIN_RANGE, T_HOMING, v_target, V_MISSILE)
print("DOF for V_T=200:", depth_of_fire(TARGET_RANGE, \
MIN_RANGE, T_HOMING, 200, V_MISSILE))
plt.plot(v_target, dof, label="Depth of Fire")
plt.savefig("depth-of-fire.png")
plt.show()
```
![](./depth-of-fire.png)
DOF, where $V_T = 200$[m/s] is 14.0278 shots.

View File

@ -0,0 +1,73 @@
import numpy as np
import matplotlib.pyplot as plt
import axial_drag
import atmosphere
WEIGHT = 200
DIAMETER = 0.15
ATTACK_MAX = np.radians(40)
MAX_TIME = 100
T_s = 0.1
ANGLES = np.arange(10, 60+1, 5)
g = 9.81
TARGET_ACCEL = 30*g
def new_attack_angle(normal_force, dynamic_pressure, area):
C_N_alpha = 15
C_N = normal_force/(dynamic_pressure*area)
attack_angle = C_N_alpha / C_N
return min(attack_angle, ATTACK_MAX)
def simulate(mass, position, velocity, acceleration, attack_angle):
#altitude = position[1]
#speed = np.linalg.norm(velocity, 2)
#Mach = atmosphere.Mach(altitude, speed)
#axial_drag = np.array([-axial_drag.CA(Mach), 0])
#
#dynamic_pressure = atmosphere.dynamic_pressure(altitude, velocity)
#
#elevation = np.atan(velocity[1]/velocity[0]) + attack_angle
#gravity = mass*g*np.array([np.cos(-angle-np.pi/2), np.sin(-angle-np.pi/2)])
#
#normal_force = TARGET_ACCEL - np.linalg.norm(axial_drag + gravity, 2)
position += velocity*T_s + 0.5*acceleration*T_s**2
velocity += acceleration*T_s
return position, velocity, acceleration
def main():
t = np.arange(0, MAX_TIME, T_s)
speed = 600
accel = np.array([0, -g])
mass = 200
attack_angle = np.radians(40)
step = 1
t = np.arange(0, 100, T_s)
pos = np.zeros((len(t), 2))
vel = np.zeros_like(pos)
vel[0] = speed*np.array([np.cos(np.pi/4), np.sin(np.pi/4)])
while step < len(pos) and pos[step-1][1] >= 0:
vel[step] = vel[step-1] + accel*T_s
pos[step] = pos[step-1] + vel[step]*T_s + 0.5*accel*T_s**2
step += 1
plt.plot(t, pos[:,1])
plt.show()
if __name__ == "__main__":
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,66 @@
import numpy as np
import matplotlib.pyplot as plt
g = 9.81
# F = W*V_e / g
# I_SP = V_e / g
# V_burnout = 1000 = I_SP*G ln(W_L/W_BO)
def specific_impulse(v_burnout, w_launch, w_burnout):
return v_burnout / (g*np.log(w_launch/w_burnout))
def main():
plt.figure(figsize=(16,9))
v_burnout = 1000
w_rocket = 300
w_propellant_0 = 800
w_lauch = w_rocket + w_propellant_0
I_sp = specific_impulse(v_burnout, w_lauch, w_rocket)
v_exit = I_sp * g
print("I_sp:", I_sp)
print("V_e:", v_exit)
# Assume constant weight flow rate
a_burnout = 18*g
weight_flow_rate = a_burnout*w_rocket/v_exit
dt = 0.1
t = np.arange(0, 12, dt)
w_propellant = w_propellant_0 - weight_flow_rate*t
w_propellant = np.maximum(w_propellant, 0)
thrust = weight_flow_rate*v_exit/g
w_total = w_rocket + w_propellant
# Acceleration in g is force/weight
acceleration_g = thrust/w_total
v_no_gravity = np.cumsum(acceleration_g*g)
v_gravity_45_x = v_no_gravity*np.cos(np.pi/4)
v_gravity_45_y = v_no_gravity*np.sin(np.pi/4) - np.cumsum(g*np.ones_like(acceleration_g))
v_gravity_45 = np.sqrt(v_gravity_45_x**2 + v_gravity_45_y**2)
plt.subplot(411)
plt.plot(t, w_propellant)
plt.ylabel("Propellant weight [N]")
plt.subplot(412)
plt.plot(t, acceleration_g)
plt.ylabel("Acceleration [g]")
plt.subplot(413)
plt.plot(t, v_no_gravity)
plt.ylabel("Velocity w/o gravity [m/s]")
plt.subplot(414)
plt.plot(t, v_gravity_45)
plt.ylabel(r"Velocity w/ gravity [m/s]")
plt.xlabel("Time [s]")
plt.savefig("rocket_motor.png")
plt.show()
if __name__ == "__main__":
main()