janhardo

545 Reputation

11 Badges

10 years, 306 days

MaplePrimes Activity


These are replies submitted by janhardo

@vv 
This is a super Direct Method ..lol
no, the direct methode is named to someone

restart;
with(plots):

### Voorwaarden ###
assume(x::real, y::real);
additionally(cosh(2*y) - cos(2*x) <> 0);  # Voorkom singulariteit

### Stap 1: Definieer u(x,y) ###
u := sin(2*x)/(cosh(2*y) - cos(2*x));
print("Stap 1: Gegeven reëel deel u(x,y):");
print(u);

### Stap 2: Controleer harmoniciteit ###
laplacian_u := diff(u, x$2) + diff(u, y$2);
simplified_laplacian := simplify(laplacian_u) assuming cosh(2*y) - cos(2*x) <> 0;
print("Stap 2: Laplaciaan van u (moet 0 zijn):");
print(simplified_laplacian);

if simplified_laplacian = 0 then
    print("u is harmonisch ");
else
    print("u is NIET harmonisch ");
    return;
end if;

### Stap 3: Cauchy-Riemann - bereken afgeleiden ###
ux := diff(u, x):
uy := diff(u, y):
print("Stap 3: Partiële afgeleiden van u:");
print("∂u/∂x =", simplify(ux));
print("∂u/∂y =", simplify(uy));

### Stap 4: Integreer voor v(x,y) ###
v_x := -uy;
v := int(v_x, x) + C1;  # C1 is integratieconstante
print("Stap 4: v(x,y) (inclusief C1):");
print(simplify(v));

### Stap 5: Harmonisch geconjugeerde functie ###
print("Stap 5: C1 = constante, dus behouden");
f_xy := u + I*v;
print("Stap 6: Analytische functie f(x,y):");
print(simplify(f_xy));

### Stap 6: Vergelijk met cot(z) ###
f_xy := subs(C1 = 0, f_xy);  # Constante = 0 voor vergelijking
cot_z := sin(2*x)/(cosh(2*y) - cos(2*x)) - I*sinh(2*y)/(cosh(2*y) - cos(2*x));
difference := simplify(f_xy - cot_z);
print("Stap 7: Verschil tussen f(x,y) en cot(z):");
print(difference);

if difference = 0 then
    print(" f(z) = cot(z)");
else
    print(" f(z) ≠ cot(z), verschil ≠ 0 (controle C1?)");
end if;

### Stap 8: Plot ter verificatie ###
plot3d(u, x = -Pi .. Pi, y = -1 .. 1, title = "Reëel deel u(x,y)");
plot3d(Im(subs(C1=0, f_xy)), x = -Pi .. Pi, y = -1 .. 1, title = "Imaginaire deel v(x,y) (C1=0)");
 

sin(2*x)/(cosh(2*y)-cos(2*x))

 

"Stap 1: Gegeven reëel deel u(x,y):"

 

sin(2*x)/(cosh(2*y)-cos(2*x))

 

-4*sin(2*x)/(cosh(2*y)-cos(2*x))-12*cos(2*x)*sin(2*x)/(cosh(2*y)-cos(2*x))^2+8*sin(2*x)^3/(cosh(2*y)-cos(2*x))^3+8*sin(2*x)*sinh(2*y)^2/(cosh(2*y)-cos(2*x))^3-4*sin(2*x)*cosh(2*y)/(cosh(2*y)-cos(2*x))^2

 

0

 

"Stap 2: Laplaciaan van u (moet 0 zijn):"

 

0

 

"u is harmonisch ✅"

 

"Stap 3: Partiële afgeleiden van u:"

 

"&PartialD;u/&PartialD;x =", (-2+2*cos(2*x)*cosh(2*y))/(-cosh(2*y)+cos(2*x))^2

 

"&PartialD;u/&PartialD;y =", -2*sin(2*x)*sinh(2*y)/(cosh(2*y)-cos(2*x))^2

 

2*sin(2*x)*sinh(2*y)/(cosh(2*y)-cos(2*x))^2

 

-sinh(2*y)/(cosh(2*y)-cos(2*x))+C1

 

"Stap 4: v(x,y) (inclusief C1):"

 

-sinh(2*y)/(cosh(2*y)-cos(2*x))+C1

 

"Stap 5: C1 = constante, dus behouden"

 

sin(2*x)/(cosh(2*y)-cos(2*x))+I*(-sinh(2*y)/(cosh(2*y)-cos(2*x))+C1)

 

