text:
HP-41C HP-IL REMOTE & LOCAL commands
06-03-2018, 07:55 PM (This post was last modified: 06-03-2018 09:14 PM by Sylvain Cote.)
Post: #1
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
HP-41C HP-IL REMOTE & LOCAL commands
Hello,

I just spend several hours trying to understand why I was not able to successfully configure a HP-82164A RS-232 interface with a HP-41C while it was a walk in the park with a HP-71B.

The default configuration of the interface is: 9600 bauds, 8 bits, no parity, 1 stop bit, no protocol, no hardware handshake
My new configuration for the interface is: 4800 bauds, 8 bits, no parity, 1 stop bit, no protocol, no hardware handshake

In my test programs, I could have chosen to change the baud rate only, but I decided to set all the parameters just in case, anyway as you will see, that is not the issue here.

My HP-IL setup is: IL-Controller (71B/41C) <-> HP-82164A <-> back-to-IL-Controller
My RS232 setup is: HP-82164A <-> DB25-to-DB9-adapter <-> NULL-modem-adapter <-> DB9-to-USB-dongle <-> MacBookPro <-> Serial-macOS-Program (cfg: 4800,8,n,1)

The following three blocks was my starting point ...

HP-82164A remote commands subset (82164A OM Rem Cmd P.37 to P.40)
Code:
SB8;  // 1200 bauds SBA;  // 2400 bauds SBC;  // 4800 bauds SBE;  // 9600 bauds SW0;  // 8 bits P4;   // no parity SS0;  // 1 stop bit C0;   // no protocol SL0;  // use CTS(4), DCD(8) & DSR(6) SL2;  // use CTS(4) SL4;  // use DCD(8) SL6;  // use DSR(6) SL7;  // no hardware handshake

HP-71B program (working)
Code:
10 RESTORE IO 20 REMOTE :RS232 30 OUTPUT :RS232 ; "SBC;SW0;P4;SS0;C0;SL7;" 40 LOCAL 50 OUTPUT :RS232 ; "HELLO WORLD"

HP-41C program (<' means append) (not working)
Code:
01 LBL "CFG232" 02 AUTOIO 03 1   04 SELECT 05 REMOTE 06 "SBC;SW0;P4;" 07 <"SS0;C0;SL7;" 08 OUTA 09 LOCAL 10 "HELLO WORLD" 11 OUTA 12 END

When I ran the HP-71B program I saw the expected "HELLO WORLD" message on the terminal application but not so for the HP-41C.
I tried several configuration changes but to no avail, in the end I had no choice but to go into the low level stuff, the RAW HP-IL messages. 8-)

I changed my physical setup to a debugging one:

HP-IL setup: IL-Controller <-> PILBox#1 [pyilper --instance one with Scope] <-> HP-82164A <-> PILBox#2 [pyilper --instance two with Scope] <-> IL-Controller
RS232 setup: HP-82164A <-> DB25-to-DB9-adapter <-> NULL-modem-adapter <-> DB9-to-USB-dongle <-> MacBookPro <-> Serial-macOS-Program (cfg: 4800,8,n,1)

Then I traced the HP-IL messages and manually mapped them to their high level commands for both IL-Controllers (71B & 41C)
After that I compared both logs taking into account the small IL management differences between both IL-Controler and found why it was not working with the HP-41C.

This is what I have found:

HP-71B REMOTE command issue a HP-IL REN (Remote Enable) message (as expected)
HP-41C REMOTE command issue a HP-IL REN (Remote Enable) message (as expected)

HP-71B LOCAL command issue a HP-IL NRE (Not Remote Enable) message (as expected)
HP-41C LOCAL command issue a HP-IL GTL (Go To Local) message (totally unexpected for me)

I then checked the 82160A manual and it is correctly specified that the LOCAL command issue a GTL message, so the command works as specified.

After that I checked the 82164A manual and this is what I found:
Code:
There are two command messages that set the interface back into Local mode: Go To Local and Not Remote Enable.  Go To Local is a device specific command, which means that only devices that are currently listeners will respond to the message.  If your interface is a listener and it receives a Go To Local message, it changes back to Local mode.  Remember that your interface is still remote enabled, so if it becomes a listener again, it will then change back to Remote mode. The Not Remote Enable command not only puts the device back into Local mode, but it also disables the device from going back into Remote mode if it is made a listener.

Ha! Ha! This is why it was not working with the HP-41C.
Because the LOCAL command was not putting the interface in local mode for good (NRE) but only temporary (GTL), the next time it will receive data in listening mode, the interface will go back into remote mode and try to interpret the data as instructions instead of passing it through.

Here is the proof ...

LOCAL
Code:
AAU     RFC     AAD  1  // reconfiguring the loop LAD 01  RFC             // selecting 82164A as listener GTL     RFC             // tell 82164A to go into LOCAL mode temporary UNL     RFC             // unselecting 82164A as listener

'HELLO WORLD' OUTA
Code:
AAU     RFC     AAD  1  // reconfiguring the loop TAD 01  RFC             // selecting 82164A as talker SAI     DAB 42          // requesting its accessory ID UNT     RFC             // unselecting 82164A as talker AAU     RFC     AAD  1  // reconfiguring the loop LAD 01  RFC             // selecting 82164A as listener and at the same time going back into REMOTE mode 8-(                         // the following data (my "HELLO WORLD" message) is not passed through DAB 48  DAB 45  DAB 4C  DAB 4C  DAB 4F  DAB 20  DAB 57  DAB 4F  DAB 52  DAB 4C  DAB 44  DAB 0D  DAB 0A   UNL     RFC             // unselecting 82164A as listener

The only way I found to solve the issue is to use the NOTREM (Not Remote Enable) command from the 82183A Ext.I/O ROM module.

NOTREM
Code:
AAU     RFC     AAD  1  // reconfiguring the loop NRE     RFC             // telling every device in the loop to go back to local mode

HP-41C program (<' means append) (working)
Code:
01 LBL "CFG232" 02 AUTOIO 03 1   04 SELECT 05 REMOTE 06 "SBC;SW0;P4;" 07 <"SS0;C0;SL7;" 08 OUTA 09 NOTREM 10 "HELLO WORLD" 11 OUTA 12 END

Sylvain

Edit: changed the faulty 71B program from "40 LOCAL :RS232" to "40 LOCAL" (see the next post from Jean-François)
06-03-2018, 08:32 PM (This post was last modified: 06-03-2018 08:42 PM by J-F Garnier.)
Post: #2
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Sylvain,

Yes it was a common pitfall at the time.
The HP41 with the HPIL module only is unable to set the parameters of the HP82164, and also of the HP82165/166 GPIOs (that requires the use of DDL/DDT commands).
The extended I/O module was mandatory with these interfaces -unless using the default configuration.

I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.

When the remote/local were used to select between commands and data for interfaces, the same behavior was kept unfortunately.

To make the things even worst:
on the 71, "LOCAL" uses NRE (Not Remote Enable),
but "LOCAL :1" uses GTO (Goto Local) !
(same on the 75).
Your HP71 code should NOT work !

And there is also this LOCAL LOCKOUT command :-)

J-F
06-03-2018, 09:22 PM
Post: #3
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Jean-François,

(06-03-2018 08:32 PM)J-F Garnier Wrote:  I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.
When the remote/local were used to select between commands and data for interfaces, the same behavior was kept unfortunately.
This make a lot of sense.

(06-03-2018 08:32 PM)J-F Garnier Wrote:  Your HP71 code should NOT work !
You are right, in my program I only have LOCAL and not LOCAL :RS232, I probably did a copy/paste when I wrote the initial post (now corrected).
I was curious, I tested both variant and it did what you explained, the thing is that although I do not remember it, I surely knew this back in the 1980's.

Thanks for your precious information and for the error correction.

Best regards,

Sylvain
06-05-2018, 08:42 AM
Post: #4
 Garth Wilson Senior Member Posts: 341 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-03-2018 08:32 PM)J-F Garnier Wrote:  Hello Sylvain,

Yes it was a common pitfall at the time.
The HP41 with the HPIL module only is unable to set the parameters of the HP82164, and also of the HP82165/166 GPIOs (that requires the use of DDL/DDT commands).
The extended I/O module was mandatory with these interfaces -unless using the default configuration.

I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.

That's probably why I never had any trouble with it. My original purpose for getting the 41 and HP-IL in 1986 was to control IEEE-488 equipment on the workbench through the HP82169A HPIL-to-HPIB interface converter. The equipment consisted of things like signal generators, DMMs, and relay units, and they mostly had their own front-panel controls, so they could be used manually without external computer control, or under computer control for automated test setups. During program development, I might occasionally want to press the LOCAL button on one piece of equipment or another to check something by changing settings from the equipment's own front panel. I always used the 41 in MANIO (manual I/O address selection), because the HPIL-to-HPIB interface converter, although mostly transparent, did not have the autoaddressing like HP-IL does; so each piece of equipment on the IEEE-488 (HP-IB) had to be addressed with SELECT. There was no choice about that; and all of their addresses had to be above the number of things on HP-IL, and the interface converter had to be the last thing on the loop. Printer, mass storage, and anything else I had must come before the HP82196A.

I have the FSI164A which was almost identical to the HP82164A except that it came with two RS-232 channels standard, and up to eight if you paid extra, and could be powered with batteries. I originally used it to control an EPROM programmer, and later, interfaced to other things on the workbench. I don't remember ever having any problem with it, although I heard it has a bug with even parity (which I never tried).

Sylvain, I do find it a bit curious that you would use AUTOIO and then 1 SELECT.

06-06-2018, 12:28 AM (This post was last modified: 06-06-2018 12:33 AM by Sylvain Cote.)
Post: #5
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Garth,

(06-05-2018 08:42 AM)Garth Wilson Wrote:  Sylvain, I do find it a bit curious that you would use AUTOIO and then 1 SELECT.

My original intention was to use it as a loop continuity check, but as you will see, it does not add anything to the final solution.

Your question made me realize that I should have traced all the 82160A & 82183A functions long ago.
Actually I did it in the 1980s with the HP-IL Dev. ROM (MONITOR) when it became available.
Being completely away from the HP calculator world between 1989 and 2011 made me lose most of that deep knowledge.
I am slowly rebuilding it, but doing part time takes forever ...

