bringing repo up to date

main
will king 3 years ago
parent 4719a8504c
commit e22fac4ce0

@ -0,0 +1,87 @@
<mxfile host="Electron" modified="2023-08-10T01:16:09.926Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.5 Chrome/114.0.5735.243 Electron/25.3.1 Safari/537.36" etag="ySVSO4vFxIwNG_GniQjf" version="21.6.5" type="device">
<diagram name="Page-1" id="1w1gsA99hJ9hG2iv5ZOv">
<mxGraphModel dx="1114" dy="843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="o47rVKH1999IgGybFU0q-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-7" target="o47rVKH1999IgGybFU0q-10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-21" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-7" target="o47rVKH1999IgGybFU0q-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-34" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=-0.012;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-7" target="o47rVKH1999IgGybFU0q-33">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-7" value="Environment State&lt;br&gt;&lt;ul&gt;&lt;li&gt;Each Constellation&#39;s&amp;nbsp; Size&lt;/li&gt;&lt;li&gt;Debris levels&lt;/li&gt;&lt;/ul&gt;" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;align=left;" vertex="1" parent="1">
<mxGeometry x="80" y="310" width="230" height="80" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-12" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-10" target="o47rVKH1999IgGybFU0q-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-22" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-13" target="o47rVKH1999IgGybFU0q-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-15" target="o47rVKH1999IgGybFU0q-24">
<mxGeometry relative="1" as="geometry">
<mxPoint x="140" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-15" value="Environmental Transition Function" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
<mxGeometry x="270" y="740" width="170" height="60" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-25" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-24" target="o47rVKH1999IgGybFU0q-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-24" value="Next Time Period" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="155" y="470" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-38" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="530" y="250" width="420" height="600" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-32" value="Operators&#39; Problem" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="o47rVKH1999IgGybFU0q-38">
<mxGeometry x="20.005" y="9.677419354838714" width="367.5" height="600.0000000000001" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-16" value="Profit" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="o47rVKH1999IgGybFU0q-32">
<mxGeometry x="32.49" y="490.32" width="157.5" height="59.68" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-40" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="o47rVKH1999IgGybFU0q-32" source="o47rVKH1999IgGybFU0q-13" target="o47rVKH1999IgGybFU0q-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-13" value="Decision:&amp;nbsp;&lt;br&gt;&lt;span style=&quot;background-color: initial;&quot;&gt;How many satellites to launch&lt;/span&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;align=center;" vertex="1" parent="o47rVKH1999IgGybFU0q-32">
<mxGeometry x="210.00166666666667" y="300.31967741935495" width="157.5" height="96.7741935483871" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-9" value="Operator&#39;s State&lt;br&gt;&lt;ul&gt;&lt;li&gt;Constellation Size&lt;/li&gt;&lt;li&gt;Total Competitors&#39; Mass&lt;/li&gt;&lt;li&gt;Debris&lt;/li&gt;&lt;/ul&gt;" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;align=left;" vertex="1" parent="o47rVKH1999IgGybFU0q-32">
<mxGeometry x="60.00000000000001" y="90.32723180795199" width="226.04166666666669" height="153.2651162790698" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-14" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="o47rVKH1999IgGybFU0q-32" source="o47rVKH1999IgGybFU0q-9" target="o47rVKH1999IgGybFU0q-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-41" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="o47rVKH1999IgGybFU0q-32" source="o47rVKH1999IgGybFU0q-9" target="o47rVKH1999IgGybFU0q-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-39" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-33" target="o47rVKH1999IgGybFU0q-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-43" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="370" y="240" width="170" height="350" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-10" value="Filter" style="triangle;whiteSpace=wrap;html=1;" vertex="1" parent="o47rVKH1999IgGybFU0q-43">
<mxGeometry x="80" y="70" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-33" value="Market Mechanism&lt;br&gt;sets&amp;nbsp; price" style="shape=card;whiteSpace=wrap;html=1;" vertex="1" parent="o47rVKH1999IgGybFU0q-43">
<mxGeometry x="40" y="190" width="80" height="100" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-42" value="Information Process" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="o47rVKH1999IgGybFU0q-43">
<mxGeometry width="170" height="350" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-45" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="o47rVKH1999IgGybFU0q-44" target="o47rVKH1999IgGybFU0q-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o47rVKH1999IgGybFU0q-44" value="Noise in Debris Generation" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;" vertex="1" parent="1">
<mxGeometry x="295" y="890" width="120" height="80" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