"Stap 6: Analytische functie f(x,y):"

 

(I*C1*cosh(2*y)-I*C1*cos(2*x)-I*sinh(2*y)+sin(2*x))/(cosh(2*y)-cos(2*x))

 

sin(2*x)/(cosh(2*y)-cos(2*x))-I*sinh(2*y)/(cosh(2*y)-cos(2*x))

 

sin(2*x)/(cosh(2*y)-cos(2*x))-I*sinh(2*y)/(cosh(2*y)-cos(2*x))

 

0

 

"Stap 7: Verschil tussen f(x,y) en cot(z):"

 

0

 

"✅ f(z) = cot(z)"

 

 

 
 

 

Download 2-4-2025_mprimes_How_to_solve_analytics_function-@adedayo.mw

scheme of seirpt  model

Summarize model working

Next step is to develop a interactive worksheet to get more insight in this seirpt model 

SEIRTP_R0_sensitivity_report := proc(params::list, normalize::boolean := true)
description "R Sensitivity Analysis – Table + Barplot + Dynamic Policy Advice for SEIRTP model with compartment effects";

global comp_matrix_export, comp_matrix_labels;

local Lambda, alpha, beta, r, xi, K, eta, phi, mu, sigma, tau, theta, delta, gamma_;
local Ro, Ro_num, dp, Sp, p, i, paramlist, param_names, values, label_list, maxval;
local param_values, n_params, barplot, interpretation, recommendations, threshold;
local dir, advice, v, comp_labels, comp_effects, all_effects, j;

# Full symbolic parameter list
paramlist := [Lambda, alpha, beta, r, xi, K, eta, phi, mu, sigma, tau, theta, delta, gamma_];
param_names := ["Λ", "α", "β", "r", "ξ", "K", "η", "φ", "μ", "σ", "τ", "θ", "δ", "γ"];
n_params := nops(paramlist);
param_values := [seq(rhs(params[i]), i=1..n_params)];

# R formula
Ro := (Lambda*alpha*beta*r*xi*(-K*eta*phi + K*eta*r - r)) /
      (mu*(K*phi*sigma - K*r*sigma - r*tau)*
      (K*beta*eta*phi - K*beta*eta*r + beta*r + mu*r + r*theta)*(delta + gamma_ + mu));

printf("\n�� SEIRTP-Parameterverklaring / Parameter Descriptions:\n");
printf("╔════════════╦════════════════════════════════════════════════════════════╗\n");
printf("║ Parameter  ║ Beschrijving (NL) / Description (EN)                      ║\n");
printf("╠════════════╬════════════════════════════════════════════════════════════╣\n");
printf("║ Λ (Lambda) ║ Instroom / geboorteratio – inflow rate / birth rate       ║\n");
printf("║ α (alpha)  ║ Infectieratio bij contact – infection probability         ║\n");
printf("║ β (beta)   ║ Contactfrequentie – contact rate                          ║\n");
printf("║ r          ║ Detectieratio / testintensiteit – detection rate          ║\n");
printf("║ ξ (xi)     ║ Tracing efficiëntie – tracing effectiveness               ║\n");
printf("║ K          ║ Zorgcapaciteit – healthcare system capacity               ║\n");
printf("║ η (eta)    ║ Snelheid van ziek worden – progression to infectious      ║\n");
printf("║ φ (phi)    ║ Behandelingsimpact – treatment effect on transmission     ║\n");
printf("║ μ (mu)     ║ Natuurlijke sterfte – natural death rate                  ║\n");
printf("║ σ (sigma)  ║ Sterfte bij behandeling – death during treatment          ║\n");
printf("║ τ (tau)    ║ Behandelduur – duration of treatment                      ║\n");
printf("║ θ (theta)  ║ Terugval / herinfectie – relapse or reinfection rate      ║\n");
printf("║ δ (delta)  ║ Infectie-specifieke sterfte – infection-induced mortality ║\n");
printf("║ γ (gamma)  ║ Herstelkans – recovery rate                               ║\n");
printf("╚════════════╩════════════════════════════════════════════════════════════╝\n\n");

Ro_num := evalf(subs(paramlist =~ param_values, Ro));
if Ro_num = 0 then error "R = 0, normalization not possible"; end if;

printf("�� R computed = %.5f\n", Ro_num);
if abs(Ro_num - 1.0) < 0.01 then
    printf("⚖️  R ≈ 1 → Epidemic threshold.\n");
elif Ro_num < 1.0 then
    printf(" R < 1 → Outbreak likely to die out.\n");
else
    printf("�� R > 1 → Epidemic spread possible.\n");
end if;

# Sensitivity values
values := [];
for i from 1 to n_params do
    p := paramlist[i];
    dp := evalf(subs(paramlist =~ param_values, diff(Ro, p)));
    Sp := dp * param_values[i] / Ro_num;
    values := [op(values), Sp];
end do;

if normalize then
    maxval := max(seq(abs(v), v in values));
    values := map(v -> v / maxval, values);
end if;

# Interpretation
interpretation := proc(val)
    if abs(val) >= 0.9 then return "�� Strong effect";
    elif abs(val) >= 0.4 then return "�� Moderate influence";
    elif abs(val) >= 0.01 then return "�� Small effect";
    else return "�� Negligible"; end if;
end proc:

# Sensitivity Table
printf("\n�� %s Sensitivity Index of R:\n", `if`(normalize, "Normalized", "Original"));
printf("--------------------------------------------------------------------------\n");
printf("%-13s | %-10s | %-30s\n", "Parameter", "S", "Interpretation");
printf("--------------------------------------------------------------------------\n");
for i from 1 to n_params do
    printf("%-13s | %+10.5f | %-30s\n", param_names[i], values[i], interpretation(values[i]));
end do;
printf("--------------------------------------------------------------------------\n");

# Policy Advice
threshold := 0.4;
printf("\n�� Dynamic Policy Implications:\n");
printf("--------------------------------------------------------------------------\n");
printf("%-13s | %-10s | %-30s\n", "Parameter", "Direction", "Policy Advice");
printf("--------------------------------------------------------------------------\n");
for i from 1 to n_params do
    if abs(values[i]) >= threshold then
        if values[i] > 0 then
            dir := "↑ Increase"; advice := "⚠️ Reduce to lower R";
        else
            dir := "↓ Decrease"; advice := " Increase to lower R";
        end if;
        printf("%-13s | %-10s | %-30s\n", param_names[i], dir, advice);
    end if;
end do;
printf("--------------------------------------------------------------------------\n");

# Compartment Effects Setup
comp_labels := ["S", "E", "I", "R", "P", "T"];
all_effects := table([
    Lambda = [1, 0, 0, 0, 0, 0],
    alpha  = [-1, 1, 1, 0, 0, 0],
    beta   = [0, -1, 1, 0, 0, 0],
    r      = [0, 0, 0, 0, 0, 1],
    xi     = [0, 0, 0, 0, 1, 0],
    K      = [0, 0, 0, 0, 0, 1],
    eta    = [0, -1, -1, 0, 0, 0],
    phi    = [0, 0, 0, 0, -1, 0],
    mu     = [-1, -1, -1, -1, -1, -1],
    sigma  = [0, 0, 0, 0, -1, 0],
    tau    = [0, 0, 0, 0, -1, 0],
    theta  = [0, -1, 0, 1, 0, 0],
    delta  = [0, 0, -1, 0, 0, 0],
    gamma_ = [0, 0, -1, 1, 0, 0]
]);

# Corrected matrix build using paramlist symbols
comp_effects := [seq(all_effects[paramlist[i]], i = 1..n_params)];
comp_matrix_labels := param_names;

# Export matrix
comp_matrix_export := comp_effects;

# Display Matrix
printf("\n�� Compartmental Effect Matrix (Qualitative):\n");
printf("--------------------------------------------------------------------------\n");
printf("%-10s | %3s %3s %3s %3s %3s %3s\n", "Parameter", op(comp_labels));
printf("--------------------------------------------------------------------------\n");
for i from 1 to nops(comp_effects) do
    printf("%-10s |", comp_matrix_labels[i]);
    for j to 6 do
        if comp_effects[i][j] = 0 then printf(" %3s", ".");
        elif comp_effects[i][j] > 0 then printf(" %3s", "+");
        else printf(" %3s", "-"); end if;
    end do;
    printf("\n");
end do;
printf("--------------------------------------------------------------------------\n");

# Optional Plot: UITGEZET werkt nog niet
##label_list := [seq(sprintf("%s (%s)", param_names[i], paramlist[i]), i=1..n_params)];
#barplot := plots:-barplot(label_list, values, orientation=horizontal,
             #title=sprintf("Sensitivity of R (%s)", `if`(normalize, "Normalized", "Original")),
             #width=0.6, color="CornflowerBlue", axes=boxed,
            # labels=["Parameter", "Sensitivity S"]);

#return barplot;

end proc:

params := [
  Lambda = 0.0133, alpha = 0.07954551, beta = 0.567, r = 0.076, xi = 0.0487,
  K = 300, eta = 0.009, phi = 0.09, mu = 0.00056, sigma = 0.000456,
  tau = 0.0900982, theta = 0.009, delta = 0.9, gamma_ = 0.00917
];
 

[Lambda = 0.133e-1, alpha = 0.7954551e-1, beta = .567, r = 0.76e-1, xi = 0.487e-1, K = 300, eta = 0.9e-2, phi = 0.9e-1, mu = 0.56e-3, sigma = 0.456e-3, tau = 0.900982e-1, theta = 0.9e-2, delta = .9, gamma_ = 0.917e-2]

(1)

SEIRTP_R0_sensitivity_report(params, true);   # Genormaliseerde sensitiviteit


�� SEIRTP-Parameterverklaring / Parameter Descriptions:
╔════════════╦════════════════════════════════════════════════════════════╗
║ Parameter  ║ Beschrijving (NL) / Description (EN)                      ║
╠════════════╬════════════════════════════════════════════════════════════╣
║ Λ (Lambda) ║ Instroom / geboorteratio – inflow rate / birth rate       ║
║ α (alpha)  ║ Infectieratio bij contact – infection probability         ║
║ β (beta)   ║ Contactfrequentie – contact rate                          ║
║ r          ║ Detectieratio / testintensiteit – detection rate          ║
║ ξ (xi)     ║ Tracing efficiëntie – tracing effectiveness               ║
║ K          ║ Zorgcapaciteit – healthcare system capacity               ║
║ η (eta)    ║ Snelheid van ziek worden – progression to infectious      ║
║ φ (phi)    ║ Behandelingsimpact – treatment effect on transmission     ║
║ μ (mu)     ║ Natuurlijke sterfte – natural death rate                  ║
║ σ (sigma)  ║ Sterfte bij behandeling – death during treatment          ║
║ τ (tau)    ║ Behandelduur – duration of treatment                      ║
║ θ (theta)  ║ Terugval / herinfectie – relapse or reinfection rate      ║
║ δ (delta)  ║ Infectie-specifieke sterfte – infection-induced mortality ║
║ γ (gamma)  ║ Herstelkans – recovery rate                               ║
╚════════════╩════════════════════════════════════════════════════════════╝

�� R computed = 1.54099
�� R > 1 → Epidemic spread possible.

�� Normalized Sensitivity Index of R:
--------------------------------------------------------------------------
Parameter     | S       | Interpretation                
--------------------------------------------------------------------------
Λ            |   +0.39683 | �� Small effect             
α            |   +0.39683 | �� Small effect             
β            |   +0.00442 | �� Negligible               
r             |   -1.00000 | �� Strong effect            
ξ            |   +0.39683 | �� Small effect             
K             |   +0.15556 | �� Small effect             
η            |   +0.00147 | �� Negligible               
φ            |   +1.00000 | �� Strong effect            
μ            |   -0.39733 | �� Small effect             
σ            |   +0.15409 | �� Small effect             
τ            |   -0.55091 | �� Moderate influence       
θ            |   -0.00416 | �� Negligible               
δ            |   -0.39258 | �� Small effect             
γ            |   -0.00400 | �� Negligible               
--------------------------------------------------------------------------

�� Dynamic Policy Implications:
--------------------------------------------------------------------------
Parameter     | Direction  | Policy Advice                 
--------------------------------------------------------------------------
r             | ↓ Decrease | Increase to lower R    
φ            | ↑ Increase | ⚠️ Reduce to lower R   
τ            | ↓ Decrease | Increase to lower R    
--------------------------------------------------------------------------

�� Compartmental Effect Matrix (Qualitative):
--------------------------------------------------------------------------
Parameter  |   S   E   I   R   P   T
--------------------------------------------------------------------------
Λ         |   +   .   .   .   .   .
α         |   -   +   +   .   .   .
β         |   .   -   +   .   .   .
r          |   .   .   .   .   .   +
ξ         |   .   .   .   .   +   .
K          |   .   .   .   .   .   +
η         |   .   -   -   .   .   .
φ         |   .   .   .   .   -   .
μ         |   -   -   -   -   -   -
σ         |   .   .   .   .   -   .
τ         |   .   .   .   .   -   .
θ         |   .   -   .   +   .   .
δ         |   .   .   -   .   .   .
γ         |   .   .   -   +   .   .
--------------------------------------------------------------------------

 

SEIRTP_R0_sensitivity_report(params, false);  # Originele sensitiviteit


�� SEIRTP-Parameterverklaring / Parameter Descriptions:
╔════════════╦════════════════════════════════════════════════════════════╗
║ Parameter  ║ Beschrijving (NL) / Description (EN)                      ║
╠════════════╬════════════════════════════════════════════════════════════╣
║ Λ (Lambda) ║ Instroom / geboorteratio – inflow rate / birth rate       ║
║ α (alpha)  ║ Infectieratio bij contact – infection probability         ║
║ β (beta)   ║ Contactfrequentie – contact rate                          ║
║ r          ║ Detectieratio / testintensiteit – detection rate          ║
║ ξ (xi)     ║ Tracing efficiëntie – tracing effectiveness               ║
║ K          ║ Zorgcapaciteit – healthcare system capacity               ║
║ η (eta)    ║ Snelheid van ziek worden – progression to infectious      ║
║ φ (phi)    ║ Behandelingsimpact – treatment effect on transmission     ║
║ μ (mu)     ║ Natuurlijke sterfte – natural death rate                  ║
║ σ (sigma)  ║ Sterfte bij behandeling – death during treatment          ║
║ τ (tau)    ║ Behandelduur – duration of treatment                      ║
║ θ (theta)  ║ Terugval / herinfectie – relapse or reinfection rate      ║
║ δ (delta)  ║ Infectie-specifieke sterfte – infection-induced mortality ║
║ γ (gamma)  ║ Herstelkans – recovery rate                               ║
╚════════════╩════════════════════════════════════════════════════════════╝

�� R computed = 1.54099
�� R > 1 → Epidemic spread possible.

�� Original Sensitivity Index of R:
--------------------------------------------------------------------------
Parameter     | S       | Interpretation                
--------------------------------------------------------------------------
Λ            |   +1.00000 | �� Strong effect            
α            |   +1.00000 | �� Strong effect            
β            |   +0.01113 | �� Small effect             
r             |   -2.51999 | �� Strong effect            
ξ            |   +1.00000 | �� Strong effect            
K             |   +0.39200 | �� Small effect             
η            |   +0.00370 | �� Negligible               
φ            |   +2.51999 | �� Strong effect            
μ            |   -1.00127 | �� Strong effect            
σ            |   +0.38830 | �� Small effect             
τ            |   -1.38830 | �� Strong effect            
θ            |   -0.01048 | �� Small effect             
δ            |   -0.98930 | �� Strong effect            
γ            |   -0.01008 | �� Small effect             
--------------------------------------------------------------------------

�� Dynamic Policy Implications:
--------------------------------------------------------------------------
Parameter     | Direction  | Policy Advice                 
--------------------------------------------------------------------------
Λ            | ↑ Increase | ⚠️ Reduce to lower R   
α            | ↑ Increase | ⚠️ Reduce to lower R   
r             | ↓ Decrease | Increase to lower R    
ξ            | ↑ Increase | ⚠️ Reduce to lower R   
φ            | ↑ Increase | ⚠️ Reduce to lower R   
μ            | ↓ Decrease | Increase to lower R    
τ            | ↓ Decrease | Increase to lower R    
δ            | ↓ Decrease | Increase to lower R    
--------------------------------------------------------------------------

�� Compartmental Effect Matrix (Qualitative):
--------------------------------------------------------------------------
Parameter  |   S   E   I   R   P   T
--------------------------------------------------------------------------
Λ         |   +   .   .   .   .   .
α         |   -   +   +   .   .   .
β         |   .   -   +   .   .   .
r          |   .   .   .   .   .   +
ξ         |   .   .   .   .   +   .
K          |   .   .   .   .   .   +
η         |   .   -   -   .   .   .
φ         |   .   .   .   .   -   .
μ         |   -   -   -   -   -   -
σ         |   .   .   .   .   -   .
τ         |   .   .   .   .   -   .
θ         |   .   -   .   +   .   .
δ         |   .   .   -   .   .   .
γ         |   .   .   -   +   .   .
--------------------------------------------------------------------------

 