As you will see, in this specific case, SELECT generate the same set of HP-IL messages as MANIO and AUTOIO commands.
It is special to see AUTOIO generating twice the same set of messages.
So here it is ... (for simplicity’s sake, I have not included IDY and ETO frames)

HP-41 Command Sequence
Code:
MANIO 1 SELECT AUTOIO 1 SELECT

MANIO
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

1 SELECT
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

AUTOIO
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC      AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

1 SELECT
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

Above HP-IL messages explanation
Code:
AAU     RFC     AAD  1  // loop reconfiguration TAD 01  RFC             // first device on the loop becomes the talker SAI     DAB 2E          // request accessory id from the talker LAD 01  RFC             // first device on the loop becomes a listener UNL     RFC             // deactivate listeners

Regards,

Sylvain
06-06-2018, 02:08 AM
Post: #6
 rprosperi Senior Member Posts: 3,153 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Those results are certainly unexpected!

I like your description of AUTOIO sending the identical sequence twice: "Special".

Initially I wondered if the sequence is sent twice due to possible latency in some of the early HP-IL devices, but then realized HP-IL is literally bit-serial, so failures replying (due to delays) to the initial sequence would hang the loop even on the first time around.

The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

In the end, did you find any practical difference in the loop behavior after setting the different modes?

--Bob Prosperi
06-06-2018, 03:01 AM
Post: #7
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 02:08 AM)rprosperi Wrote:  I like your description of AUTOIO sending the identical sequence twice: "Special".
Well, it's probably my fren-glish here, we have the same word in both languages but with potentially different usage.

(06-06-2018 02:08 AM)rprosperi Wrote:  In the end, did you find any practical difference in the loop behavior after setting the different modes?
I am just restarting to trace all the commands, but I expect to have some behavioural differences between manual and auto modes later on.
I will post traces here as I do them and I will create an article when it's complete enough.
Just be patient, these traces will be done when I have free time between the other projects that are themselves done in my personal free time, which I do not have in abundance.
06-06-2018, 07:43 AM
Post: #8
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 02:08 AM)rprosperi Wrote:  The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

There is a whole section about the auto and manual modes in the HP82160 manual (p.46 english ed.).

In the code from Sylvain, AUTOIO is not strictly mandatory (the code would run fine in MANIO), but I always advised to use AUTOIO unless there is a special need (°). SELECT is needed, to select the destination of OUTA. It could be omitted here if the interface is the first device but the general sequence is:
AUTOIO "HP82164" FINDID SELECT
and there would be a difference here between MANIO and AUTOIO if the 82164 is not the 1st device in the loop. The explanation is somehow hidden in the HP82160 manual, page 53 :-)

(°) One need (and the only real one I encountered) is to use the printer functions (PRA, PRP, LIST, ...) to print to a non-printer device such as the HP82166 GPIO/converter (or DOSLINK in ILPer).

J-F
06-06-2018, 01:04 PM
Post: #9
 rprosperi Senior Member Posts: 3,153 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 07:43 AM)J-F Garnier Wrote:
(06-06-2018 02:08 AM)rprosperi Wrote:  The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

There is a whole section about the auto and manual modes in the HP82160 manual (p.46 english ed.).

In the code from Sylvain, AUTOIO is not strictly mandatory (the code would run fine in MANIO), but I always advised to use AUTOIO unless there is a special need (°). SELECT is needed, to select the destination of OUTA. It could be omitted here if the interface is the first device but the general sequence is:
AUTOIO "HP82164" FINDID SELECT
and there would be a difference here between MANIO and AUTOIO if the 82164 is not the 1st device in the loop. The explanation is somehow hidden in the HP82160 manual, page 53 :-)

(°) One need (and the only real one I encountered) is to use the printer functions (PRA, PRP, LIST, ...) to print to a non-printer device such as the HP82166 GPIO/converter (or DOSLINK in ILPer).

J-F

Yes, that section does describe the modes clearly, at a high (operational) level, but nothing about how this occurs at lower (HP-IL frame) levels. When using more than simply 1 tape drive and 1 printer with the 41, I was always frustrated that there was no way to see what occurred at lower levels. Eventually I got the Devel ROM which provided a (frustrating to use) loop scope, but I had moved on to the 71b so never really pursued it enough to grasp it all.

As Sylvain suggests, a frame-by-frame breakdown of each high-level command is the best way to understand and use them, and I always thought such documentation should have been provided by HP, even if only in a separately purchased "advanced" manual or something similar.

Thinking more about the example above, the sequences likely would have differed if there were more than 1 device connected, but still I always thought things were more 'different' at lower levels.

Since I have a choice (for play) I'll stick with the 71b for HP-IL use.

--Bob Prosperi
06-07-2018, 12:40 PM
Post: #10
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 01:04 PM)rprosperi Wrote:  As Sylvain suggests, a frame-by-frame breakdown of each high-level command is the best way to understand and use them, and I always thought such documentation should have been provided by HP, even if only in a separately purchased "advanced" manual or something similar.
On the 41, the HP-IL is deliberately automated as much as possible, contrary to the 71 where you have a more precise control of the HP-IL.
First the loop addresses are re-assigned in almost all HP-IL commands so you can add/remove devices at any time, and everything will still work - on the 71 you have to do a RESTORE IO to re-assign the addresses.
Then, the HP41 checks for a printer almost every time it does something, to check for instance the trace mode on the 82162.
And, worst, if a printer is on the loop and in AUTOIO, the HP41 continuously emits IDY frames to check if the user pressed a key on the 82162 (even if that printer is not actually present).

So if you want to look at the low-level frames related to a high-level HP-IL command, I recommend to put the printer switch of the 82160 module in the disable position.

J-F
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)


text:
# Given price and number of pages of each book, What is the maximum number of pages you can buy?

You are in a book shop which sells n different books. You know the price and number of pages of each book.

You have decided that the total price of your purchases will be at most x. What is the maximum number of pages you can buy? You can buy each book at most once.

Example:

In:
4 10
4 8 5 3  //price
5 12 8 1 //pages
Out:
13
Explaination: You can buy books 1 and 3. Their price is 4+5=9 and the number of pages is 5+8=13

This is my recursive approach :

f(i,j) is max pages, when you can afford i units of money and j is the index in vector uptill the jth book. ie 0 to jth books are considered.

f(x, 0)=max( f(x-price[indx], indx+1) + pages[indx], f(x,indx+1) );

I am having difficulty making the base case, what should be the base case?

Thank you.

• This problem is known as Knapsack (en.wikipedia.org/wiki/Knapsack_problem). – Optidad Jun 20 '19 at 11:58
• Can you edit the question to explain your recursive equation? For example, explain the meaning of $f(x,y)$? How does the equation make sense? – John L. Jun 20 '19 at 18:16
• @Apass.Jack Edited. Anyways This is just the modified version of the Knapsack problem. – Het Jun 20 '19 at 18:43
• How does the recurrence equation make sense? Please explain as detailed as possible. I suspect that your equation is wrong since I cannot understand it. – John L. Jun 20 '19 at 19:10
• Sure, Although I had already figured it out. Accepted your answer, will be useful to others. – Het Jul 5 '19 at 18:15

I am afraid that the following recurrence equation as in the question is incorrect.

f(x, 0) = max( f(x-price[indx], indx+1) + pages[indx], f(x,indx+1) )

Let g(i,j) be the maximum number of pages possible when you have i units of money to spare and books 0..j available to select, where 0..j means 0, 1, ..., and j. (I use g instead of f since I am not absolutely sure of the definition of f in the question. It looks like g(i,j) should be the same as f(i,j) in the question. )

Here is the recurrence equation.

g(x, indx+1) = ( x >= price[indx+1] ) ?
max( g(x - price[indx+1], indx) + pages[indx+1], g(x,indx) ) :
g(x, indx)

In plain words, there are (at most) two possibilities when books 0..(indx+1) are available to select.

• Book indx+1 is selected (when x >= price[indx+1]). You have pages[indx+1] more pages.

Then you are left with x - price[indx+1] units of money and books 0..indx to select.

• Otherwise.

Then you are left with x units of money and books 0..indx to select.

Note that the available books on the right-hand side of the equation are always less than the available books on the left-hand side. That reduction of a larger problem to a smaller problem signifies the power of recursion.

The base case are when no books are available, i.e., g(i,0) = 0 for all i, and when there is no money to spare, i.e., g(0, j) = 0 for all j.

• My corrected equation: f(x, 'indx') = max( f(x-price[indx], indx+1) + pages[indx], f(x,indx+1) ), actually f(x,0) is the answer and not the recurrence relation which I was mentioning earlier. The answer I was getting with my equation is correct but I am getting TLE, My code: ide.codingblocks.com/s/99933 – Het Jul 5 '19 at 18:13
• cses.fi/problemset/task/1158 – Het Jul 5 '19 at 18:16
• @Het Instead of recursive calls, you should compute the entries iteratively. I will use my notation. First, $g(i,0)=0$ are known. Then compute $g(i,1)$ for all $i$. Then compute $g(i,2)$ for all $i$. And so on. Finally, $g(x,n)$ is the answer. – John L. Jul 5 '19 at 19:32

format: plain


text:
Breaking News

# Derivative Sin X 2

Derivative Sin X 2. Hence, the differentiation of s i n x 2 with respect to x is 2x. Olivia lives in bengaluru, karnataka, india 3 y. Type in any function derivative to get the solution, steps and graph To calculate the derivative of the chain rule, the calculator uses the following formula :

𝑑𝑦/𝑑𝑥 = (𝑑(sin〖𝑥^2)〗)/𝑑𝑥 = cos x2. Hence, the differentiation of s i n x 2 with respect to x is 2x. Remember that these are just steps, the actual derivative of the question is shown at the bottom) 2) the derivative of the inner function:

## 𝑑𝑦/𝑑𝑥 = (𝑑(sin〖𝑥^2)〗)/𝑑𝑥 = cos x2.

