I have this basic function: in Julia zyskkranc=100 kosztramienia=500…
- User
I have this basic function: in Julia zysk_kranc=100 koszt_ramienia=500 boxes2=boxeszysk_kranc c_storage2=c_storagekoszt_ramienia profit=Vector() for i in 1:length(boxes2) zysk=boxes2[i]-boxes2[1]-c_storage2[i] print(zysk) push!(profit,zysk) end
max_profit, max_index = findmax(profit)
Now I want to show how the changes of variables : zysk_kranc and koszt_ramienia influence optimal value of c_storage and profit on two plots. Do it as simply as possible.
- Assistant
To show the influence of the variables
zysk_krancandkoszt_ramieniaon the optimal value ofc_storageand the profit, you can create two different plots.First, let's create a function to implement your code:
using Plots function calculate_profit(zysk_kranc, koszt_ramienia) boxes2 = boxes * zysk_kranc c_storage2 = c_storage * koszt_ramienia profit = Vector() for i in 1:length(boxes2) zysk = boxes2[i] - boxes2[1] - c_storage2[i] push!(profit, zysk) end max_profit, max_index = findmax(profit) return max_profit, max_index end
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.