Download mprimes_vraag_1-4-2025_SEIRTP_R0_sensitivity_report_.mw

restart;

SensitivityAnalysis := proc(
    Ro_expression::algebraic,
    parameters::list(name=algebraic),
    {normalization::identical("standard","bounded","sigmoid"):="bounded",
     display::boolean:=true}
)
    local param_names, param_values, sensitivity_indices, i, p_name, p_value,
          partial, raw_index, normalized_index, Ro_value, keys, p;
    
    # Evalueer Ro met de gegeven parameters
    Ro_value := eval(Ro_expression, parameters);
    
    # Extraheer parameter namen en waarden
    param_names := map(lhs, parameters);
    param_values := map(rhs, parameters);
    
    # Initialiseer resultatentabel
    sensitivity_indices := table();
    
    # Bereken gevoeligheid voor elke parameter
    for i to nops(param_names) do
        p_name := param_names[i];
        p_value := param_values[i];
        
        try
            # Bereken partiële afgeleide
            partial := diff(Ro_expression, p_name);
            
            # Bereken ruwe gevoeligheidsindex
            raw_index := eval(partial * p_value / Ro_value, parameters);
            
            # Pas geselecteerde normalisatiemethode toe
            if normalization = "standard" then
                normalized_index := raw_index;
            elif normalization = "bounded" then
                normalized_index := max(-1, min(1, raw_index));
            elif normalization = "sigmoid" then
                normalized_index := 2/(1+exp(-2*raw_index)) - 1;
            end if;
            
            # Sla resultaat op
            sensitivity_indices[p_name] := evalf(normalized_index);
        catch:
            # Als differentiatie faalt, wijs 0 toe (geen gevoeligheid)
            sensitivity_indices[p_name] := 0;
        end try;
    end do;
    
    # Toon resultaten als display=true
    if display then
        printf("\nGevoeligheidsanalyse Resultaten (%s normalisatie):\n", normalization);
        printf("============================================\n");
        printf("%12s %15s\n", "Parameter", "Gevoeligheid");
        printf("--------------------------------------------\n");
        
        keys := sort([indices(sensitivity_indices, 'nolist')]);
        for p in keys do
            if sensitivity_indices[p] <> NULL then
                printf("%12s %15.6f\n", p, sensitivity_indices[p]);
            else
                printf("%12s %15s\n", p, "N/B");
            end if;
        end do;
        printf("============================================\n");
    end if;
    
    # Geef resultaten terug
    return eval(sensitivity_indices);
end proc:

# Definieer het reproductiegetal Ro
Ro := (Lambda*alpha*beta*r*xi*(-K*eta*phi + K*eta*r - r))/
      (mu*(K*phi*sigma - K*r*sigma - r*tau)*
       (K*beta*eta*phi - K*beta*eta*r + beta*r + mu*r + r*theta)*
       (delta + gamma + mu));

# Definieer modelparameters
parameters := [
    Lambda = 0.0133,
    alpha = 0.07954551,
    delta = 0.9,
    K = 300,
    r = 0.076,
    tau = 0.0900982,
    gamma = 0.00917,
    mu = 0.00056,
    phi = 0.09,
    eta = 0.009,
    sigma = 0.000456,
    beta = 0.567,
    theta = 0.009,
    xi = 0.0487
];

# Voer analyse uit met verschillende normalisatiemethoden
standard_results := SensitivityAnalysis(Ro, parameters, normalization="standard", display=true);
bounded_results := SensitivityAnalysis(Ro, parameters, normalization="bounded", display=true);
sigmoid_results := SensitivityAnalysis(Ro, parameters, normalization="sigmoid", display=true);

Lambda*alpha*beta*r*xi*(-K*eta*phi+K*eta*r-r)/(mu*(K*phi*sigma-K*r*sigma-r*tau)*(K*beta*eta*phi-K*beta*eta*r+beta*r+mu*r+r*theta)*(delta+gamma+mu))

 

[Lambda = 0.133e-1, alpha = 0.7954551e-1, delta = .9, K = 300, r = 0.76e-1, tau = 0.900982e-1, gamma = 0.917e-2, mu = 0.56e-3, phi = 0.9e-1, eta = 0.9e-2, sigma = 0.456e-3, beta = .567, theta = 0.9e-2, xi = 0.487e-1]

 