C o s x 2. Find the derivative of sin 2 ( x). Derivatives derivative applications limits integrals integral applications integral approximation series ode multivariable calculus laplace transform taylor/maclaurin series fourier series.

## To Calculate The Derivative Of The Chain Rule, The Calculator Uses The Following Formula :

Differentiating with respect to x by using chain rule, d y d x = c o s x 2.

### Therefore, Let Us Understand How We Can Arrive At.

Dy dx = cos(x2) ⋅ d dx (x2) = cos(x2) ⋅ 2x [ power rule] = 2xcos(x2) answer link

### Kesimpulan dari Derivative Sin X 2.

Let, y = sin 2 x differentiate both sides w.r.t x using chain rule. Notice that sin ( x t + t 2 2) t = sin ( x t + t 2 2) x t + t 2 2 x t + t 2 2 t = sin ( x t + t 2 2) x t + t 2 2 ( x + t 2). Differentiating with respect to x by using chain rule, d y d x = c o s x 2.


text:
Under the auspices of the Computational Complexity Foundation (CCF)

REPORTS > DETAIL:

### Paper:

TR10-132 | 18th August 2010 12:05

#### Approximating Linear Threshold Predicates

TR10-132
Authors: Mahdi Cheraghchi, Johan Hastad, Marcus Isaksson, Ola Svensson
Publication: 18th August 2010 20:57
We study constraint satisfaction problems on the domain $\{-1,1\}$, where the given constraints are homogeneous linear threshold predicates. That is, predicates of the form $\mathrm{sgn}(w_1 x_1 + \cdots + w_n x_n)$ for some positive integer weights $w_1, \dots, w_n$. Despite their simplicity, current techniques fall short of providing a classification of these predicates in terms of approximability. In fact, it is not easy to guess whether there exists a homogeneous linear threshold predicate that is approximation resistant or not.
The focus of this paper is to identify and study the approximation curve of a class of threshold predicates that allow for non-trivial approximation. Arguably the simplest such predicate is the majority predicate $\mathrm{sgn}(x_1 + \cdots + x_n)$, for which we obtain an almost complete understanding of the asymptotic approximation curve, assuming the Unique Games Conjecture. Our techniques extend to a more general class of "majority-like" predicates and we obtain parallel results for them. In order to classify these predicates, we introduce the notion of Chow-robustness that might be of independent interest.


text:
Serving the Quantitative Finance Community

• 1
• 2
• 3
• 4
• 5
• 6
• 8

ppauper
Posts: 70239
Joined: November 15th, 2001, 1:29 pm

### Re: Silly questions

so
$2x\,\mathrm{Heaviside}(x)+(1-2x)\,\mathrm{erfc}(-(x-1/2)/\epsilon)+2(x-1)\,\mathrm{Heaviside}(x-1)$

the area under that between 0 and 1 is I believe
$(-1/2+\epsilon^2)\,\mathrm{erf}(1/(2\epsilon))+1-\epsilon/\pi^{1/2}\exp(-1/(4\epsilon^2))$
What area when $\varepsilon = 0.01$? (exact area = 0.5)
I suppose a graph in Maple is easy?
$\varepsilon = 0.01$, area 0.5001000000
Attachments
area.pdf
area
curve.pdf
eps=0.01

Cuchulainn
Topic Author
Posts: 64971
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: Silly questions

Very nice!
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

lovenatalya
Posts: 287
Joined: December 10th, 2013, 5:54 pm

### Re: Silly questions

I saw some confusions and misconceptions in several posts before Monday. I PM'd Cuchulainn, two days ago, the following clarified proposal along the same line as my solution #2. I did not post it here publicly because I would like to write out the detailed derivation and clarify the misconceptions I saw. But now it seems I do not have a stretch of time to do that quickly, so I am just going to post what I PM'ed Cuchulainn two days ago first.

The formula is simpler than all the previously suggested forms and is derived from the first principle thus possesses the property of the heat equation.

$f_l(t,x) = 2\Big(\frac12+\big(\frac12-x\big)\text{erf(u)} - \sqrt{\frac{2t}\pi}\,e^{-u^2} \Big)$

where $u:=\frac{x-\frac12}{\sqrt{2t}}$. To make sure it hits zero at $\{0,1\}$, you can take $f_l(t,x)-f_l(t,0)$. But I do not think the $f_l(t,0)$ makes any significant difference especially when $t$ is small. This is convolution over the wedge function over the whole real line as I had indicated before instead of the hat function Alan previously was integrating over. The difference is how one extends the hat function to the whole real line. The convergence rate is $\sim\sqrt t$. I will prove this also later.

Here is a plot of my function. Compare this to ppauper's function plot with the equivalent parameter. The former has a single concavity.  The value at $x=\frac12$ is lower than $1$. These are features a heat equation solution with a concave initial condition and zero boundary value should possess. We can not lose the exponential function since this accounts for the deviation of the target function or initial condition from a flat line. The latter curve switches between concavity and convexity, crisscrossing the original hat function and rounds above $(\frac12, 1)$, and below $(0,0)$ and $(1,0)$. These violate the properties of a heat equation solution with a concave initial condition and zero boundary value. Also, the former function needs only to evaluate 1 error function plus an exponential function, whereas the latter 3 error functions.

Of course, in the end, only actual computation can tell which is better. But I think the more faithful the approximation is to the features of the original equation the better.

lovenatalya
Posts: 287
Joined: December 10th, 2013, 5:54 pm

### Re: Silly questions

This post is a bit long, because I present a full derivation of my solution mentioned in my last post and clear up the confusion and misconception in several previous posts. In the following $\Theta$ is the Heaviside step function.

The spatial domain is already compact. Saying a function is compact supported in the space dimension is a bit leading. Usually saying a function has compact support means the closure of the point of the domain where the function value is nonzero is a compact strict subset of the whole domain. If it is truly a strict compact subset and that function is analytic within the whole domain, that function can only be zero by the analytic continuation. The partial sum or truncated Fourier series

$f_{N}(x)=\Theta(|x-\frac12|)\big(\sum_{m=1}^{N}\frac{8}{m^2\pi^2}e^{-m^{2}\pi^{2}t}\sin\frac{m\pi}{2}\sin m\pi x\big)$

is only infinitely differentiable in $[0,1]$ and not in $[-\delta, 1+\delta]$ for some positive $\delta$. So saying $f_{N}(x)$ is compact-supported and infinitely differentiable is misleading.

According to Cuchulainn, the problem to be solved is a parabolic (heat) PDE $u$ define on $(t,x)\in[0,\infty)\times [0,1]$ with Dirichlet boundary condition
$u(t,x=0)=u(t,x=1)=0$. If the equation is $\Big(\frac{\partial }{\partial t}-\frac12\frac{\partial^2}{\partial x^2}\Big)u(t,x)=0$ We can solve it two ways. One is the Fourier series method as ppauper used to obtain

$u(t,x)=\sum_{m=1}^{\infty}\frac{8}{m^2\pi^2}e^{-m^{2}\pi^{2}t}\sin\frac{m\pi}{2}\sin m\pi x$

For $t=0$, the Fourier series can be shown to converge uniformly $\sim\frac1m$. The proof is a bit complicated. I may put it up later though. Thus the convergence is very slow for very small $t$ at least for the first partial sums but fast for large $t$. Besides, the partial sum is going to oscillate, which is not desirable to represent a heat equation solution with a concave initial condition and a vanishing boundary.

The other is the image (Green's function) method or the Poisson summation formula Alan and I used to obtain the following solution

$u(t,x)=\frac1{\sqrt{2\pi t}}\int_{-\infty}^\infty dy\, e^{-\frac{(x-y)^2}{2t}} \sum_{m=-\infty}^\infty (u(t=0,y+2m)-u(t=0,-y+2m)),$

where in this setting $u(t,y):=u(t,y)\Theta(|\frac12-y|)$ i.e., the extension of $u(t,\cdot)$ to the whole real axis with zero values assigned outside of $[0,1]$. This is extends the initial value function to an odd function of period $2$. This series converges very fast for small $t$ at the rate of $\sim e^{-\frac{m^2}{2t}}$ but slowly for large $t$. So we use this series.

The fast convergence allows us to just take the first term. We would like to enforce as much as we can without complicating the mathematics too much the vanishing boundary condition, so we take, say the quadratic Taylor expansion at the boundary and make an odd function extension with respect to that boundary point. In our particular case, it is even simpler. We just extend the wedge (not the hat) to infinity. We have

$u_{\text{l}}(t,x)=\frac1{\sqrt{2\pi t}}\int_{-\infty}^\infty dy\, e^{-\frac{(x-y)^2}{2t}}(1-2|y-\frac12|)=1-\frac2{\sqrt{2\pi t}}\int_{-\infty}^\infty dy\, e^{-\frac{y^2}{2t}}|x-\frac12-y|$

$=2\Big(\frac12-\big(\frac12-x\big)\text{erf}(v) - \sqrt{\frac {2t}\pi}\,e^{-v^2} \Big),$

where $v:=\frac{x-\frac12}{\sqrt{2t}}$. We see that the above $u_{\text{l}}(t,x)$ is the positively and analytically weighted $y$integral of concave functions $-|x-\frac12-y|$ which is then concave and analytic in $x$. Note the exponential function reflects the effect of $y$ term or the slope at each point, particularly the broken slope at the vertex, of the initial condition function. The concavity is provided by the exponential function. So it can not be dropped. The error function gives the base line shape and rounds off (making the resulting function analytic) the sharp corner of the vertex.

In fact, the error of the approximation is

$e\big(t,x+\frac12\big) = (1-2|x|)-u_{\text{l}}(t,x+\frac12)=\frac2{\sqrt{2\pi t}}\int_{-\infty}^\infty dy\, e^{-\frac{y^2}{2t}}(|x|-|x-y|).$

We can easily see from the graph of the integrand in the parenthesis that $e\big(t,x+\frac12\big)>0$ and its maximum occurs at $x=0$ i.e. the vertex with value $e\big(t,\frac12\big)=2\sqrt{\frac{2t}\pi}$. I have to emphasize that this expression particularly $\sqrt t$ is to give the functional dependency between $\max_x(e(t,x))$ and the parameterization of $u_{\text l}(t,x)$. One may just pick $\max_x(e(t,x))$ as the parameter and re-parameterize $u_{\text l}(\cdot,x)$. The approximation is always below the target function. This lowering is the effect of the exponential function. and drops the lowest at the vertex. So we know not only the convergence rate but the exact location of the error and its exact value. This is contributed solely by the exponential term. This gives yet another reason the exponential function cannot be dropped.

It is only natural that this approximation should possess all the properties of a heat equation because it IS a solution of a heat equation, while dropping one without the exponential function is NOT.

I have now derived my formula and its desired properties.
Last edited by lovenatalya on April 26th, 2018, 4:42 pm, edited 4 times in total.

lovenatalya
Posts: 287
Joined: December 10th, 2013, 5:54 pm

### Re: Silly questions

if you want something with compact support, go with one of the truncated series
It depends on whether he wants the whole approximating function to be infinitely differentiable particularly at $\{0,1\}$.
For the Fourier series, we have
$f_{N}(x)=\sum_{m=1}^{N}\frac{8}{m^2\pi^2}e^{-c^{2}m^{2}\pi^{2}t}\sin\frac{m\pi}{2}\sin m\pi x$
which is infinitely differentiable for finite $N$ (as is the Chebyshev series)
Similarly, $g_{\epsilon}(x)=x\,\mathrm{erfc}(-x/\epsilon)+(1-2x)\,\mathrm{erfc}(-(x-1/2)/\epsilon)+(x-1)\,\mathrm{erfc}(-(x-1)/\epsilon)$ is infinitely differentiable for $\epsilon\ne 0$
Please see my last post for why this is ambiguous to say the least. We can not have analyticity (as these functions are) and of compact support at the same time.
Last edited by lovenatalya on April 27th, 2018, 4:20 am, edited 2 times in total.

lovenatalya
Posts: 287
Joined: December 10th, 2013, 5:54 pm

### Re: Silly questions

Just to recap: the solution of the 1d heat equation in an infinite rod with initial condition $f$ whose support is the interval $(a,b)$ is given by the convolution integral

$u(x,t)= \dfrac {1} {2 \sqrt{\pi t}} \int _{a}^{b} f(v) \exp(- (x-v)^2/4t) dv$.
using the function cuch gave originally, this gives

$x\,\mathrm{erf}(x/(2t^{1/2}))+(1-2x)\mathrm{erf}((x-1/2)/(2t^{1/2})) +(x-1)\mathrm{erf}(x-1)/(2t^{1/2}))$
$+\frac{2t^{1/2}}{\pi^{1/2}}\left[e^{-x^{2}/(4t)}-2e^{-(x-1/2)^{2}/(4t)}+e^{-(x-1)^{2}/(4t)}\right]$

the solution I posted had erfc instead of erf and didn't have the exponential terms
Please see my earlier post on why these exponential functions cannot be dropped.

Cuchulainn
Topic Author
Posts: 64971
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: Silly questions

Thanks again, both.

The background is that most FDM schemes have issues at sharp corners (e.g. max(K-S,0)) and accuracy is affected. There are load of workarounds in discrete space to 'smooth' things but are kind of ad-hoc. The current discussion is to 'smooth' the PDE _before_ using FDM.
Scary thing is I have not seen this technique being used..

// Smoothing a discrete payoff by cubic splines gives overshoots. Is that serious in this case?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

ppauper
Posts: 70239
Joined: November 15th, 2001, 1:29 pm

### Re: Silly questions

Thanks again, both.

The background is that most FDM schemes have issues at sharp corners (e.g. max(K-S,0)) and accuracy is affected. There are load of workarounds in discrete space to 'smooth' things but are kind of ad-hoc. The current discussion is to 'smooth' the PDE _before_ using FDM.
Scary thing is I have not seen this technique being used..

// Smoothing a discrete payoff by cubic splines gives overshoots. Is that serious in this case?
what is the PDE? that may affect the "best" approximation

if it's heat conduction, you've already got the solution on $0\le x\le 1$ and on $-\infty<x<\infty$ and use that as your initial condition

if it's Black-Scholes, if you give us the exact payoff it would only take a couple of minutes to work out the European solution and you could use that as your initial condition
I know you said
$f(x) = 2x, 0 \leq x \leq 1/2;$ $f(x) = 2(1-x), 1/2 \leq x \leq 1$.
but does it actually start from $x=0$

lovenatalya
Posts: 287
Joined: December 10th, 2013, 5:54 pm

### Re: Silly questions

There are indeed infinitely many ways to smooth things. The ultimate judge is trying them numerically directly.

The asymptotic error/speed of my previous method is $e^{-\frac{x^2}{2t}}$.

Here is my 3rd way to smooth your function: $1-2 t\ln\Big(2\cosh\big(\frac{x-\frac12}t\big)\Big)$ where $t>0$ is again some positive of your choosing to control the error $2t\ln2$ of the approximation. The asymptotics error/speed is $2t\,e^{-2\frac xt}$, slower than my previous method with respect to $x$, but still exponential. You can replace $t$ with $\sqrt{2t}$ for this expression to be in the same unit as my previous one for comparison.

Cuchulainn
Topic Author
Posts: 64971
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: Silly questions

Can the method of Separation of Variables be used solve the Black Scholes PDE?

1. If not, why not, where does it break down?
2. If yes, how do you compute a solution?

It's an interesting quizzie. There's a lot of maths in there.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

ppauper
Posts: 70239
Joined: November 15th, 2001, 1:29 pm

### Re: Silly questions

you get solutions like $V_{n}(S,t)=\exp(a_{n}t)S^{b_{n}}$ and sum over them $V(S,t)=\sum_{n}C_{n}\exp(a_{n}t)S^{b_{n}}$
the issue is that there's a limited number of problems where that's useful Maybe barrier options or double barrier options.
If you go to the continuous spectrum, you might have a payoff $V(S,T)$ which you can write as an inverse Mellin transform
$V(S,T)=\frac{1}{2\pi i}\int_{\gamma-i\infty}^{\gamma+i\infty}S^{-k}v(k)dk$
then for $t<T$ you'd have an exponential in time in there
$V(S,t)=\frac{1}{2\pi i}\int_{\gamma-i\infty}^{\gamma+i\infty}\exp(a(k)(T-t))S^{-k}v(k)dk$
Last edited by ppauper on November 17th, 2018, 8:20 am, edited 3 times in total.

Alan
Posts: 10710
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: Silly questions

Can the method of Separation of Variables be used solve the Black Scholes PDE?

1. If not, why not, where does it break down?
2. If yes, how do you compute a solution?

It's an interesting quizzie. There's a lot of maths in there.

2. Yes. Start with the easy driftless BS case, where $x = \log S$ and $\mu = r - \sigma^2/2 = 0$. Then, your question amounts to asking: can we use separation of variables to solve the heat equation for $u(t,x)$ on $x \in (-\infty,\infty)$ with $u(0,x) = f(x)$ given?

Ans: sure, tedious, but start by truncating the problem to $x \in (-L,L)$  with $u=0$ at boundaries. Use standard separation of variables. Following wikipedia, for example, the result has the form:

$u_L(t,x) = \int_{-L}^L G_L(t,x,y) f(y) \, dy$,

where $G_L$ is given by an infinite sum. Then, prove that, as $L \rightarrow \infty$,

$G_L \rightarrow \frac{e^{-(x-y)^2/(2 \sigma^2 t)}}{\sqrt{2 \pi \sigma^2 t}}$.

Surely doable and involves many of the same formulas already found in this thread.

Finally, generalize to non-zero drift, and you're done.

ppauper
Posts: 70239
Joined: November 15th, 2001, 1:29 pm

### Re: Silly questions

to add to that, in Paul's "Derivatives" text there's a section "series solution" in the chapter on PDEs where he has an infinite sum
$\sum f_{n}(x)g_{n}(\tau)$
written in the dfffusion equation variables so $x$ is something like $x=\log(S/X)$Cuchulainn Topic Author Posts: 64971 Joined: July 16th, 2004, 7:38 am Location: Drosophila melanogaster Contact: ### Re: Silly questions you get solutions like$V_{n}(S,t)=\exp(a_{n}t)S^{b_{n}}$and sum over them$V(S,t)=\sum_{n}C_{n}\exp(a_{n}t)S^{b_{n}}$the issue is that there's a limited number of problems where that's useful Maybe barrier options or double barrier options. If you go to the continuous spectrum, you might have a payoff V(S,T) which you can write as an inverse Mellin transform$V(S,T)=\frac{1}{2\pi i}\int_{\gamma-i\infty}^{\gamma+i\infty}S^{-k}v(k)dk$then for$t<T$you'd have an exponential in time in there$V(S,t)=\frac{1}{2\pi i}\int_{\gamma-i\infty}^{\gamma+i\infty}\exp(a(k)(T-t))S^{-k}v(k)dk$Mellin transform seems appropriate since the elliptic part of BSPDE is an Euler equation. Most methods' solution end up as an infinite series or integral when they run their course. At some stage they have to solved numerically (Maple, Mathematica?). The formula (22) in the paper looks doable but equation (27) not so because we have to sole for both the price and the free boundary S*. https://ijpam.eu/contents/2014-97-3/3/3.pdf Even if we had an extra condition in (27) it would be a big numerical challenge to compute P and S*? "Compatibility means deliberately repeating other people's mistakes." David Wheeler http://www.datasimfinancial.com http://www.datasim.nl Cuchulainn Topic Author Posts: 64971 Joined: July 16th, 2004, 7:38 am Location: Drosophila melanogaster Contact: ### Re: Silly questions Can the method of Separation of Variables be used solve the Black Scholes PDE? 1. If not, why not, where does it break down? 2. If yes, how do you compute a solution? It's an interesting quizzie. There's a lot of maths in there. 2. Yes. Start with the easy driftless BS case, where$x = \log S$and$\mu = r - \sigma^2/2 = 0$. Then, your question amounts to asking: can we use separation of variables to solve the heat equation for$u(t,x)$on$x \in (-\infty,\infty)$with$u(0,x) = f(x)$given? Ans: sure, tedious, but start by truncating the problem to$x \in (-L,L)$with$u=0$at boundaries. Use standard separation of variables. Following wikipedia, for example, the result has the form:$u_L(t,x) = \int_{-L}^L G_L(t,x,y) f(y) \, dy$, where$G_L$is given by an infinite sum. Then, prove that, as$L \rightarrow \infty$,$G_L \rightarrow \frac{e^{-(x-y)^2/(2 \sigma^2 t)}}{\sqrt{2 \pi \sigma^2 t}}$. Surely doable and involves many of the same formulas already found in this thread. Finally, generalize to non-zero drift, and you're done. I think this approach will also work in more general cases. Here are my ideas (BTW I have not implemented it): 1. Reduce BSPDE(S,t) to self-adjoint form (removes drift) 2. Define y = S/(1+S) to get BSPDE(y,t) on a unit interval [0,1]. 3. Separation of variables P = Y(y)T(t) to get two uncoupled ODEs (pde's coefficients independent of t). 4. Solve the Sturm-Liouville (SL) problem for the ODE for using FDM on a mesh of size N. Solve for the eigenvalues and eigenvectors. 5. Plug the stuff from 4 into the (truncated) series expansion for P = YT. remark a. For each eigenvalue we have to solve FDM for the corresponding eigenvector (N of them). b. What if the Dirichlet BC for SL are not homogeneous. c. Step a can be parallelised (?) d. We only discretise in space (S or y) but not in t (so, no Crank-Nicolson and such-like needed). e. Your domain truncation [-L, L] is probably better than domain transformation _provided_ we don't lose 'information'/loss of accuracy. Is this approach computationally feasible? // In the case of the heat equation the eigenvalues are$\lambda_n = -n^2\pi^2$and eigenvectors are$X_n(x) = sin(n\pi x)[$] but in general the are all different.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl


text:
## Thursday, 11 September 2014

### I Refuse to Name This "Complex Analysis...Made Simple": 3

Hey guys! Let us begin somewhat worryingly: with an apology.

...in the dark corridoors of my decrepit heart, a solitary ray of light lingers on. It shines upon my macabre soulscape, and whispers forth a faint, but grave exhortation: "...the truth! By God they deserve the truth!..."

That's right - you've been lied to! AND I AM SO SORRY. Specifically, you've been taught that a complex function $$f: U\rightarrow\mathbb{C}$$ is a called analytic on $$U$$ if it's complex-differentiable at every point on $$U$$. BUT THIS IS A LIE! This is in fact the definition for holomorphicity. So, then, what the heck is an analytic function? Well, a function $$f:U\rightarrow\mathbb{C}$$ is analytic if it can be locally written expressed as a convergent power series at every point in $$U$$. So why the mixed up in nomenclature? To be honest, I have no idea - but I will say this: it turns out that the two criteria are equivalent - a function is holomorphic if and only if it's analytic!

*Phew* glad I got THAT off my chest. =P

There're a few cool consequences of this equivalence between holomorphic and analytic functions. Firstly, power series are infinitely complex-differentiable, so holomorphic functions are infinitely differentiable! This is kinda freaky, coz the definition of holomorphic only requires that $$f$$ be complex-differentiable - it doesn't even say that the derivative should be continuous...and yet...we are, basking in its smug infinite differentiability.

Secondly, power series are basically just like beefed up polynomials, right? And we should know from highschool algebra that any two order $$n$$ polynomials which agree on $$n+1$$ points have to agree everywhere. Well, that observation also beefs up for analytic functions: any two analytic/holomorphic functions which agree on a countable collection of points with an accumulation (limit) point agree everywhere!

We can also use this characterisation to help us get a better feel for some of the results or phenomena that we see in complex analysis. You've seen from your tute questions that it is possible to have a vanishing contour integral of a function $$f$$ around some $$\Gamma$$ bounding a simply connected domain $$U$$ so that $$f$$ has a pole inside of $$U$$. Take for example the following integral: \begin{align}\oint_{|z|=1}\frac{\mathrm{d}z}{z^2}=\int_0^{2\pi}\frac{i\exp(i\theta)}{\exp(2i\theta)}\mathrm{d}\theta=\int_0^{2\pi}i\exp(-i\theta)\mathrm{d}\theta=0.\end{align} So, is there a nice criterion for when such integrals will vanish? Well, let's assume (to make things easy) that the pole for $$f$$ is positioned at $$0$$ and that the pole is of order $$n$$. This means that $$z^n f(z)$$ is holomorphic at $$0$$ and hence has a power series expansion at this point: \begin{align} z^nf(z)&=a_0+a_1z+a_2z^2+\ldots+a_{n-1}z^{n-1}+a_nz^n+\ldots\\ f(z)&=a_0z^{-n}+a_1z^{1-n}+a_2z^{2-n}+\ldots+a_{n-1}z^{-1}+a_n+\ldots\end{align} Now, doing a contour integral around the unit circle $$|z|=1$$, we expect everything to vanish except possibly $$\oint_{|z|=1}a_{n-1}z^{-1}\mathrm{d}z$$. This term contributes $$2\pi i a_{n-1}$$ to the integral, and so a contour integral around a pole of a function vanishes precisely when the "power-series" has no $$z^{-1}$$ term. In fact, the coefficient of the $$z^{-1}$$ term is so important that we've given it a name: it's called the residue.

Soooooooooo...complex analysis...so simple, right? =)


text:
ISSN 1671-3710
CN 11-4766/R

### Optical information for accurate perception of objects with orientation change

Jing Samantha Pan; Ned Bingham; Geofrey P. Bingham

1. Department of Psychology, Sun Yat-Sen University, Guangzhou, China
School of Electrical and Computer Engineering, Cornell University, USA
Department of Psychological and Brain Sciences, Indiana University, IN, USA
• Online:2016-12-31 Published:2016-12-31

Abstract:

Purpose: Identifying tilted objects is harder than identifying upright objects using image structure information . However, motion generates optic flow that calibrates image structure. Calibrated image structure preserves spatial layout despite image distortion . Thus, if the tilting process and the tilting objects are continuously perceptible, then the interaction of optic flow and image structure should allow accurate perception of object locations despite orientation change.
Methods and results: We tested this hypothesis by simulating two surfaces separated in depth, with cutout holes in the front surface through which targets and distracters on the rear surface were visible. Both surfaces first rotated and processed rigidly to review depth structures (structure-from-motion), then the front surface translated to occlude targets. Next, the two surfaces tilted rigidly. After some time delays, participants identified locations of hidden targets. We found that: (1) when tilting was perceptible, participants identified object locations equally well with or without orientation change; (2) when tilting process was imperceptible, identifying object locations from a tilted scene after orientation change worsened; and (3) when observers did not see but were told about the amount of tilting, identification was worse than with no orientation change.
Conclusion: Therefore, combined optic flow and image structure information, not mere knowledge about the tilt, enables accurate perception despite orientation change.


text:
Select Page

# Tumor growth inhibition (TGI) library

A wide range of ODEs models for tumour growth (TG) and tumour growth inhibition (TGI) is available in the literature and correspond to different hypotheses on the tumor or treatment dynamics. In the absence of detailed biological knowledge, selecting the most appropriate model is a challenge. In MonolixSuite2020, we provide a modular TG/TGI model library that combines sets of frequently used basic models and possible additional features. This library permits to easily test and combine different hypotheses for the tumor growth kinetics and effect of a treatment, allowing to fit a large variety of tumor size data.
When available, analytical solutions are used.

# Tumor growth models

## Initial tumor size

The initial tumour size TS0 can be either be:

• a parameter to estimate,
• a regressor to read from the dataset.

It has to be noted that the time corresponding to the initial tumour size is not necessarily 0. It is the case for models implemented with an analytical solution, but for models implemented with an ODE system it corresponds to the initial integration time. This time is not fixed for most models from this library, which means that it is by default the first dose or observation time in the data set, and can vary between individuals. If one wishes to fix the initial integration time for all individuals, one can uncomment the line “t_0=0” in the model to fix the initial integration time at 0, and modify the line to choose another initial time, which must necessarily be before any dose or observation in the data set. Thus only models implemented with an analytical solution can capture observations at prior times than the time for TS0.

## Kinetics of tumor growth

After a growing phase, tumors experience a saturation due to limits of nutrient supply. However, this saturation property is often never measured in patients in practice because the host dies in the majority of cases before this saturation phase begins. Also in preclinics, the experiments have to be canceled if a specific tumor size is reached due to ethical reasons. Thus, tumor growth models may be divided into two broad categories: those which are able to capture the saturation as the tumor grows (achieved by the introduction a carrying capacity or a spontaneous decay component) and those which do not.

• #### Models without saturation

• ##### Linear

The linear tumor growth assumes a constant zero-order growth rate.

 ODE system Analytical solution $$\frac{dTS}{dt} = kgl$$ $$TS(t_0)=TS0$$ $$TS=kgl*t+TS0$$

The quadratric tumor growth combines linear and quadratic growth rates. Because time is involved in this model, the initial time is fixed to 0 in corresponding library models.

 ODE system Analytical solution $$\frac{dTS}{dt} = kgl+2*kg2*t$$ $$TS(t_0)=TS0$$ $$TS=kgl*t+kg2*t^2+TS0$$
• ##### Exponential

The exponential growth assumes the growth rate of a tumor is proportional to tumor burden (first-order growth).

 ODE system Analytical solution $$\frac{dTS}{dt} = kge*TS$$ $$TS(t_0)=TS0$$ undefined $$TS=TS0*e^{kge*t}$$
• ##### Power law

If 0 < gamma < 1, the power law model (also named generalized exponential) provides a description in terms of a geometrical feature of the proliferative tissue: the growth rate is proportional to the number of proliferative cells as a fraction of the full tumor volume. The case gamma=1 corresponds to proliferative cells uniformly distributed within the tumor and leads to exponential growth. The case gamma=2/3 represents a proliferative rim limited to the surface of the tumor, where the tumor radius grows linearly in time.

 ODE system Analytical solution $$\frac{dTS}{dt} = kge*TS^\gamma$$ $$TS(t_0)=TS0$$ $$TS=(kge*(1-\gamma)*t+TS0^{1-\gamma})^{\frac{1}{1-\gamma}}$$
• ##### Exponential-linear

Experimental data of tumor growth in untreated xenograft mice suggest that tumor growth dynamics follow two distinctively different phases of growth: an initial exponential growth, followed by a linear growth phase. Biologically, this is due to the fact that the growth of the tumor is almost unlimited at first, but that as the nutrients go scarce, its growth is then necessarily restricted.
The simple exponential-linear model captures this with a transition between an exponential (first-order) growth to a linear (zero-order) growth. The transition time is computed to ensure that the solution is continuously differentiable, but this is possible only if the model is not combined with any treatment effect or additional features. In that case, the transition time corresponds to TS = kgl/kge.
In the library, the exponential-linear model is provided with its analytical solution and can not be combined to any treatment effect or additional features.

 ODE system Analytical solution $$\frac{dTS}{dt} = kge*TS, t\le\tau$$ $$\frac{dTS}{dt} = kgl, t\ge\tau$$ $$TS(t_0)=TS0$$ $$\tau = \frac{1}{kge}ln(\frac{kgl}{kg*TS0})$$ $$TS=TS0*e^{kge*t}, t\le\tau$$ $$TS=kgl*(t-\tau)+TS0*e^{kge*\tau}, t\ge\tau$$ $$\tau = \frac{1}{kge}ln(\frac{kgl}{kg*TS0})$$
• ##### Simeoni

