sábado, 15 de novembro de 2014

A first course in computational physics

==========
Devries, Paul L. ; Hasbun, Javier E. A first course in computational physics. Second edition. Jones and Bartlett Publishers: 2011.
============

Computer have changed the way physics is done, but those changes are only slowly making their way into the typical curriculum. This book is designed to help speed that transition. Computational physics is now widely accepted as a third, equally valid complement to traditional experimental and theoretical physics.
The simple truth is that the computer now permeates our society and has changed the way we think about many things, including science in general and physics in particular. It used to be that there was theoretical physics, which dealt with developing and applying theories, often with an emphasis on mathematics and "rigor." There was experimental physics, which was also concerned with theories, and testing their validity in the laboratory: but was primarily concerned with making observations and quantitative measurements. Now there is computational physics, in which numerical experiments are performed in the computer laboratory - an interesting marriage of the traditional approaches to physics. Canned programs rarely exist for novel, interesting physics, and so we have to write them ourselves. The capability of visualizing a numerical solution as it is being generated is a tremendous tool in understanding both the solution as well as the numerical methods. The integration of such graphics capabilities into the computing environment is one of the many strengths of Matlab.
Matlab®
There is a large variety of computer languages out there that could be ( and are) used in computational physics: BASIC, C, FORTRAN, and JAVA, each has its ardent supporters. These languages have supporters because they all have their particular merits, which should not be lightly dismissed. What sets Matlab apart is its widespread use and acceptance in the Mathematics and particularly Engineering curriculum. As far as computer programming is concerned, this text is primarily concerned with how to perform a scientific calculations, not in how to code a particular statement.
Functions and Roots
A natural place for us to begin our discussion of computational physics is with a discussion of functions. After all, the formal theory of functions underlies virtually all of the scientific theory, and their use is fundamental to any practical method of solving problems. We will discuss some general properties, but always with an eye toward what is computationally applicable. In particular, we will discuss the problem of finding the roots of a function in one dimension. This is important mentioning that Matlab has several built-in functions for determining the roots of functions.
Finding the roots of a function
Closed-form solutions for the roots exist for quadratic, cubic, and quartic exquations as well, although they become rather cumbersome to use. But no general solution exists for polynomials of fifth-order and higher. Many equations have no analytical solution at all. So what we are really seeking is a method for solving for the root of a nonlinear equation. What we would like to have is a reliable numerical method that will provide accurate results with a minimum of human intervention.
The bisection method is the simplest scheme for roots finding. You just must:
  1. Find an interval:  this is expected that the root is inside;
  2. Half the interval:  the internal is divided into two parts;
  3. Choose the good half: one of the half must contain the root;
  4. Reset the extremes: if the root is at the right, the middle is the right extreme value, otherwise the middle is the left extreme:
  5. Start again: repeats the process from 1, where the new intervals are
It is extremely important to use functions to break the code into manageable pieces. This modularity aids immensely in the clarity and readability of the code - the main program simply becomes a list of calls to the various functions, so that the overall logic of the program is nearly transparent.
Recursive algorithm
Matlab allows a function to call other function. This permits us to break a large programming task into a sequence of smaller and smaller ones, until we get to a point where it is easy to solve. Furthermore, a function can call itself. There are problems that naturally lend themselves to a recursive solutions and the root finding is one of them.
Taylor’s Series
In 1715 Brook Taylor, secretary of the Royal Society, published Methodus incrementorum directa et inversa in which appears one of the most useful expression in much of mathematics and certainly numerical analysis. Although previously known to the Scottish mathematician James Gregory, and probably to Jean Bernoulli as well, we know it as the Taylor Series.
Interpolation and approximation
In some case of roots finding, an approximation to a function is useful to finding roots, even though we had the exact function at our disposal. A more common circumstance is that we do not know the exact function, but build our knowledge of it as we acquire more information about it. Several ways to approximate a function and its derivatives exist. With interpolation, an approximating polynomial us found that exactly describes the function being approximated at a set of specified points. Curve fitting approximates a function in a general sense, without being constrained to agree with the function at every point. 