Gevoeligheidsanalyse Resultaten (standard normalisatie):
============================================
   Parameter    Gevoeligheid
--------------------------------------------
           K        0.391999
      Lambda        1.000000
       alpha        1.000000
        beta        0.011135
       delta       -0.989305
         eta        0.003699
       gamma        0.000000
          mu       -1.001268
         phi        2.519994
           r       -2.519994
       sigma        0.388300
         tau       -1.388300
       theta       -0.010483
          xi        1.000000
============================================

 

table( [( tau ) = -1.388300446, ( sigma ) = .3883004457, ( Lambda ) = 1.000000001, ( alpha ) = 1.000000000, ( mu ) = -1.001267816, ( beta ) = 0.111348213e-1, ( phi ) = 2.519993613, ( r ) = -2.519993615, ( xi ) = 1.000000000, ( K ) = .3919990064, ( delta ) = -.9893045184, ( gamma ) = 0, ( eta ) = 0.36985611e-2, ( theta ) = -0.1048257226e-1 ] )

 


Gevoeligheidsanalyse Resultaten (bounded normalisatie):
============================================
   Parameter    Gevoeligheid
--------------------------------------------
           K        0.391999
      Lambda        1.000000
       alpha        1.000000
        beta        0.011135
       delta       -0.989305
         eta        0.003699
       gamma        0.000000
          mu       -1.000000
         phi        1.000000
           r       -1.000000
       sigma        0.388300
         tau       -1.000000
       theta       -0.010483
          xi        1.000000
============================================

 

table( [( tau ) = -1., ( sigma ) = .3883004457, ( Lambda ) = 1., ( alpha ) = 1., ( mu ) = -1., ( beta ) = 0.111348213e-1, ( phi ) = 1., ( r ) = -1., ( xi ) = 1., ( K ) = .3919990064, ( delta ) = -.9893045184, ( gamma ) = 0, ( eta ) = 0.36985611e-2, ( theta ) = -0.1048257226e-1 ] )

 


Gevoeligheidsanalyse Resultaten (sigmoid normalisatie):
============================================
   Parameter    Gevoeligheid
--------------------------------------------
           K        0.373082
      Lambda        0.761594
       alpha        0.761594
        beta        0.011134
       delta       -0.757066
         eta        0.003699
       gamma        0.000000
          mu       -0.762126
         phi        0.987136
           r       -0.987136
       sigma        0.369894
         tau       -0.882796
       theta       -0.010482
          xi        0.761594
============================================

 

table( [( tau ) = -.8827964097, ( sigma ) = .369894133, ( Lambda ) = .761594156, ( alpha ) = .761594156, ( mu ) = -.7621260922, ( beta ) = 0.11134361e-1, ( phi ) = .987135620, ( r ) = -.9871356198, ( xi ) = .761594156, ( K ) = .373082274, ( delta ) = -.7570656130, ( gamma ) = 0, ( eta ) = 0.3698544e-2, ( theta ) = -0.104821882e-1 ] )

(1)
 

 

Download mprimes-30-3-2025-_normalizing_sensitify_analysis_-vraag_.mw

If one parameter is increasing, the other parameters are constant

 

Must be possible to input a parameter(s) and see the influence 
on the graphs( did not test this yet) 

restart;
with(plots):
with(DEtools):

