ERROR: LoadError: UndefVarError: getValue not defined

I was trying to run the power system example to execute the economic load dispatch operation.

The original code was reported here.

However when I try to run this code (with the modifications to make the code compliant with the current version), I get the following error.

ERROR: LoadError: UndefVarError: getValue not defined
[1] solve_ed(::Array{Int64,1}, ::Array{Int64,1}, ::Array{Int64,1}, ::Int64, ::Int64, ::Int64) at c:\Users\prott\Documents\Julia_scripts\economic_dispatch.jl:57

Any help is appreciated. I am quite new to JuMP and Julia.

1 Like

First of all, welcome to our community! :confetti_ball:

getValue seems to be the name for a previous JuMP version, value is the current name for this function.


I replaced the getValue functions with value.

Now the new error is –

ERROR: LoadError: JuMP.value is not defined for collections of JuMP types. Use Julia’s broadcast syntax instead: JuMP.value.(x).

Any suggestions?

Did you try what the error told you?

1 Like

I just tried it …
Not much help .

The latest ERROR Message is

ERROR: LoadError: UndefVarError: getObjectiveValue not defined

The problem is that that code is for a very old version of JuMP. I you need to read the documentation for the new version and the new syntax at


Here is the updated tutorial: Jupyter Notebook Viewer


Yeah. I guess there’s no shortcut.

Shortcut to what? @odow just posted the updated version of the code. That seems pretty short to me.


Yeah. I just looked at it.

I meant … like I will actually need to read the documentation.

Thanks a lot.