# Question:Newbie that can't even maximize a quadratic needs to solve a recursive (Bellman) vector equation

## Question:Newbie that can't even maximize a quadratic needs to solve a recursive (Bellman) vector equation

Maple 2016

So I needed a CAS, and I spent a couple of months trying to get a basic understanding of SymPy and various applications starting with "M". We have Maple version 2016.

My "prototype problem" can be solved by hand, and is a system of quadratic Bellman equations, for i=1,2.  I'll return to it below, as I am obviously too clumsy to get even the second-to-simplest max/min working.  Oh, and I can't even insert Maple Math here in the forum, it does not like maximize or minimize.

Let's start easy. I enter
maximize((b-x)x,x)
which works as I expect. Then already at
maximize((abs(b)-x)x,x>=0)
I am stuck. Please, sweet Maple, you know that the answer is the same as before, don't you? (In the meantime I have tried to feed it maximize((b-x)x,x=0..1)... )

I was hoping my "proper" problem should be doable. What I really need is a sequence of quadratic optimization problems, where I have a vector x maximizing b'x-x'Ax subject to linear constraints, so it should not be too hard.  The "prototype problem" I needed for starters, is a system where for i=1,2 I have

v_i(0,y)=0 and inductively v_i(t+1,y)=max{x_i*(b_i-x_1-x_2)+ r_i v_i(t,y-x)}

where b_i and r_i are constants, x=(x_1,x_2), y=(y_1,y_2), and everything is nonnegative - including, the choice variables x_i must be between 0 and min{y_i, b_i-x_1-x_2}. And I want to plot both functions and the x with time as a slider, but ... I don't think I'll ever get that far?

Sorry for whining. (I know why I dropped out of computer science.)

﻿