The Simeoni model approximates the exponential-linear model with a single differential equation. The power term is fixed to 20 to allow the system to pass from the first-order to the zero-order growth sharply enough, as in the original system. With this value, the growth rate is approximated by kge*TS when TS is smaller than kgl/kge, and by kgl when TS is larger than kgl/kge. The advantage of the Simeoni model over the exponential-linear model is that it is differentiable even when combined with any type of treatment effect.
When used in combination with the description of non-proliferating subpopulations of cells (transit compartments with cell distribution, or two populations model), with TS the size of the proliferating subpopulation, the growth function is slowed down by the factor TS/TotalTS only when the tumor is in its linear growth phase, but not in the exponential growth phase.

 ODE system Reference $$\frac{dTS}{dt} = \frac{kge*TS}{(1+(\frac{kge}{kgl}*TS)^\psi)^(\frac{1}{\psi}}$$ $$TS(t_0)=TS0$$ Simeoni et al. (2004).
• ##### Koch

Similarly to the exponential-linear and Simeoni models, the Koch tumor growth model is a nonlinear growth function that follows an initial exponential growth followed by a linear growth phase. Its particularity is a smooth transition between exponential and linear growth phase, rather than a rapid switch after a threshold reached for the time (exponential-linear) or tumor size (Simeoni).
When used in combination with the description of non-proliferating subpopulations of cells (transit compartments with cell distribution, or two populations model), with TS the size of the proliferating subpopulation, the growth function is slowed down by the factor TS/TotalTS.

 ODE system Analytical solution Reference $$\frac{dTS}{dt} = \frac{2kge*kgl*TS}{kgl+2kge*TS}$$ $$TS(t_0)=TS0$$ $$TS=TS0e^{2kge(t+\frac{1}{kgl}(TS0-TS))}$$ Koch et al. (2009)

• #### Models with saturation

• ##### Logistic

This model assumes an exponential growth rate which decelerates linearly with respect to the tumor size. This results in sigmoidal dynamics – with an initial exponential growth phase followed by a growth-saturated phase as the tumor reaches its carrying capacity (TSmax).

 ODE system Analytical solution $$\frac{dTS}{dt} = kge*TS(1-\frac{TS}{TSmax})$$ $$TS(t_0)=TS0$$ $$TS=\frac{TSmax*TS0}{TS0+(TSmax-TS0)*e^{-kge*t}}$$
• ##### Generalized logistic

In this model, tumor growth depends on tumor size with a generalized logistic function. It reduces to the logistic model if $\gamma=1$, or to the Gompertz model when $\gamma$ is close to 0.

 ODE system Analytical solution $$\frac{dTS}{dt} = kge*TS(1-(\frac{TS}{TSmax})^{\gamma})$$ $$TS(t_0)=TS0$$ $$TS=\frac{TSmax*TS0}{(TS0^\gamma+(TSmax^\gamma-TS0^\gamma)*e^{-kge*\gamma*t})^{\frac{1}{\gamma}}}$$
• ##### Simeoni-logistic

In [Haddish-Berhane et al., 2013], a hybrid model derived from the Simeoni model is proposed, that combines exponential, linear and logistic growth.

 ODE system Reference $$\frac{dTS}{dt} = \frac{kge*TS*(1-\frac{TS}{TSmax})}{(1+(\frac{kge}{kgl}*TS)^\psi)^{\frac{1}{\psi}}}$$ $$TS(t_0)=TS0$$ Haddish-Berhane et al., 2013
• ##### Gompertz

The Gompertz model follows the observation of a deceleration of the growth rate over time, without any phase at which the growth rate remains constant. The volume converges asymptotically to $TSmax = TS0*exp(alpha/beta)$.

Several parameterizations can be used, and two are displayed on the table below. The first parameterization is the one implemented in the library, and the one for which the impacts of the parameters are the most separate and easiest to control. However, the carrying capacity TSmax can be difficult to estimate and can lack biological meaning if no clear tumor size saturation is seen. With the second parameterization, alpha and beta have an impact on the carrying capacity and on the growth rate, while TS0 also has an impact on the carrying capacity.

 ODE system Analytical solution $$\frac{dTS}{dt} = TS*\beta*ln(\frac{TSmax}{TS})$$ $$TS(t_0)=TS0$$ $$TS=TSmax*e^{e^{-\beta*t}*ln(\frac{TS0}{TSmax})}$$ $$\frac{dTS}{dt} = \alpha*e^{-\beta*t}*TS$$ or, equivalently, $$\frac{dTS}{dt} = (\alpha-\beta*ln(TS))TS$$ $$TS(t_0)=TS0$$ $$TS=TSmax*e^{e^{-\beta*t}*ln(\frac{TS0}{TSmax})}$$
• ##### Exponential-Gompertz

An exponential-Gompertz model can also be considered, built upon the assumption that the tumor follows at first an exponential growth, and is then akin to a Gompertz model once the nutrients start to go scarce.

 ODE system Refefence $$\frac{dTS}{dt} = min(kge*TS,TS*\beta*ln(\frac{TSmax}{TS}))$$ $$TS(t_0)=TS0$$ Wheldon (1988)
• ##### Von Bertalanffy

This model is based on balance equations of metabolic processes. The growth is limited with a loss term.

 ODE system Analytical solution Reference $$\frac{dTS}{dt} = kg*TS^{2/3}-kd*TS$$ $$TS(t_0)=TS0$$ $$TS= \left[ \frac{kg}{kd}+(TS0^{1/3}-\frac{kg}{kd})*e^{-1/3*kd*t} \right]^3$$ Von Bertalanffy, 1957
• ##### Generalized Von Bertalanffy

This is the generalized version of the Von Bertalanffy model. The von Bertalanffy model corresponds to the case gamma=⅔, where the growth is proportional to the surface of the tumor.

The loss term induces for some parameter values a saturation of the tumor, with $TSmax=(\frac{kge}{kd})^{\frac{1}{1-\gamma}}$. When the loss term is neglected, the generalized von Bertalanffy model reduces to a power law.

When the Von Bertalanffy model (or generalized Von Bertalanffy model) is used in combination with a tumor inhibition model which makes use of the Norton Simon killing hypothesis, the treatment effect is only applied to the growth term of the model (and not to its decay term).

 ODE system Analytical solution Reference $$\frac{dTS}{dt} = kg*TS^{\gamma}-kd*TS$$ $$0 \leq \gamma \leq 1$$ $$TS(t_0)=TS0$$ $$TS= \left[ \frac{kg}{kd}+(TS0^{1-\gamma}-\frac{kg}{kd})*e^{-(1-\gamma)*kd*t} \right]^\frac{1}{1-\gamma}$$ Von Bertalanffy, 1957

Additional features can be included to consider more complex tumor growth models:

• ##### Dynamic carrying capacity due to angiogenesis

The library includes, as an example, a module taken from Hahnfeldt et al,1999 that models the effect of angiogenesis as a dynamic carrying-capacity. When selecting the dynamic carrying-capacity module, TSmax is defined as an ODE variable instead of a constant parameter, with the following ODE:

 ODE Reference Examples of curves for tumor size (left) or carrying capacity (right) with diverse shapes, based on logistic tumor growth. Green: predictions without the additional feature (constant TSmax). Blue: with dynamic carrying capacity. $$\frac{dTS_{max}}{dt} = kp_v*TS -\kappa*TS_{max} – kd_{\nu}*TS*TS^{2/3}$$ Hahnfeldt et al,1999
• ##### Immune dynamics causing shrinkage or oscillations of tumor size

The library includes, as an example, a model of tumor-immune interactions with chemotherapy proposed by De Pillis et al. (2007), taking into account the control of the tumor growth by the immune system, and the weakening of the immune system as a side effect of chemotherapy. The model includes an additional ODE defining effector–immune cells:

 ODE system Reference Examples of curves for tumor size (left) or effector immune cells (right) with diverse shapes, based on exponential tumor growth. Green: prediction without the additional feature (constant tumor growth). Blue: with immune dynamics. $$\frac{dTS}{dt} = growth -ki*I*TS$$ $$\frac{dI}{dt} = kp_i – kd_i*I + g*\frac{TS}{h+TS}*I -p*I*TS$$ De Pillis et al. (2007)

More details on these additional features.

# Treatment effect

## Type of treatment

Flexible treatment definition is provided thanks to several possibilities:

• No treatment

This option corresponds to simple tumor growth models.

• PK model

Dosing information is encoded in the dataset, and the effect of the treatment is modeled via a simple PK model (one compartment, bolus administration, linear elimination) which can be easily adapted to a more complex model or to fix some parameters. The predicted concentration inhibits tumor size.
Note that in case of a high number of doses, it is preferable to approximate the exposure by a piecewise regressor or by a constant treatment, to reduce computation cost. Particularly when the dosing is daily and the disease lasts several years, modeling of the PK is not useful and very costly.

• Exposure as regressor

Values which describe the evolution of the treatment’s exposure/concentration with respect to time are already stored within the data set and are used within the TGI model under the variable EXPOSURE.
DATA FORMAT RESTRICTIONS: The values describing the treatment’s exposure with respect to time must be stored in a separate column of the data set labelled ‘REGRESSOR’.

• Treatment start at t=0

The tumour growth inhibition component is applied with a constant effect after t=0.
DATA FORMAT RESTRICTIONS: The data must be formatted as to have the treatment being added at time t=0 for all individuals. Measurements before that can make use of negative values for time. Note that in that case, the initial integration time (corresponding to the initial tumour size TS0) is the first measurement time and can vary between individuals.

• Treatment start time as regressor

The time at which the treatment is added is a variable named T in the model, which may vary between individual, and whose value is read from a regressor column in the data set. When time t<T, a simple tumour growth model is being implemented. After, a tumour growth inhibition component to the model is added.
DATA FORMAT RESTRICTIONS: The values for T must be stored within the data set in a separate column tagged as ‘REGRESSOR’.

• No treatment (0) vs treatment (1) regressor

A simple tumour growth model is being implemented if the variable Trt = 0. If Trt = 1, a tumour growth inhibition component to the model is added. Trt is read from a regressor column in the dataset.
DATA FORMAT RESTRICTIONS: A 0 – if the measurement was taken before or after treatment – or 1 – if it was taken during treatment – must be matched and stored within a separate column under the header ‘REGRESSOR’ for each of the measurements of the data set.

## Killing hypothesis

There are two different most commonly used hypothesis relevant to the method of killing of any given treatment within the literature:

• ##### Skipper-Schabel-Wilcox log-kill hypothesis

This hypothesis states that exposure to a given amount of treatment kills a constant fraction of the total tumour cell population by increasing apoptosis. Consequently, the proportion of tumour cells removed every time a dose of treatment is administered remains constant regardless of the size of the tumor at the start of therapy.
Tumor cell log-kill is typically induced by a standard cytotoxic or a targeted therapy. With this hypothesis, the Tumor Static Concentration (TSC) corresponds to K*TS=growth.

• ##### Norton-Simon killing hypothesis:

This hypothesis was based on the observation that faster-growing tumors respond better to chemotherapy than do slower-growing tumors, and states that the killing term is proportional to growth rate (tumor growth modulation).
In the case of an anti-angiogenic drug for example, the cytostatic effect is assumed to be due to a direct inhibitory action on the unperturbed tumor growth rates. With this hypothesis, and if no decay or apoptosis term is considered, the Tumor Static Concentration (TSC) corresponds to K=1.

If the growth is exponential ($growth=kge*TS$), the log-kill and Norton-Simon hypotheses result in inhibition dynamics with equivalent shapes, but the inhibition from the Norton-Simon model depends on the growth rate while the log-kill inhibition does not: they are equivalent if K from the log-kill model is equal to K/kge in the Norton-Simon model.

On the figure on the right for example, the tumor size follows an exponential-linear growth, a constant treatment effect is applied either in the exponential phase (at t=20) or in the linear phase (at t=60). The treatment kinetics is linear. The parameters are adapted such that $kkill_{NS} = kkill_{LK}*kge$, thus the treatment effect is the same in the exponential phase. However if the same treatment is applied later in the linear phase, a smaller proportion of tumor is removed with the Norton-Simon hypothesis, following a linear killing while the tumor remains in the linear phase.
It enfolds that under the Norton-Simon hypothesis the optimal treatment should deliver the most effective dose level of drug over as short a time as possible (high dose density), since tumors given less time to grow between treatments are more likely to be eradicated.

## Dynamics of treatment effect

Five different exposure-dependent treatment kinetics which we found to be most common within the literature can be combined with both of these killing hypotheses.
Below are plots showing the curves resulting from the addition of these TGI models to an exponential TG model, with a punctual drug exposure resulting from a single dose which is absorbed at time 0 and then eliminated. On the first figure, a linear range of different dose amounts has been applied in order to exhibit the linear and non-linear relationships between exposure and treatment effect.

When the treatment exposure is not given, the treatment effect is constant.

## Delay of treatment effect

Chemotherapeutic effects often appear days or weeks following drug exposure. To account for a more progressive tumour regression, a delay in either the treatment effect (i.e. signal distribution model) or cell death (i.e. cell distribution model) may be added via transit compartments.

• ###### Signal distribution model

Lobo and Balthasar (2002) applied to tumor growth the transit compartment model proposed by Sun & Jusko (1998) to characterize delayed drug effects that occur via a cascade or signal transduction. The operative rate function of tumor cells killing, K3, is related to K via a series of transit compartments (K1-K3). Tau refers to the mean transit time in each transit compartment. Although 4 transit compartments were used in Lobo and Balthasar (2002), the model implemented in our library has only 3 compartments for an easier comparison to the cell distribution model. It can be easily edited by the user to add more compartments if nedded.

• ###### Cell distribution model

The cell distribution model proposed in Simeoni et al., 2004 assumes that the anticancer treatment makes some cells non-proliferating. These cells pass through different stages (also called transit compartments), characterized by progressive degrees of damage, and, eventually, they die. Hence, the attacked tumor cells have a lifespan.
The number of stages of damage and the value of tau affect the shape of the distribution of the time-to-death of damaged tumor cells. The lifespan, or time-to-death, of the attacked tumor cells, is the mean transit time that it takes for the tumor cells, affected by the action of a drug, to go through the cascade of damaging events to cell death. For n transit compartments, the average lifespan is computed by Mtt = n*tau. This library includes an implementation of the model with three transit compartments, as in Simeoni et al., 2004.
When the model considers two populations of cancer cells in the tumor (sensitive/resistant), the treatment induces the transfer or both types of cells into the first transit compartment, with different rates.

Below are plots showing the curves resulting from the addition of both of these delays to a model making use of exponential TG component and a log-kill constant TGI component depending on constant treatment starting at time 30.

## Emergence of resistance

A common feature of tumours is the emergence of treatment-resistance. This phenomena can be modelled in a variety of ways. Decrease in treatment efficacy can be simply added in a phenomenological approach. More mechanistic models try to represent the cell population in its heterogeneity, splitting it into at least two subpopulations: the proliferating and the quiescent cells.
In this library, we included two common methods used within the literature to achieve this:

• ##### Claret exponential

This simple phenomenological model accounts for the loss of drug-induced decay over time due to declining efficacy of the drug, which can be due to the emergence of resistance. It uses a single resistance parameter $\lambda$, and it can be combined with any treatment effect.

 Equation Refefence Figure for an exponential growth function and constant treatment effect starting at time t=0. $$K’ = K*e^{-\lambda*t}$$ Claret et al. (2009)

• ##### Resistant population

There are many models in the literature that apply variations of the same approach based on two tumor cell populations with different sensitivities, for example Hahnfeldt et al., 2003, Desmée et al., 2017, Lobo & Balthasar, 2002, Jusko, (1973). We have integrated in the library simple versions inspired by this principle, combined with different treatment effects: these models assumes that a fraction of the tumor is resistant to the treatment, thus being killed with a smaller rate than the sensitive part of the tumor. They use a parameter f as initial fraction of resistant tumour cells, and the number of parameters characterizing the treatment effect doubles to have population-specific effects.

 Equation Figure for an exponential growth function and constant treatment effect starting at time t=0. Log-killl hypothesis: $$\frac{dTS_s}{dt} = growth – TS_s*K_{TS_s}$$ $$\frac{dTS_r}{dt} = growth – TS_r*K_{TS_r}$$ Norton-Simon hypothesis: $$\frac{dTS_s}{dt} = growth * (1- K_{TS_s})$$ $$\frac{dTS_r}{dt} = growth *(1-K_{TS_r})$$ Initial conditions: $$TS_s(t_0)=TS0*(1-f)$$ $$TS_r(t_0)=TS0*f$$

Below is a figure showing the curves resulting from the addition of these two resistance components to a model making use of exponential TG component and a log-kill linear TGI component, with a constant treatment effect starting at time 0.

## Effect of treatment on angiogenesis or immune dynamics

If more complexity was added to the TG model by means of modelling immune dynamics or a dynamic carrying capacity, it can be decided that these should also be influenced by the addition of a treatment.

• ##### Combination therapy with active inhibition of angiogenesis

Combination therapy is often used to maximise chances of tumour regression and minimise chances of treatment-resistant clones from emerging. As such, it may be wished to model the effect of an angiogenesis inhibitor, on top of the tumour inhibitor. This corresponds to an additional option named “Additional treatment effect” available in the library when both angiogenesis and a treatment effect are selected. In that case the ODE for TSmax becomes:

$$\frac{dTS_{max}}{dt} = kp_v*TS -\kappa*TS_{max} – kd_{\nu}*TS*TS^{2/3} -e*TS_{max}$$

The treatment on angiogenesis is added as a second constant treatment (on top of the one selected earlier on). By choosing this additional option, it is assumed that no PK data is available for this second treatment and consequently, first-order kinetics are used to model the effect. Furthermore, the effect of the second treatment is assumed to follow a log-cell kill killing hypothesis.

• ##### Combination therapy with decay of immune cells

If the treatment added does not only target tumour cells but a more general cell population (such as chemotherapy), it may be relevant to include a killing term on the immune cell dynamics as well. This feature is available in the library if modelling of immune dynamics was selected during selection of tumour growth model. It consists in adding an extra decay constant to take into consideration the effect chemotherapy will have on immune cells. The equations then become:

$$\frac{dI}{dt} = kp_i – kd_i*I + g*\frac{TS}{h+TS}*I -p*I*TS – K_i*I$$

where the killing term $-K_i*T$ actually follows the same pattern as the killing term on TS selected in the library.

# Shortcut models

Lastly, we found that some typical models within the literature. In order to ease access to these models, we created a shortcut tab which automatically leads one to the appropriate selections when applicable, or loads the dedicated model otherwise. In each case, the initial tumor size TS0 can be set as a parameter or as a regressor.

• ###### Claret exponential model

This model from Claret et al., 2009 corresponds to the following choices in the library:

The treatment “PK model” is selected by default, but the Claret model is actually compatible with any type of treatment effect. The version with a constant treatment effect starting at t=0 (choice “Treatment start at t=0”), has an analytical solution implemented in the mode, and is therefore much faster to compute than other models implemented as ODEs

$TS = TS0*e^{kge*t-\frac{kkill}{\lambda}*(1-e^{-\lambda*t})}$

• ###### Simeoni model

This model from Simeoni et al., 2004 corresponds to the following choices in the library:

Here again, the treatment “PK model” is selected by default, but the Simeoni model is actually compatible with any type of treatment effect.

The equations are:

$TS(t_0)=TS0 \\ TS_1(t_0)=0 \\ TS_2(t=0)=0 \\ TS_3(t=0)=0 \\ \frac{dTS}{dt} = \frac{kge*TS}{(1+(\frac{kge}{kgl}*TS)^\psi)^\frac{1}{\psi}} - K*TS \\ \frac{dTS_1}{dt} = \frac{kge*TS}{(1+(\frac{kge}{kgl}*TS)^\psi)^\frac{1}{\psi}} - \frac{TS_1}{\tau} \\ \frac{dTS_2}{dt} = \frac{TS_1 - TS_2}{\tau} \\ \frac{dTS_3}{dt} = \frac{TS_2 - TS_3}{\tau} \\ TotalTS = TS+TS_1+TS_2+TS_3$

• ###### Two-population model

Also called evolutionary model, this simple model corresponds to an exponential growth, and a treatment effect based on log-cell kill hypothesis with first-order kinetics and no delay. The treatment can be set by the user as constant or exposure-dependent.

The equations are:

$TS_0 = TS0*(1-f) \\ TSr_0 = TS0*f \\ \frac{dTS}{dt} = -kkill*EXPOSURE*TS \\ \frac{dTSr}{dt} = kge*TSr \\ TotalTS = TS+TSr$

TS represents the sensitive part of the tumor, and TSr the resistant part. TotalTS is the total tumor size.
If the treatment is constant and starts at time 0, the model is encoded with its analytical solution:

$TS = TS0*(f*exp(kge*t) + (1-f)*exp(-kkill*t))$

with kkill=0 before t=0.

• ###### Stein regression-growth model

This model from Stein et al., 2011 is a simple phenomenological equation based on the assumption that the change of tumor size during therapy results from two independent component processes: an exponential decrease/regression and an exponential regrowth of the tumor:

$TS = TS0*(exp(-kkill*t) + exp(kge*t) -1)$,

with kkill=0 before t=0.

This model is only available with the treatment option “Treatment start at t=0”.

In responding tumors, regression dominates from start of therapy until nadir, growth dominating after nadir. Theoretical curves depicting the separate components of the model and how these combine together to give the time dependence of the tumor size appear in the figure below.

• ###### Wang model

This model from Wang et al., 2009 combines an exponential-decay (shrinkage) and a linear-growth (progression). In the original model, the linear growth component is considered as an approximation of tumor growth under a specific treatment, with a treatment-dependent slope. In the present library, the model is implemented with the same linear growth rate before and during treatment. It goes as follows:

$TS = TS0*exp(-kkill*t)+kgl*t$

This model can only be used with the option “Treatment starting at time 0”.

The following figure shows a typical prediction:

• ###### Bonate model

This model is based on Bonate & Suttle, 2013. It is a modification of the Wang model in which a quadratic growth term has been added to account for curvature of tumor growth following nadir.

It goes as follows:

$TS = TS0*exp(-kkill*t)+kgl*t+kg2*t^2$

• ###### Ribba model

This model has been proposed by Ribba et al., 2012. It is able to capture the growth kinetics of low-grade glioma after termination of chemotherapy, characterized by a frequent decrease in volume despite chemotherapy no longer being administered, by considering delayed action of chemotherapy on quiescent tumor cells. The tumor is represented as proliferative and quiescent tumor tissues that respond differently to treatment. The treatment concentration affects both proliferative and quiescent tissue. The tissue composed of cells in proliferation is directly eliminated because of lethal DNA damages induced by the treatment. Nonproliferative tissue is also subject to DNA damages due to the treatment. When re-entering the cell cycle, the DNA-damaged quiescent cells can either repair their DNA damages and return to a proliferative state or die because of unrepaired damages.

It is represented on this figure adapted from [Ribba et al., 2012]:

The following curves show the prediction of each variable of the model before and after a treatment dose at time 0, on the left, and the impact of the parameters on the prediction for TotalTS on the right. The treatment concentration causes an initial sharp drop in P and thus in TotalTS, as well as the transfer of cells from Q to Qp. While the treatment concentration decreases then fastly to 0, TotalTS continues decreasing slowly, driven by the elimination of Qp. TotalTS increases again only once enough cells have been transferred from Qp to P. The growth function chosen in this model includes a saturation with a carrying capacity TSmax.

## Examples of model extensions

The TGI library implemented in Monolix has no ambition of being exhaustive. If a different or more complex TGI model is needed to capture some tumor size data, it can be convenient to start from a model defined in the library, and edit it to derive a user-custom model, a process that is straight-forward with Monolix. In this section we present a few examples of more complex models from the literature and how they can be built based on a model from the library.

[Soon to come]


text:
# Integral: $\int_{0}^{x}\lfloor\frac{1}{1-t}\rfloor \,dt$

I'm working on an integral problem(the rest of which is irrelevant) and this integral arises, which has stumped me. $$\int_{0}^{1}\int_{0}^{x}\left\lfloor\frac{1}{1-t}\right\rfloor dt \,dx$$

$$\bf\lfloor\quad\rfloor$$ is Floor function.

Looking at $$\int\limits_{0}^{x}\left\lfloor\dfrac{1}{1-t}\right\rfloor dt$$:

Clearly this diverges for x = 1, but is there any representation in terms of $$\zeta(x)$$?

So far I have:

$$\int_{0}^{1}\left\lfloor\frac{1}{1-t}\right\rfloor dt = \sum_{n=0}^{\infty}\int_{\frac{n}{n+1}}^{\frac{n+1}{n+2}} \thinspace (n+1)\,dt = \zeta(1)-1$$

But I am unsure how to address the issue of finding what interval x is between and calculate the area up to x in relation to x since there are different bounds x could be located in. I suppose something like this could work but it doesn't seem like something that could be further integrated form 0 to 1.

$$A = \left\lfloor\frac{1}{1-x}\right\rfloor-1$$ $$\sum_{n=0}^{A}\int_{\frac{n}{n+1}}^{\frac{n+1}{n+2}} \thinspace (n+1)\,dt + \int_{\frac{A}{A+1}}^{x}(A+1)\,dt$$

• Is there a dependency of x and t? – Moti May 17 '16 at 5:08
• @Moti Well t is a u sub for xy but I didn't think that would be important. I have properly done the dt and limits. – Jasper Braun May 17 '16 at 11:19
• @JasperBraun I just add \left and \right to the "floor's". – Felix Marin May 17 '16 at 20:12
• It's odd that you stopped where you did, rather than compute all of the integrals. – Hurkyl May 17 '16 at 20:14

Denote $f(t) = \lfloor 1/(1-t) \rfloor$, and consider the function $$g(x,t) = \Theta(x - t) f(t),$$ where $\Theta(u)$ is the Heaviside step function. Since $g(x,t) = f(t)$ on the original region of integration, we can expand the region of integration to the unit square: $$\int_{0}^{1}\int_{0}^{x} f(t) \, dt \, dx = \int_0^1 \int_0^1 \Theta(x - t) f(t) \, dt \, dx.$$ The function $g(x,t)$ is non-negative and measurable, so by Tonelli's Theorem (credit to @RRL for pointing this out in the comments), we can exchange the order of integration: $$\int_0^1 \int_0^1 \Theta(x - t) f(t) \, dt \, dx = \int_0^1 \int_0^1 \Theta(x - t) f(t) \, dx \, dt = \int_0^1 \left[ \int_t^1 f(t) \, dx \right] dt.$$
This integral can then be performed: \begin{align*} \int_{0}^{1} \left[ \int_{t}^{1} f(t) \, dx \right] dt &= \int_0^1 (1 - t) f(t) \, dt \\ &= \sum_{n = 0}^\infty \int_{n/(n+1)}^{(n+1)/(n+2)} (1-t) (n+1) \, dt \\ &= \sum_{n = 0}^\infty (n+1)\left[ t - \frac{t^2}{2} \right]_{n/(n+1)}^{(n+1)/(n+2)} \\ &= \sum_{n = 0}^\infty \frac{3 + 2n}{2(n+1)(n+2)^2} \\ &= \sum_{n = 0}^\infty \left[ \frac{1}{2(n+1)} - \frac{1}{2(n+2)} + \frac{1}{2 (n+2)^2} \right] \\ &= \sum_{n = 1}^\infty \left[ \frac{1}{2n} - \frac{1}{2(n+1)}\right] + \frac{1}{2} \sum_{n=2}^\infty \frac{1}{n^2} \\&= \frac{1}{2} + \frac{1}{2} (\zeta(2) - 1) = \frac{\zeta(2)}{2} = \frac{\pi^2}{12}. \end{align*} In the last step, we have used telescoping series to perform the first sum, and the second sum is the definition of $\zeta(2)$ except that it's missing the $n = 1$ term ($1/1^2$).
• Nice +1. Since $f$ is non-negative and measurable the interchange is fine(Tonelli's theorem). To skip the geometric argument -- $\int_0^1 \int_0^x f(t) \, dt \,dx = \int_0^1 \int_0^1 f(t)1_{\{t \leqslant x\}} \, dt \,dx = \int_0^1 \int_0^1 f(t)1_{\{x \geqslant t\}} \, dx \,dt = \int_0^1 \int_t^1 f(t) \, dx \,dt$. – RRL May 17 '16 at 21:30
$\Psi$ is the digamma function.