Clinical pharmacokinetics and pharmacodynamics: concepts and applications


=====
Malcolm Rowland, Thomas N Tozer, Clinical pharmacokinetics and pharmacodynamics: concepts and applications. Fourth Edition. Lippincott and Wilkins: 2011.
=====

Pharmacokinetics and pharmacodynamics are cornerstones in the industrial design, selection, and development of new drugs.
Understanding why individuals vary in their response to drugs is central to personalizing drug therapy.

Basic considerations

Therapeutic Relevance

Those patients who suffer from chronic ailments such as diabetes or epilepsy may have to take drugs every day for the rest of their lives. At the other extreme are those who take a single dose of a drug to relieve an occasional headache. The duration of drug therapy is usually between these extremes. The manner in which a drug is take is called a dosage regimen.
What determines the therapeutic dose of a drug and its manner and frequency of administration, as well as events experienced over time by patients on taking the recommended dosage regimens, constitutes the body of the textbook.
Input-response phases   

Progress has only been forthcoming by realizing that concentrations at active sites, rather than dose admistered, drive responses, and thta to achieve and maintain a response, it is necessary to ensure the generation of the appropriate exposure-time profile of drug within the body, which in turn requires an understanding of the factors controlling this exposure profile.

The issue of time delays between drug administration and response is not confined to pharmacokinetics but extends to pharmacodynamics too. Part of this delay is a result of the time required for the drug to distribute to the target site, which is often in a cell within  in a organ or tissue, such as the brain. Part is also a result of delays within the affected system within the body.
  
Side-effects. A common and clinically significant toxicity of many anticancer drugs is leukopenia, an abnormal fall in the number of leukocytes in blood.

The lesson is clear: understanding the specific concentration-response time relationships help in the management and optimal used of drugs.
   
Variability in drug response

If we were all alike, there would only be one dose strength and regimen of a drug needed for the entire patient population.

 Fundamental concepts and terminology
This chapter introduces input-exposure (pharmacokinetics) and exposure-response (pharmacodynamics)  relationship and defines the terms commonly used in these areas.
Applications of pharmacokinetics and pharmacodynamics in drug therapy:
ü      To relate temporal patterns of response to drug administration following acute and chronic dosing;
ü      To help provide a rational basis for drug design, drug selection, and dosage regimen design:
ü      To provide a means for rationally initiating and individualizing drug administration in patients;
A distinction must be made between those drugs that act locally and those that act systematically. Locally acting drugs are administered at the local site where they are needed such as eye drops, nasal sprays, intravaginal creams, and topical preparations for treating skin diseases. It is given emphasis to those drugs that act within the blood or that must delivered to the site of action by the circulatory system, we say such drugs act systemically.

Kinetics following and intravenous bolus dose 

Administering a drug intravenously ensures that the entire dose enters the systematic circulation. By rapid injection, elevated concentrations of drug can be promptly achieved; by continuous infusion at a controlled rate, a constant concentration, and often response, can be maintained. With no other route of administration can plasma concentration be as promptly and efficiently controlled. Of the two intravascular routes, the i.v one is the most frequently employed. Intra-arterial administration, which has greater inherent manipulative dangers, is reserved for situations in which drug localization in a specific organ or tissue is desired. It is achieved by inputting drug into the artery directly supplying the target tissue.
Appreciation of kinetics concepts  
Why do we get a linear decline when plotting the data on a semilogarithmic scale, and what determines the large difference seen in the profiles for the various drugs?
Volume of distribution and clearance 


Schematic diagram of a perfused organ system. Drug placed into a well-stirred reservoir,
volume V, from which fluid perfuses an extractor at flow rate Q.
The rate of extraction can be expressed as a fraction E of the of presentation, Q.C.
The rate that escaping drug returns to the reservoir is Q.Cout. For modeling purposes,
the amount of drug in the extractor is negligible compared
to the amount of drug 
contained in the reservoir. 

Clearance is the volume of the fluid to the eliminating organ, extractor, that is efficiently, completely cleared of drug per unit of time.

Membranes and distribution
So far emphasis was placed on general input-exposure relationships after a single intravenous (i.v) bolus. Now we focus on the role and function of membranes primarily in the context of determinants of drug distribution, the principles apply as well to drug elimination and absorption. Drugs must also pass through membranes to reach the site of action. This chapter also explores the process of distribution itself and its role in clinical pharmacokinetics from a physiologic point of view.
Membranes
Movement through membranes is known as drug transport.

Elimination

This chapter is concerned with the elimination processes and particularly with the concept of clearance. In the chapter kinetics following an intravenous bolus dose, the method of quantifying clearance following a single dose iv bolus was presented. Herein its physiologic meaning is given. 


sábado, 8 de novembro de 2014

Dimerization and receptor-receptor interactions (papers)


Dimerization and ligand binding

Fanelli et al (2011).

Allosteric proteins
In biochemistryallosteric regulation is the regulation of an enzyme or other protein by binding an effector molecule at the protein's allosteric site (i.e, a site other than the protein's active site).


Effectors that enhance the protein's activity are referred to as allosteric activators, whereas those that decrease the protein's activity are called allosteric inhibitors.

Source: google image, 2014


G protein-coupled receptors (GPCRs), also known as seven-transmembrane domain receptors constitute a large protein family of receptors that sense molecules outside the cell and activate inside signal transduction pathways and, ultimately, cellular responses.

In humans, there are four types of adenosine receptors. Each is encoded by a separate gene and has different functions, although with some overlap. Both A1 receptors and A2A play roles in the heart, regulating myocardial oxygen consumption and coronary blood flow, while the A2A receptor also has broader anti-inflammatory effects throughout the body.

A2AR dimerization affects the communication networks intrinsic to the receptor fold in a way dependent on the dimer architecture.

G protein Coupled Receptors (GPCRs) are allosteric proteins whose functioning fundamentals are the communication between the two poles of the helix bundle.

The representation of GPCR structures as Networks of Interacting Amino Acids (NIAA) can be a meaningful way to decipher the impact of ligand and of dimerization oligomerization on the molecular communication intrinsic to the protein fold.

Dimerization and ligand binding effect the structure network of A2A adenosine receptor

It is known that dimerization is a byproduct of evolution rather than instantaneous phenomenon. On the other hand, ligand binding, in spite of the fact of being well defined by evolution itself, is a phenomenon that happens on the moment, it does not exist, unless the ligand is on the range of reaching. In essence, we have two phenomena in different timescales: seconds and decades.

Bioinformatics and mathematical modelling

Guidolin et al (2011).

"A fundamental consequence of the view describing GPCRs as interacting structures, with the likely formation at the plasma membrane of receptor aggregates of multiple receptors (Receptor Mosaics) is that it is no longer possible to describe signal transduction simply as the result of the binding of the chemical signal to its receptor, but rather as the result of a filtering/integration of chemical signals by the Receptor Mosaics (RMs) and membrane-associated proteins.“

"....integrative functions emerging from the complex behaviour of these RMs"

"The concept of intra-membrane receptor–receptor interactions (RRIs) between different types of GPCRs and evidence for their existence was introduced by Agnati and Fuxe in 1980/81 through analysis of the effects of neuropeptides on the binding characteristics of monoamine receptors in membrane preparations from discrete brain regions"

"the hypothesis of high-order GPCR oligomers implies the existence of specific interaction interfaces allowing the assembly of macromolecular complexes."

"Experimental research, significant efforts were spent in bioinformatics to provide suggestions on the protein regions potentially playing a role in dimerization/oligomerization".

A first important consequence of such an arrangement is that the decoding process becomes a branched process (bifurcations) already at the receptor level in the plasma membrane allowing the different activation of some of the possible intracellular molecular pathways.

A second theoretical consequence is that some engrams can be stored.

Allosteric perturbations involve a shift of a population of pre-existing conformations.

Allostery can occur without a change in shape but purely in dynamics.



All of these analyses only provide suggestions that should be confirmed by experimental data since these studies, in general, do not consider several variables such as the micro-environment where the GPCRs are localized.

G-protein-coupled receptor dynamics: dimerization and activation models compared with experiment

 Taddese et al (2012).

 GPCRs (G-protein-coupled receptors) are dynamic structures, as shown by their ability to dimerize, domain swap, oligomerize, activate G-proteins, and signal via arrestin.

Molecular dynamics is well suited to studying protein dynamics.

This provides evidence that bivalent ligands may indeed interact with 
two binding sites in two receptors.

The receptor–dimer cooperativity index

 
Casadó et al (2007).

Almost all existing models that explain heptahelical G-protein-coupled receptor (GPCR) operation 
are based on the occurrence of monomeric receptor species.
However, an increasing number of studies show that many G-protein-coupled heptahelical 
membrane receptors (HMR) 
are expressed in the plasma membrane as dimers.

"HMR are a superfamily of receptors with enormous current and future therapeutic potential."

The main aim of any of those models was to 
explain the behaviour of G protein-coupled receptors (GPCR).

The majority of the models devised for HMR comes from the noncooperative 3-state mechanism 
proposed 50 years ago 
to explain the behaviour of nicotinic acetylcholine receptors, 
which are ligand-gated ion channels but not HMR

Some models for non-interactive receptors


The model considers an orthosteric center 
where the agonist binds and subsequently displaces the equilibrium towards the active state.

Some models for non-interactive receptors
They may modify the value of the dissociation constant (KD) of the agonist but not the total amount of receptors (RTotal). 

The G protein, acting as an allosteric modulator, modifies the agonist binding and/or affects the equilibrium between R and R*.
Since the allosteric modulator (in this case the G protein) does not compete with orthosteric compounds, maximum binding is not affected but KD is.


None of these models is however able to satisfactorily explain the binding characteristics of receptors displaying biphasic binding isotherms (e.g., nonlinear Scatchard plots), such as, profiles of agonist binding to the orthosteric center with Hill coefficients different from 1

Single-molecule imaging revealed dynamic GPCR dimerization   Kasai and  Kusumi (2014). 

"G-protein-coupled receptors (GPCRs) undergo dynamic equilibrium between monomers and dimers"

"Within one second, GPCRs typically undergo several cycles of monomer and homo-dimer formation with different partners."

"Many GPCR dimers reported in the literature might actually be artifacts due to overexpression, particularly in the case of the class-A GPCRs"


Papers

Francesca Fanelli, Angelo Felline, Dimerization and ligand binding affect the structure network of A2A adenosine receptor, Biochimica et Biophysica Acta 1808 (2011) 1256–1266.  
Diego Guidolin, Francisco Ciruela, Susanna Genedani, Michele Guescini, Cinzia Tortorella, Giovanna Albertin, Kjell Fuxe, Luigi Francesco Agnati. Bioinformatics and mathematical modelling in the study of receptor–receptor interactions and receptor oligomerization. Biochimica et Biophysica Acta 1808 (2011) 1267–1283.
Bruck Taddese, Lisa M. Simpson, Ian D. Wall, Frank E. Blaney, Nathan J. Kidley, Henry S.X. Clark, Richard E. Smith, Graham J.G. Upton, Paul R. Gouldson, George Psaroudakis, Robert P. Bywater and Christopher A. Reynolds, G-protein-coupled receptor dynamics: dimerization and activation models compared with experiment. Biochemical Society Transactions (2012) Volume 40, part 2.
Vincent Casadó, Antoni Cortés, Francisco Ciruela, Josefa Mallol, Sergi Ferré, Carmen Lluis, Enric I. Canela, Rafael Franco. Old and new ways to calculate the affinity of agonists and antagonists interacting with G-protein-coupled monomeric and dimeric receptors: The receptor–dimer cooperativity index. Pharmacology & Therapeutics 116 (2007) 343–354
Rinshi S Kasai and Akihiro Kusumi. Single-molecule imaging revealed dynamic GPCR dimerization. Current Opinion in Cell Biology 2014, 27:78–86.

domingo, 2 de novembro de 2014

An introduction to systems biology (ongoing)



An introduction to systems biology
Design principles of biological circuits

Uri Alon


Alon, Uri. An Introduction to systems biology: design principles of biological circuits. Chapman & Hall/CRC, 2006.
 

sábado, 18 de outubro de 2014

An introduction to optimal control problems in life sciences and economics



Review by
Jorge Guerra Pires
Department of Information Engineering, Computer Science and Mathematics
University of L'Aquila, Italy
Institute of Systems Analysis and Computer Science (IASI)
Cosiglio Nazionale  delle Ricerche (CNR) Rome, Italy
CAPES Foundation, Ministry of Education of Brazil
Email: jorgeguerrapires@yahoo.com.br

Created on: 17/10/2014
Comment: this is mathematical based approach. It is a interesting reading for people studying optimal control from a practical point of view, but mathematical driven studies. For a more engineering driven approach, see S Lenhart, J T Workman, Optimal Control Applied to biological models, Chapman & Hall/ CRC, Mathematical and Computational Biology Series, 2007 (review on the way). This is a nice reading for being done in parallel with this or even after.  George W Swan, Applications of optimal control theory in biomedicine, Pure and Applied Mathematics. Marcel Dekker Inc, 1984 is a second nice reading to accompany the same book (review on the way).

Last review: 17/10/2014
Review class: short.
Keywords:  Finite Differences Method, Numerical Schemes, Applied Optimal Control, Pontryagin's Principle, age-structured population models, diffusive models.

For a complete text, please, download the PDF.

========
Sebastian Anița, Viorel Arnăutu, Vincenzo Capasso, An introduction to optimal control problems in life sciences and economics: from mathematical models to numerical simulation with Matlab®, Modeling and Simulation in Science, Engineering and Technology, Birkhäuser, 2011. 
========

An introduction to MATLAB®. Elementary models with applications

MATLAB (MATrix LABoratory) is a very flexible and simple programming language tool. But it can be used as high-level programming language. Matlab is our choice because it offers some important advantages in comparison to other programming languages.

Arrays and matrix algebra

The basic element of MATLAB, hereafter written as Matlab for simplicity, is the matrix. Even a simple variable is considered as a 1-by-1 matrix. The basic type is double (8 bytes).
Some commands:

  • Format short: this will make Matlab uses a short number representation;
  • Format long: this will make Matlab releases a long number representation;
  • Format short e: this will make Matlab uses floating point, the style sometimes is referred as scientific notation;
  • Format long e: this will make Matlab uses floating point, the style sometimes is referred as scientific notation. For short it uses 5 digits whereas for long it uses 15 digits;
  • Format short g: best between fixed or floating point representation with 5 digits;
  • Format long g: best between fixed or floating point representation with 15 digits;

The first is the Matlab default choice. See as well printf and vpa for further numerical representation capability. 

Arrays. There are no statements for declaring the dimensions of an array. The components of an array may be real numbers, complex numbers, or any Matlab expression. Important. if you give value for a component for which the predecessors were not initiated, the same ones will be given zero as value.  [] can be used to eliminate rows and columns at once, this is not necessary to make it step by step such as in C++ or Java, do it directly. See ones and eye functions, the former creates a vector or matrix of ones and the latter the identity. For matrix dimensionality measures, see length and size functions, the former gives you the vector/matrix length in number of elements whereas the latter gives you the line and the column number. For matrix manipulations, the interesting to mention is: P=A.*B, gives a matrix with the same dimension in which the elements are multiplied one by one, aij*bij, this is not the conventional matrix multiplication. For P=A./B it follows the same rule, but division rather than multiplication.

Important. The Gaussian elimination algorithm is implemented to solve linear algebraic systems. You can alternatively apply: A_aux=inv(A), and T=A_aux*D, where the linear system to be solved is AT=D; in this case you are using the inverse of the coefficient matrix instead, theoretically this approach is more probe to roundoff errors. And another possibility is using the LU decomposition: [L,U]=lu(A), L_aux=inv(L) and U_aux=inv(U), A_aux=L_aux* L_aux, and finally T=A_aux*D. Apparently the results are the same.  

Simple 2D graphics. By plot (x,y), given they have the same dimensions, we get a graph of  x vs. y, whereas by plot (y) we get a graph of y vs. its indexes. Several others functions for plot  is available such as xLabel, that gives a name for the x-axis.

Script files and function files. All Matlab files have the extension m, e.g rootfiders.m . Type edit for accessing the editor window. A script file is the main routine of a program, the driver directions. On the other hand, the function files contain specific direction such as the ones in Matlab, the built-in functions. The script files can follow any template you please, but the function file should start with function and has the same name as the file itself, for who is familiar with Java this is the same as it happens with the main class. Functions can be either void, just input and no output, or returning type, it returns the calculations. For the former the template is function name (inputs), whereas for the latter it is function outputs = name (inputs). This is a good programming practice to write down support to the users, it serves even for you in a memory failure. For that, just use % in each line you want to comment, the first comments after the function header will be displayed as help for the user when they type help and the function name, the same way it occurs with conventional Matlab functions.

I/O statements. In Matlab you can ask the user to enter data just by using: variable=input (‘please, enter the value for variable 1’). Use \n for jumping one line. For strings, we must use: name=input(‘what is your name’, ‘s’). num2string(a) transforms the string a into a numerical variable.

Roots and minimum points of 1D functions. For root finding, just use fzero (‘f’,r0), where f is the function name, defined in a m-file like style and r0 is the initial guess for the root of the function. Further, fzero (‘f’,[r0 r1])  can be used to represents an interval for searching rather than a singled-value guess. An alternative approach for the m-file creation is using inline function. Just use f=inline (‘x*x-3’) and procedure normally. For polynomial functions, we can additionally use roots, the input is a vector with the coefficients from the higher degree to the smallest. For finding the optimal of a function, just apply fminbnd (f, -1, 1, 1), where is a inline function therefore no prime is used, the first two numbers are the bounds for the optimal search, and the last activates the storing-pathway search.

Arrays-smart function. All built-in functions in Matlab is array-smart, this means that you do not have to write for sentences for entering a vector values, just enter the value normally the output will be a vector or matrix correspondent in dimension. This is suggested that whenever one programs its own function, use array-smart tricks such as x.*x, the dot is used in Matlab for “discretizing” the operation, element by element.

Global Variables. Any variable can be shared by all function and the workplace, just declare it as global. See that several books in computer programming practices does not advise the usage of global variables, besides this is widely used by Matlab programmers.

Models with Ordinary Differential Equations ODEs. The ODE23 is a ODE solver by Runge-Kutta method is other 2 or 3, by adapting steps. Equally one can apply ODE34.  


  
Optimal Control of ordinary differential systems. Optimality conditions

            This chapter and the next one are devoted to some basic ideas and techniques in optimal control theory of ordinary differential systems. We do not treat the optimal control problem or Pontryagin's principle in their most general form; instead we prefer  direct approach to some significant optimal control problems in life sciences and economics governed by ordinary differential systems. The main goal of this chapter is to prove the existence of an optimal control and to obtain first-order necessary conditions of optimality (Pontryagin's principle) for some significant optimal control problems.

 =========

Comments section

As mentioned before the authors have decided to use Matlab as their software, indeed this is a good choice. However, I myself would pinpoint two points regarding Matlab, firstly this is not free, this could limit the usability of the theory presented. This is not always the case, on Lenhart and Workman (2007) they use Matlab as well, but the code is so generic that it can be adapted to any other language, you just need a txt of the code and knowledge of Matlab syntax. Secondly, even if this is not the case, in some situations Matlab indeed can be slow. One of the biggest advantage of using Matlab, besides its simplicity in the programming syntax, is the graphical capability, it is easy and nice to use.
=================



general optimal control problem


Lotka-Volterra system