Skip to content

Instantly share code, notes, and snippets.

@hbshrestha
Created September 22, 2021 15:12
Show Gist options
  • Save hbshrestha/0c1a3ce415a1fbcef6d1136e115ce13b to your computer and use it in GitHub Desktop.
Save hbshrestha/0c1a3ce415a1fbcef6d1136e115ce13b to your computer and use it in GitHub Desktop.
x=LinRange(0, 50, 100)
#Hours constraint for machine A
plot([x], [-1.5x .+ 33], label = "Machine A Constraint", color = "red")
plot!([0,22],[33,0], fillrange = 1, fillalpha = 0.05, fillcolor = "red", label = "")
#Optimal Product Strategy
scatter!([10],[18], marker = true,markercolor = "red", label = "", markersize = 7)
plot!([11,18],[19,25],arrow=true, color=:black,linewidth=2,label="")
annotate!(22, 27, text("Optimal Product Strategy",10))
#Hours constraint for machine B
plot!([x], [-2.25x .+ 45], label = "Machine B Constraint", color = "blue")
plot!([0, 20], [45,0], fillrange = 1, fillalpha = 0.05, fillcolor = "blue", label = "")
#Hours constraints for machine C
plot!([x], [-0.2x .+ 20], label = "Machine C Constraint", color = "green")
plot!([0, 100], [20,0], fillrange = 1, fillalpha = 0.05, color = "green", label = "")
#Set axis limits
plot!(xlims = (0,50), ylims = (0, 50))
#Indicate feasibility space
annotate!(8,10, "Feasibility \n Space")
julia_plot = plot!(xaxis = "Number of units of X produced",
yaxis = "Number of units of Y produced",
title = "Optimization of production")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment