I am trying to run the following program:

```
N = 100; x = [0:N];
m = 0.01;
alph = 1/50;
beta = 1;
gamma = 3;
rho = 0.5;
kappa = 1 - exp(-x.*alph);
cvx_begin
variables p(N+1,1)
maximize( m*(x*p) - (beta^rho)*((kappa*p)^(rho*gamma))*((kappa.^rho)*p) )
subject to
sum(p) <= 1;
p >= 0;
cvx_end
```

However I get an error message “Disciplined convex programming error:

Invalid quadratic form(s): not a square.”

This program is concave in that the Hessian is negative semidefinite, but I suspect the way I have written it is what’s causing the error. Can anyone help me rewrite it in a solvable format please?