@ -56,3 +56,15 @@ The question it poses is "Should we use this resource as we best see fit or pres
## modelling state
I need to track all constellation sizes and debris size.
# Thoughts on Interpretation etc,
One option would be to take derivatives over the value function to get
Benefit functions. Look at when it is positive etc.
Another thing to do would be to construct debris tracks.
Another would be to search for steady states.
I could compare different versions of the social planner's problem to see
how they differ, i.e. in debris dynamics etc.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,144 @@
using LinearAlgebra
using Distributions
using StatsFuns
using Plots
function individual_loss(Sᵢ, S, D,n=1)
#=
This function simulates how many satellites will be lost
from a given constellation.
TODO: Requires calibration of some sort
=#
β₀ = 3e-5 #probability of spontaneous destruction
β₁ = 1e-6 #proability of collision with satellite in same constellation
β₂ = 1e-5 #probability of collision with satellite in different constellation
β₃ = 1e-4 #probability of collision with debris
#linear probability
p = β₀ + β₁ * Sᵢ + β₂ * (S-Sᵢ) + β₃ * D
dist = Binomial(Sᵢ, p)
rand(dist)
end
function debris_transition(D, Y⃗, X⃗, δ=0.05, Γ=0.5)
#δ: 1/δ year decay rate
#Γ: proportion of the mass of the satellite that is released into orbit during launch
#new debris released equals the debris lost to deorbit + debris generated by collisions + debris due to launches
new_debris = (1-δ) * D .+ sum(Y⃗) .+ Γ*sum(X⃗)
return new_debris
end
function stocks_transition(S⃗, Y⃗, X⃗)
return S⃗ .+ X⃗ .- Y⃗
end
function overall_losses(S⃗, D)
#=
Simulate the losses for each constellation
=#
[ individual_loss(s, sum(S⃗),D) for s in S⃗ ]
end
function inverse_demand_cournot(S⃗,A=100)
A - sum(S⃗)
end
function profit_function(s,x,C_operation,C_launch,T_launch, T_operation,Price)
(Price-T_operation-C_operation)*s - (C_launch + T_launch)*x
end
#Get histogram of loss numbers per 10_000
histogram(
[sum(individual_loss(33,67,500,10_000)) for i in 1:10000]
,bins=range(0,200,length=201)
,label="Satellites lost per 10,000"
)
#=
Basic simulations
1. What happens when both participants always launch a single satellite?
2. What happens when a single participant always launches a single satellite?
3. What happens when both participants maintain the cournot equilibrium?
=#
#First try
policy_1(s,S,D) = 1
function policy_2(s,S,D)
max(0,33-s)
end
function policy_3(s,S,D)
max(0,20-s)
end
#setup state
n=200#00
k=4
state = fill([10.0,1,0,10],n)
profit_path = []
for i in 2:n
current_state = state[i-1]
#current_state = state[1]
S⃗ = current_state[2:end]
D = current_state[1]
#Calculate policies
#X = [policy_2(s,sum(S⃗),D) for s in S⃗]
X = [2.0,2.0,policy_2(S⃗[3],0,0)]
#X = [policy_2(S⃗[1],sum(S⃗),D), policy_3(S⃗[2],sum(S⃗),D), ]
#Information generation
price = inverse_demand_cournot(S⃗,10000)
push!(profit_path,[profit_function(s,x,1,2,0, 0,price) for (s,x) in zip(S⃗,X) ])
#calculate transition to next state
#loss of satellites
Y⃗ = overall_losses(S⃗, D)
#debris
new_debris = debris_transition(D, Y⃗, X)
#stocks
new_stocks = stocks_transition(S⃗,Y⃗,X)
#update vector of states
next_state = [new_debris,new_stocks...]
#update vector
state[i] = next_state
println(current_state,next_state)
end
debris = [v[1] for v in state]
stocks1 = [v[2] for v in state]
stocks2 = [v[3] for v in state]
stocks3 = [v[4] for v in state]
plot(
[debris, stocks1, stocks2, stocks3]
,labels=["debris" "stocks 1" "stocks 2" "Stocks 3"]
)
profit_1 = [v[1] for v in profit_path]
profit_2 = [v[2] for v in profit_path]
profit_3 = [v[3] for v in profit_path]
plot(
[profit_1,profit_2,profit_3]
)
Loading…
Cancel
Save