Homework 5: Least Squares

Voltage smoothing. We would like to send a sequence of voltage inputs to the manipulator arm of a robot. The desired signal is shown in the plot below (also available in voltages.csv). CS/ECE/ISyE 524 Introduction to Optimization Steve Wright, Spring 2021 The material has interesting nonlinear properties, and we would like to characterize the relationship…

Description

5/5 – (2 votes)
  1. Voltage smoothing. We would like to send a sequence of voltage inputs to the manipulator arm of a robot. The desired signal is shown in the plot below (also available in voltages.csv).

CS/ECE/ISyE 524 Introduction to Optimization Steve Wright, Spring 2021

The material has interesting nonlinear properties, and we would like to characterize the relationship between intensity and uorescence by using an approximate model that agrees well with the trend of our experimental data. Although there is noise in the data, we know from physics that the uorescence must be zero when the intensity is zero. This fact must be re ected in all of our models!

  1. Polynomial t. Find the best cubic polynomial t to the data. In other words, look for a function of the form y = a1x3 + a2x2 + a3x + a4 that has the best possible agreement with the data. Remember that the model should have (exactly) zero uorescence when the intensity is zero! Include a plot of the data along with your best- t cubic on the same axes.

  1. Spline t. Instead of using a single cubic polynomial, we will look for a t to the data using two quadratic polynomials. Speci cally, we want to nd coe cients pi and qi so that our data is well modeled by the piecewise quadratic function:

y =

(q1x2

+ q2x + q3

if 4

x < 10

p1x2

+ p2x + p3

if 0

x < 4

These quadratic functions must be designed so that:

  • as in the cubic model, there is zero uorescence when the intensity is zero.

  • both quadratic pieces have the same value at x = 4.

  • both quadratic pieces have the same slope at x = 4.

In other words, we are looking for a smooth piecewise quadratic. This is also known as a spline (this is just one type of spline, there are many other types). Include a plot of the data along with your best- t model.

  1. Hovercraft rendezvous. Alice and Bob are cruising on Lake Mendota in their hovercrafts. Each hovercraft has the following dynamics:

xt+1

= xt +

1

vt

3600

Dynamics of each hovercraft:

vt+1

= vt + ut

At time t (in seconds), xt 2 R2 is the position (in miles), vt 2 R2 is the velocity (in miles per hour), and ut 2 R2 is the thrust in normalized units. At t = 1, Alice has a speed of 20 mph going North, and Bob is located half a mile East of Alice, moving due East at 30 mph. Alice and Bob would like to rendezvous at exactly t = 60 seconds. The location where they meet is up to you.

  1. Find the sequence of thruster inputs for Alice (uA) and Bob (uB) that achieves a rendezvous at t = 60 while minimizing the total energy used by both hovercraft:

60

A

2

60

B

2

X

Xt

total energy =

ut

+

ut

t=1

=1

Plot the trajectories of each hovercraft to verify that they do indeed rendezvous.

  1. In addition to arriving at the same place at the same time, Alice and Bob should also make sure their velocity vectors match when they rendezvous (otherwise, they might crash!) Solve the rendezvous problem again with the additional velocity matching constraint and plot the resulting trajectories. Is the optimal rendezvous location di erent from the one found in the rst part?

2 of 2

Homework 5: Least Squares