In this video, we'll solve our simple example in LibreOffice.
Go ahead and open the spreadsheet,
IMRT_SimpleExample.
At the top of the spreadsheet, you should see our data.
For each beamlet and each voxel, we
have the dose that that beamlet gives
to that voxel at unit intensity.
So we have this data for voxel one, voxel two, voxel three,
all the way up to voxel nine.
Each row corresponds to one of the six beamlets.
This is the data that we saw on the slides
in the previous video.
Below the data, we've outlined our decision variables,
which are the intensities of the beamlets.
So for beamlets one through six, we have one decision variable.
These six decision variables are outlined in yellow.
Right now, the decision variable cells
are blank, because the values will be filled in by Solver.
Below the decision variables, we have our objective.
Our objective is to minimize the total dose to healthy tissue.
The healthy-tissue voxels are voxels one, three, five, six,
and nine.
So let's go ahead and build our objective in the blue cell
here.
So first, we want to add up the total dose
that each beamlet gives to voxel one.
So here we'll use the function that we
used in the previous lecture, sumproduct.
So type an equals sign, and then sumproduct,
and select all of the decision variables, semicolon, and then
all of the doses.
This will add up the total dose that beamlet one gives
to voxel one, plus the total dose beamlet two
gives to voxel one, plus the total dose
beamlet three gives to voxel one, etc.
Now we want to repeat this for voxels three, five, six,
and nine-- the other healthy-tissue voxels.
So go ahead and type a plus sign,
and then sumproduct, again, the six decision variables,
semicolon, and this time, select the dose data for voxel three.
Now let's repeat this again, but this time for voxel five.
So sumproduct, and then the decision
variables, and the dose data for voxel five.
Now for voxel six, sumproduct, the decision variables,
semicolon, and the dose data for voxel six.
And lastly, we're going to add the sumproduct of the decision
variables, semicolon, and then scroll over to voxel nine,
and select the dose data for voxel nine.
Close the parentheses, and hit Enter.
You should see that the objective has a 0 right now,
because none of our decision-variable values
are filled in.
When Solver fills in our decision variables,
our objective value will be here.
Below the objective is our constraints.
The first four constraints make sure that each voxel
of the tumor is getting a dose of at least 7.
The last constraint makes sure that the spinal cord
receives a dose of no more than 5.
Let's go ahead and construct our constraints.
For the first four constraints, the left-hand side
is going to be the total dose that that voxel of the tumor
gets.
So for voxel two, we have the left-hand side
is equal to the sumproduct of the decision
variables, semicolon, and then the data for voxel two.
Close the parentheses, and hit Enter.
We want to make sure that this value is
greater than or equal to 7.
Now let's repeat this for voxel four.
So equals sumproduct, and then, in parentheses,
select the decision variables, semicolon,
and the data for voxel four.
Again, we also want this one to be greater than or equal to 7.
Now let's repeat this for voxel seven.
So sumproduct of the decision variables, semicolon, and then
the data for voxel seven, again, greater than or equal to 7.
And lastly, for voxel eight, we want the sumproduct
of the decision variables, and the data for voxel eight
this time to also be greater than or equal to 7.
And our last constraint, we want to make sure
that the total dose to voxel five,
the spinal cord voxel-- so sumproduct
of the decision variables, and then the data for voxel five,
is less than or equal to 5.
The remaining constraints we have
are the non-negativity constraints,
which we'll add in directly in the Solver.
So now go ahead and go to the Tools menu, and select Solver.
The Solver window should pop up.
First we need to tell Solver what our objective is.
So go ahead and delete what's in "Target cell",
and making sure that your cursor is in "Target cell",
select the blue objective cell.
Now, we want to change "Maximum" to "Minimum", because we're
trying to minimize the total dose to healthy tissue,
and our decision variables should be the six yellow cells.
Now let's add in our constraints.
So in the first "Cell reference" box,
let's select the first four constraints.
Because they're all greater than or equal to constraints,
we can add them in together.
And change the "Operator" to greater than or equal to,
and then in "Value", select the four right-hand sides.
Now let's add in the spinal-cord constraint.
So in the next "Cell reference" box,
select the spinal cord left-hand side,
make sure that "Operator" is less than
or equal to, and in the second "Value" box,
select the spinal cord, right-hand side.
Now let's add our non-negativity constraints.
So in the "Cell reference", just directly pick the six decision
variables, and make sure the "Operator"
is greater than or equal to, and the "Value" should just be 0.
Now, in the Options, make sure you've
selected the Linear Solver, and click OK.
Now go ahead and hit Solve.
You should see a solving result that
says: "Solving successfully finished.
Result: 22.75".
That's the optimal objective function value.
Go ahead and select Keep Result.
Now let's take a look at our solution.
So the optimal solution is to have
beamlet one at an intensity 2.25,
beamlet two at an intensity of 0,
beamlet three at an intensity of 3,
beamlet four at an intensity of 3.5,
beamlet five at an intensity of 2.5,
and beamlet six at an intensity of 0.
This makes sense, because beamlet two goes
across the spinal cord, and beamlet six only
goes down healthy-tissue voxels.
And if we look at our constraints,
we can double-check that each tumor voxel is receiving a dose
of at least 7 -- one tumor voxel gets a dose of 8 --
and the spinal cord is receiving a dose of 5,
which is the maximum possible dose.
In the next video, we'll see an example of a real problem,
and how big the problem is on an actual tumor case.