SEIRTPpanelplot := proc(param::list, tmin::numeric, tmax::numeric)
    description "SEIRTP Model Panel Plot – Shows each compartment in a separate subplot";

    local Lambda, alpha, delta, K, r, tau, gamma_, mu, phi, eta, sigma, beta, theta, xi;
    local S, E, Infectious, R, P, T, t, de, init, sol, p;
    local p1, p2, p3, p4, p5, p6, panel;

    # Default parameter values
    Lambda := 0.0133: alpha := 0.07954551: delta := 0.9: K := 300:
    r := 0.076: tau := 0.0900982: gamma_ := 0.00917: mu := 0.00056:
    phi := 0.09: eta := 0.009: sigma := 0.000456: beta := 0.567:
    theta := 0.009: xi := 0.0487:

    for p in param do eval(p); end do;

    # Differential equations
    de := [
      diff(S(t),t) = -P(t)*S(t)*alpha - S(t)*mu + Lambda,
      diff(E(t),t) = alpha*S(t)*P(t) - (-T(t)*eta + 1)*beta*E(t) - theta*E(t) - mu*E(t),
      diff(Infectious(t),t) = (-T(t)*eta + 1)*beta*E(t) - delta*Infectious(t) - gamma_*Infectious(t) - mu*Infectious(t),
      diff(R(t),t) = theta*E(t) + gamma_*Infectious(t) - mu*R(t),
      diff(P(t),t) = xi*Infectious(t) - sigma*T(t)*P(t) - tau*P(t),
      diff(T(t),t) = r*T(t)*(1 - T(t)/K) - phi*T(t)
    ]:

    init := [S(0)=1000, E(0)=10, Infectious(0)=5, R(0)=0, P(0)=1, T(0)=1]:

    sol := dsolve({op(de), op(init)}, numeric, output = listprocedure, range=tmin..tmax):

    p1 := odeplot(sol, [t, S(t)], tmin..tmax, title = "Susceptible S(t)", thickness = 2, color = red):
    p2 := odeplot(sol, [t, E(t)], tmin..tmax, title = "Exposed E(t)", thickness = 2, color = orange):
    p3 := odeplot(sol, [t, Infectious(t)], tmin..tmax, title = "Infectious I(t)", thickness = 2, color = blue):
    p4 := odeplot(sol, [t, R(t)], tmin..tmax, title = "Recovered R(t)", thickness = 2, color = green):
    p5 := odeplot(sol, [t, P(t)], tmin..tmax, title = "Pathogen P(t)", thickness = 2, color = purple):
    p6 := odeplot(sol, [t, T(t)], tmin..tmax, title = "Treatment T(t)", thickness = 2, color = brown):

    panel := display(Array([p1, p2, p3, p4, p5, p6]),
                     title = "SEIRTP Compartment Dynamics (Panel View)",
                     axes = boxed);

    # Automatically show the plot
    #plots[display](panel);
   
end proc:
 

SEIRTPpanelplot([], 0, 100); # Standard values

 

 

 

 

 

 

SEIRTPpanelplot([r = 0.12], 0, 50):  # With modified parameter

 

 

Download _mprimes_-31-3-2025_how_to_give_a_limit_value_from_-1_to_1_for_sensitivity_analysis_proc_2.mw

@ashy 30

I am now curious which epidemic model exactly are you studying ?
The SIR model is important 
Just wonder if you make parameter values smaller how the model reacts to that ?

Compartmental models in epidemiology - Wikipedia

@nm 
Strange this...

@nm 
Its a lot of work to chance the operating system, yes and keep things
Maybe the videocard ?
I am using a 142 hz and a 60 hz  screen at the same time 

Go to Windows 11 ..i use it for some years very good..idea?
60 Hz ..old , probably  i do have the same lg screen, but using also a 142 Hz gaming monitor 

From the looks of it, this is amateurish though, because you could create a test server that you could use to create websites.

@Carl Love 
The questioner was talking about ...
I am solving many systems of polynomial equations. 
I had the idea that this Solve Steps could also do that in some output format , but maybe SolveSteps can't do anything with polynomial systems ?
SolveSteps is for systems of inequalities


 

restart;
 

Euler product formula can be written in Maple this way:

eq := Zeta(2) = Product(1/(1 - 1/ithprime(i)^2), i = 1 .. infinity);

evalf(eval(eq, infinity = 10000));

(1/6)*Pi^2 = Product(1/(1-1/ithprime(i)^2), i = 1 .. infinity)

 

1.644934068 = 1.644932811

(1)

but note that Maple cannot use ithprime symbolically.

f:=Product(1-x^2/(k^2*Pi^2), k=1..infinity); # sin(x)/x

Product(1-x^2/(k^2*Pi^2), k = 1 .. infinity)

(2)

eval(diff(f,x,x)/2, x=0);

(1/2)*(Sum(-2*(Product(1, i1 = 1 .. k-1))*(Product(1, i1 = k+1 .. infinity))/(k^2*Pi^2), k = 1 .. infinity))

(3)

C2:=simplify(%); # coeff of x^2 in f

-(Sum(1/k^2, k = 1 .. infinity))/Pi^2

(4)

S2:=coeff(series(sin(x)/x, x), x^2);

-1/6

(5)

isolate(C2=S2, indets(C2, function)[]);

Sum(1/k^2, k = 1 .. infinity) = (1/6)*Pi^2

(6)

 


 

Download 10-3-2025mprimes-linkerlimiet_-aanvulling_-baselprobleem.mw

2 3 4 5 6 7 8 Last Page 4 of 67