Dynamic Infinity Mapping Framework (DIMF): An Adaptive Oncology Dosing Reinforcement Learning Approach

Dynamic Infinity Mapping Framework (DIMF): An Adaptive Oncology Dosing Reinforcement Learning Approach Author- Shrishti Rastogi Abstract Dynamic Infinity Mapping Framework (DIMF) is a new computational paradigm to manage the stochastic evolution of subpopulations of cancer cells under therapeutic pressure. DIMF combines Markov Decision Processes (MDP), Dynamic Graph Neural Networks (GNNs), and Reinforcement Learning (RL) to offer a powerful framework for optimising the dosage of multiple drugs adaptively. This report outlines the mathematical modelling of state transitions, algorithmic implementation of the RL agent and an empirical calibration using quantitative interaction and toxicity data from the large clinical trials. Our framework shows better ability to cross the balance line between therapeutic effect and total toxicity than static modelling methods. Introduction New challenges for modern oncology are the emergence of acquired resistan...

Understanding Derivatives in Piecewise Continuous Functions: Continuity, Differentiability, and Applications

Understanding Derivatives in Piecewise Continuous Functions: Continuity, Differentiability, and Applications

Derivatives of Piecewise Functions Continuity & Differentiability Explained with SageMath

1. Introduction

In mathematical analysis and applied physics, we frequently encounter piecewise continuous functions—functions that are continuous except for a finite number of jump discontinuities. While these functions may not be differentiable in the classical sense everywhere, distributional derivatives allow us to extend the concept of differentiation to such cases.

Key ideas:

  • The derivative of a piecewise continuous function involves Dirac delta functions at points of discontinuity.
  • For functions that are not locally summable, traditional differentiation fails; a functional (distributional) approach is required.
  • SageMath is a powerful open-source computational system that enables both symbolic and numerical manipulation of such generalized functions.

2. Theoretical Foundation

2.1. Piecewise Continuous Functions

Suppose a function \( 𝑓(𝑥) \) has jump discontinuities at points \( 𝑥_𝑘 \) , with corresponding jump magnitudes \( ℎ_𝑘 \). Then the generalized derivative of 𝑓(𝑥) is given by: \[ f'(x) = f_1'(x) + \sum_{k} h_k \delta(x - x_k) \]

  • \( f'_1(𝑥) \): classical derivative where it exists.
  • \( \delta (x-x_k) \):: Dirac delta function representing a point mass at \( x_k \).

2.2. Generalization for Non-Summable Functions

If \( 𝑓(𝑥) \) is not locally summable (e.g., \( ( f(x)=\frac{1}{x}) \), then: \[ (f', \varphi) = -\int_{-\infty}^{\infty} f(x) \varphi'(x) ,dx \]

This is a regularization by parts, defining a preferred extension of the derivative in the distributional sense. The result depends on the test function \( \varphi(𝑥) \), and the functional \( 𝑓′ \) is meaningful even when the classical derivative does not exist.

  • Coming up next: In the next blog, we will explore the derivative of the generalized function defined by \( f(x)=x_λ \) for 𝑥>0, illustrating how fractional exponents interact with distributional differentiation.

3. SageMath Implementation

We'll use Heaviside step functions to model discontinuities and represent the derivative using Dirac delta functions.

3.1. Defining Discontinuous Function

      
from sympy import Heaviside, DiracDelta
from sage.all import var

# Declare variables
x = var('x')
h1, h2, h3 = var('h1 h2 h3')
x1, x2, x3 = var('x1 x2 x3')

# Define piecewise function using SymPy's Heaviside step function
f_x = h1 * Heaviside(x - x1) + h2 * Heaviside(x - x2) + h3 * Heaviside(x - x3)

print("Piecewise function:", f_x)
	
    

Alternative: Use SageMath's piecewise()

      
from sympy import Piecewise, Heaviside, symbols

# Declare variables using SymPy
x = symbols('x')
h1, h2, h3 = symbols('h1 h2 h3')
x1, x2, x3 = symbols('x1 x2 x3')

# Define the piecewise function explicitly
f_x = Piecewise(
    (0, x < x1), 
    (h1, (x >= x1) & (x < x2)), 
    (h2, (x >= x2) & (x < x3)), 
    (h3, x >= x3)
)

print("Piecewise function:", f_x)
	
    

Alternative:Explicit numerical values instead of symbolic variables:

      
from sage.all import piecewise, var

# Declare Sage variables
x = var('x')
h1, h2, h3 = var('h1 h2 h3')

# Define piecewise function explicitly (using numeric bounds)
f_x = piecewise([((-10, 0), 0), ((0, 5), h1), ((5, 10), h2), ((10, 20), h3)])

print("Piecewise function:", f_x)
	
    

💡 Try It Yourself! Now You can copy and paste directly into here Run SageMath Code Here

3.2. Computing Generalized Derivative

      
# Derivative involves delta functions at points of discontinuity
f_prime = h1 * DiracDelta(x - x1) + h2 * DiracDelta(x - x2) + h3 * DiracDelta(x - x3)

print("Generalized derivative f'(x):", f_prime)
	
    

3.3. Regularization via Functional Approach

      
from sympy import Piecewise, Heaviside
from sage.all import var, integrate

# Define variables
x = var('x')
h1, h2, h3 = var('h1 h2 h3')
x1, x2, x3 = var('x1 x2 x3')

# Define piecewise function using Heaviside step functions
f_x = h1 * Heaviside(x - x1) + h2 * Heaviside(x - x2) + h3 * Heaviside(x - x3)

# Define test function φ(x)
phi_x = var('phi_x')

# Integration by parts to define the functional form
regularized_f_prime = -integrate(f_x * phi_x, x)

print("Regularized derivative:", regularized_f_prime)
	
    

4. Conclusion

  • Dirac delta functions effectively capture jump discontinuities in the derivative of piecewise continuous functions.
  • For non-summable functions, differentiation must be defined in the distributional sense, using integration by parts.
  • SageMath provides symbolic tools that allow you to model, compute, and visualize such generalized expressions accurately.

Next upcoming

In the next blog, we will explore a different case: finding the derivative of the generalized function defined by \( f(x) = x^\lambda \) for ( x > 0 ) and 0 elsewhere. This example illustrates how fractional exponents interact with distributional differentiation, offering insights into singularity handling and functional extensions.

Comments

Popular posts from this blog

Understanding the Laplacian of 1/r and the Dirac Delta Function Mathematical Foundations & SageMath Insights

Heuristic Computation and the Discovery of Mersenne Primes

Neural Network Generalization in the Over-Parameterization Regime: Mechanisms, Benefits, and Limitations