Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional to accept demand curve and cost function, return π max #14

Open
stevecondylios opened this issue Jul 10, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@stevecondylios
Copy link
Owner

A simple functional to accept a demand curve function, cost function, and return π max.

Experiment with including parameters for some 'degree' of π max (e.g. 30%, 60%, 90%) etc.

@stevecondylios
Copy link
Owner Author

stevecondylios commented Jul 10, 2020

Here's a simple example (in this example, we assume a constant cost function):

profit (π) qp - qc = q(p - c) ..........................................................................(1)

demand q = 200 - 20p ...................................................................................(2)

(2) into (1)

(200 - 20p)(p - c) = 200p - 200c - 20p^2 + 20pc ........................................................(3)

This gives profit for any given price

To find the price that maximises profit, take partial derivative w.r.t price:

 ∂π/∂p = 200 - 40p + 20c ...............................................................................(4)

We must provide the cost function, in this case we assume a constant cost function:

c = $4 .................................................................................................(5)

(5) into (4)

∂π/∂p = 200 - 40p + 80 = -40p + 280 ....................................................................(6)

Set to zero to optimise

-40p + 280 = 0

p = $7

Which is the profit maximising price for a given demand curve/equation and unit cost

Function should return pmax price, as well as π

@stevecondylios stevecondylios self-assigned this Jul 10, 2020
@stevecondylios stevecondylios added the enhancement New feature or request label Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant