janhardo

690 Reputation

12 Badges

11 years, 36 days

MaplePrimes Activity


These are replies submitted by janhardo

with(DEtools):

# === Hirota Bilinear Method ===
# This script provides tools to work with Hirota bilinear forms.
# It includes functions for handling bilinear derivatives, converting
# expressions to bilinear form, and printing results.

# === Bilinear Derivative / Hirota Operator ===
BD := proc(FF, DD)
    local f, g, x, m, opt;
    # Parse input arguments
    if nargs = 1 then
        return ‘*‘(FF[]);
    fi;
    f, g := FF[];
    x, m := DD[];
    opt := args[3..-1];
    
    # Handle case where m = 0 (base case)
    if m = 0 then
        return procname(FF, opt);
    fi;
    
    # Recursive definition of the Hirota operator
    procname([diff(f, x), g], [x, m-1], opt)
    - procname([f, diff(g, x)], [x, m-1], opt);
end:

# === Display Bilinear Derivative ===
‘print/BD‘ := proc(FF, DD)
    local f, g, x, m, i;
    f, g := FF[];
    f := cat(f, ‘ ‘, g);
    g := product(D[args[i][1]]^args[i][2], i=2..nargs);
    if g <> 1 then
        f := ‘‘(g) * ‘‘(f);
    fi;
    f;
end:

# === Collect Terms ===
getFnumer := proc(df, f, pow::posint := 1)
    local i, g, fdenom;
    # Ensure the expression is a sum
    if type(df, ‘+‘) then
        g := [op(df)];
        fdenom := map(denom, g);
        
        # Locate the term with denominator f^pow
        for i to nops(fdenom) while fdenom[i] <> f^pow do od;
        if i > nops(fdenom) then
            lprint(fdenom);
            error "No term(s) or numer=0 when denom=%1", op(0, f)^pow;
        fi;
        
        g := numer(g[i]);
        if not type(expand(g), ‘+‘) then
            lprint(g);
            error "Expected more than 1 term about Hirota D-operator";
        fi;
        
        return g;
    fi;
    
    lprint(df);
    error "Expected 1st argument to be type ‘+‘.";
end:

# === Extract Variable Powers ===
getvarpow := proc(df::function)
    local i, f, var, dif, pow;
    if op(0, df) <> diff then
        lprint(df);
        error "Expected diff function";
    fi;
    
    f := convert(df, D);
    var := [op(f)];
    dif := [op(op([0, 0], f))];
    pow := [0$nops(var)];
    f := op(op(0, f))(var[]);
    
    for i to nops(var) do
        dif := selectremove(member, dif, {i});
        pow[i] := nops(dif[1]);
        dif := dif[2];
    od;
    
    pow := zip((x, y) -> [x, y], var, pow);
    pow := remove(has, pow, {0});
    [[f, f], pow[]];
end:

# === Convert to Hirota Bilinear Form ===
HBF := proc(df)
    local i, c, f;
    
    if type(df, ‘+‘) then
        f := [op(df)];
        return map(procname, f);
    fi;
    
    if type(df, ‘*‘) then
        f := [op(df)];
        f := selectremove(hasfun, f, diff);
        c := f[2];
        f := f[1];
        if nops(f) <> 1 then
            lprint(df);
            error "Need only one diff function factor.";
        fi;
        f := f[];
        c := ‘*‘(c[]);
        f := getvarpow(f);
        f := [c, f];
        return f;
    fi;
    
    if op(0, df) = diff then
        f := getvarpow(df);
        f := [1, f];
        return f;
    fi;
    
    lprint(df);
    error "Unexpected type.";
end:

# === Print Hirota Bilinear Form ===
printHBF := proc(PL::list)
    local j, DD, f, C, tmp, gcdC;
    C := map2(op, 1, PL);
    gcdC := 1;
    
    if nops(C) > 1 then
        tmp := [seq(cat(_Z, i), i=1..nops(C))];
        gcdC := tmp *~ C;
        gcdC := ‘+‘(gcdC[]);
        gcdC := factor(gcdC);
        tmp := selectremove(has, gcdC, tmp);
        gcdC := tmp[2];
        if gcdC = 0 then
            gcdC := 1;
        fi;
        gcdC := gcdC * content(tmp[1]);
    fi;
    
    if gcdC <> 1 then
        C := C /~ gcdC;
    fi;
    
    DD := map2(op, 2, PL);
    f := op(0, DD[1][1][1]);
    DD := map(z -> product(D[z[i][1]]^z[i][2], i=2..nops(z)), DD);
    DD := zip(‘*‘, C, DD);
    DD := ‘+‘(DD[]);
    gcdC * ‘‘(DD) * cat(f, ‘ ‘, f);
end:

# === Print Hirota Bilinear Transform ===
printHBT := proc(uf, u, f, i, j, PL, alpha := 1)
    local DD, g, C, tmp, pl;
    pl := printHBF(PL);
    if j > 0 then
        print(u = 2 * alpha * ’diff’(ln(f), x$j));
    else
        print(u = 2 * alpha * ln(f));
    fi;
    
    if i > 0 then
        print(’diff’(pl/f^2, x$i) = 0);
    else
        print(pl/f^2 = 0);
    fi;
    
    NULL;
end:

# === Guess Differential Order ===
guessdifforder := proc(PL::list, x::name)
    local L, minorder, maxorder, tmp;
    L := map2(op, 2, PL);
    L := map(z -> z[2..-1], L);
    tmp := map(z -> map2(op, 2, z), L);
    tmp := map(z -> ‘+‘(z[]), tmp);
    tmp := selectremove(type, tmp, even);
    
    minorder := 0;
    if nops(tmp[1]) < nops(tmp[2]) then
        minorder := 1;
    fi;
    
    tmp := map(z -> select(has, z, {x}), L);
    tmp := map(z -> map2(op, 2, z), tmp);
    if has(tmp, {[]}) then
        maxorder := 0;
    else
        tmp := map(op, tmp);
        maxorder := min(tmp[]);
    fi;
    
    if type(maxorder - minorder, odd) then
        maxorder := maxorder - 1;
    fi;
    
    [minorder, maxorder];
end:

# === Guess Alpha Value ===
guessalpha := proc(Res, uf, u, f, i, j, PL, alpha)
    local tmp, res, pl, flag, k;
    flag := 1;
    tmp := [op(Res)];
    tmp := map(numer, tmp);
    tmp := gcd(tmp[1], tmp[-1]);
    
    if type(tmp, ‘*‘) then
        tmp := remove(has, tmp, f);
    fi;
    
    if tmp <> 0 and has(tmp, {alpha}) then
        tmp := solve(tmp/alpha^difforder(uf), {alpha});
        
        if tmp <> NULL and has(tmp, {alpha}) then
            lprint(tmp);
            for k to nops([tmp]) while flag = 1 do
                res := collect(expand(subs(tmp[k], Res)), f, factor);
                if res = 0 then
                    pl := subs(tmp[k], PL);
                    printHBT(uf, u, f, i, j, pl, rhs(tmp[k]));
                    flag := 0;
                fi;
            od;
        fi;
    fi;
    
    PL;
end:

Error, missing operator or `;`

 

 

 

## Hirota Bilinear Method
 ## Bilinear Derivative / Hirota Operator

 

 

BD := proc(FF, DD)
    local f, g, x, m, opt;

    # If only one argument is provided, return the product of elements in FF
    if nargs = 1 then
        return ‘*‘(FF[]);
    fi;

    # Extract elements from FF into f and g, and from DD into x and m
    f, g := FF[];
    x, m := DD[];

    # Capture any additional arguments passed to the procedure
    opt := args[3..-1];

    # If m (derivative order) is zero, recursively call the procedure with FF and optional arguments
    if m = 0 then
        return procname(FF, opt);
    fi;

    # Compute the difference of two recursive calls:
    # 1. Differentiate f with respect to x, and keep g unchanged, reducing m by 1
    # 2. Keep f unchanged and differentiate g with respect to x, reducing m by 1
    return procname([diff(f, x), g], [x, m-1], opt) - procname([f, diff(g, x)], [x, m-1], opt);
end:

 

#restart;

# Inladen van pakketten
with(PDEtools):
with(DEtools):
NULL;

# Declaraties
declare(u(x, t));
declare(f(x, t));
alpha := 1;

# Definities
KdV := diff(u(x, t), t) + 6 * u(x, t) * diff(u(x, t), x) + diff(u(x, t), x, x, x);
Hirota := u(x, t) = 2 * alpha * diff(ln(f(x, t)), x);

# Substitutie van Hirota-transformatie
KdV_Hirota := simplify(subs(Hirota, KdV));
KdV_Hirota := expand(KdV_Hirota / (f(x, t)^2));

# Berekening van bilineaire termen met BD
BD := proc(FF, DD)
    local f, g, x, m, opt;

    # Controle op invoer
    if nargs = 1 then
        return mul(FF[]);
    fi;

    # Ontleden van invoer
    f, g := op(FF);
    x, m := op(DD);
    opt := args[3 .. -1];

    # Basisgeval
    if m = 0 then
        return procname(FF, opt);
    fi;

    # Recursieve berekening
    procname([diff(f, x), g], [x, m-1], opt)
    - procname([f, diff(g, x)], [x, m-1], opt);
end:

# Debugging
debug_msg := proc(msg, val)
    print("[DEBUG]:", msg, val);
end:

# Voorbeeldberekening
try
    # FF en DD instellen
    FF := [f(x, t), f(x, t)];
    DD := [x, 2];

    # Bilineaire afgeleide berekenen
    BD_result := BD(FF, DD);
    debug_msg("Bilineaire afgeleide van de tweede orde", BD_result);

    # Hergebruiken van BD in KdV-Hirota
    Hirota_Bilinear := simplify(KdV_Hirota + BD_result);
    debug_msg("Herschreven KdV-vergelijking met bilineaire termen", Hirota_Bilinear);

    # Resultaat printen
    print("Bilineaire afgeleide:", BD_result);
    print("Herschreven vergelijking:", Hirota_Bilinear);

catch:
    debug_msg("Fout opgetreden", lasterror());
end try;

u(x, t)*`will now be displayed as`*u

 

f(x, t)*`will now be displayed as`*f

 

1

 

diff(u(x, t), t)+6*u(x, t)*(diff(u(x, t), x))+diff(diff(diff(u(x, t), x), x), x)

 

u(x, t) = 2*(diff(f(x, t), x))/f(x, t)

 

diff(2*(diff(f(x, t), x))/f(x, t), t)+12*(diff(f(x, t), x))*(diff(2*(diff(f(x, t), x))/f(x, t), x))/f(x, t)+diff(diff(diff(2*(diff(f(x, t), x))/f(x, t), x), x), x)

 

2*(diff(diff(f(x, t), t), x))/f(x, t)^3-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^4+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))/f(x, t)^4-24*(diff(f(x, t), x))^3/f(x, t)^5+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)^3-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^4+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^5-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^4-12*(diff(f(x, t), x))^4/f(x, t)^6

 

[f(x, t), f(x, t)]

 

[x, 2]

 

2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"[DEBUG]:", "Bilineaire afgeleide van de tweede orde", 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

(2*(diff(diff(diff(diff(f(x, t), x), x), x), x))*f(x, t)^3-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))*f(x, t)^2-6*(diff(diff(f(x, t), x), x))^2*f(x, t)^2+(2*f(x, t)^7+24*f(x, t)^2*(diff(f(x, t), x))+24*f(x, t)*(diff(f(x, t), x))^2)*(diff(diff(f(x, t), x), x))-2*(diff(f(x, t), x))^2*f(x, t)^6+2*(diff(diff(f(x, t), t), x))*f(x, t)^3-2*(diff(f(x, t), x))*(diff(f(x, t), t))*f(x, t)^2-24*(diff(f(x, t), x))^3*f(x, t)-12*(diff(f(x, t), x))^4)/f(x, t)^6

 

"[DEBUG]:", "Herschreven KdV-vergelijking met bilineaire termen", (2*(diff(diff(diff(diff(f(x, t), x), x), x), x))*f(x, t)^3-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))*f(x, t)^2-6*(diff(diff(f(x, t), x), x))^2*f(x, t)^2+(2*f(x, t)^7+24*f(x, t)^2*(diff(f(x, t), x))+24*f(x, t)*(diff(f(x, t), x))^2)*(diff(diff(f(x, t), x), x))-2*(diff(f(x, t), x))^2*f(x, t)^6+2*(diff(diff(f(x, t), t), x))*f(x, t)^3-2*(diff(f(x, t), x))*(diff(f(x, t), t))*f(x, t)^2-24*(diff(f(x, t), x))^3*f(x, t)-12*(diff(f(x, t), x))^4)/f(x, t)^6

 

"Bilineaire afgeleide:", 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"Herschreven vergelijking:", (2*(diff(diff(diff(diff(f(x, t), x), x), x), x))*f(x, t)^3-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))*f(x, t)^2-6*(diff(diff(f(x, t), x), x))^2*f(x, t)^2+(2*f(x, t)^7+24*f(x, t)^2*(diff(f(x, t), x))+24*f(x, t)*(diff(f(x, t), x))^2)*(diff(diff(f(x, t), x), x))-2*(diff(f(x, t), x))^2*f(x, t)^6+2*(diff(diff(f(x, t), t), x))*f(x, t)^3-2*(diff(f(x, t), x))*(diff(f(x, t), t))*f(x, t)^2-24*(diff(f(x, t), x))^3*f(x, t)-12*(diff(f(x, t), x))^4)/f(x, t)^6

(1)

 

 

#restart;
with(PDEtools):
with(DEtools):
NULL;

# Declare variables
declare(u(x, t));  # Original function u(x, t)
declare(f(x, t));  # Auxiliary function f(x, t)
alpha := 1;        # Set alpha value for Hirota transformation

# Define the SK equation
SK := diff(u(x, t), t)
     + 45 * u(x, t)^2 * diff(u(x, t), x)
     + 15 * diff(u(x, t), x, x) * diff(u(x, t), x)
     + 15 * u(x, t) * diff(u(x, t), x, x, x)
     + diff(u(x, t), x, x, x, x, x) = 0;

# Hirota transformation
Hirota := u(x, t) = 2 * diff(diff(ln(f(x, t)), x), x);

# Substitute Hirota transformation into SK equation
SK_Hirota := subs(Hirota, SK);

# Simplify and normalize by f(x, t)^2
SK_Hirota := simplify(SK_Hirota / f(x, t)^2);

# Debugging output
debug_msg := proc(msg, val)
    print("[DEBUG]:", msg, val);
end:

debug_msg("Transformed SK Equation", SK_Hirota);

# Example: Compute bilinear derivative for the second-order term
FF := [f(x, t), f(x, t)];  # Input functions for BD
DD := [x, 2];             # Second-order derivative
try
    BD_result := BD(FF, DD);
    debug_msg("Bilinear derivative for second order", BD_result);
catch:
    debug_msg("Error in BD computation", lasterror());
end try;

# Combine SK_Hirota with bilinear derivative results
try
    SK_Bilinear := simplify(SK_Hirota + BD_result);
    debug_msg("Rewritten SK Equation with bilinear terms", SK_Bilinear);

    # Print final result
    print("Bilinear derivative result:", BD_result);
    print("Rewritten SK Equation:", SK_Bilinear);
catch:
    debug_msg("Error combining bilinear terms with SK equation", lasterror());
end try;

u(x, t)*`will now be displayed as`*u

 

f(x, t)*`will now be displayed as`*f

 

1

 

diff(u(x, t), t)+45*u(x, t)^2*(diff(u(x, t), x))+15*(diff(diff(u(x, t), x), x))*(diff(u(x, t), x))+15*u(x, t)*(diff(diff(diff(u(x, t), x), x), x))+diff(diff(diff(diff(diff(u(x, t), x), x), x), x), x) = 0

 

u(x, t) = 2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2

 

diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, t)+45*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2*(diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, x))+15*(diff(diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, x), x))*(diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, x))+15*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)*(diff(diff(diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, x), x), x))+diff(diff(diff(diff(diff(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2, x), x), x), x), x) = 0

 

(-2*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(f(x, t), t))+18*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))-60*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(f(x, t), x))*(diff(diff(f(x, t), x), x))+2*f(x, t)^2*(diff(diff(diff(f(x, t), t), x), x))+2*f(x, t)^2*(diff(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x), x))-4*f(x, t)*(diff(f(x, t), x))*(diff(diff(f(x, t), t), x))-14*f(x, t)*(diff(f(x, t), x))*(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x))-10*f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(diff(diff(f(x, t), x), x), x))+4*(diff(f(x, t), x))^2*(diff(f(x, t), t))+24*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))*(diff(f(x, t), x))^2+40*(diff(diff(diff(f(x, t), x), x), x))^2*(diff(f(x, t), x)))/f(x, t)^5 = 0

 

"[DEBUG]:", "Transformed SK Equation", (-2*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(f(x, t), t))+18*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))-60*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(f(x, t), x))*(diff(diff(f(x, t), x), x))+2*f(x, t)^2*(diff(diff(diff(f(x, t), t), x), x))+2*f(x, t)^2*(diff(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x), x))-4*f(x, t)*(diff(f(x, t), x))*(diff(diff(f(x, t), t), x))-14*f(x, t)*(diff(f(x, t), x))*(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x))-10*f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(diff(diff(f(x, t), x), x), x))+4*(diff(f(x, t), x))^2*(diff(f(x, t), t))+24*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))*(diff(f(x, t), x))^2+40*(diff(diff(diff(f(x, t), x), x), x))^2*(diff(f(x, t), x)))/f(x, t)^5 = 0

 

[f(x, t), f(x, t)]

 

[x, 2]

 

2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"[DEBUG]:", "Bilinear derivative for second order", 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

(-2*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(f(x, t), t))+18*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))-60*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(f(x, t), x))*(diff(diff(f(x, t), x), x))+2*f(x, t)^2*(diff(diff(diff(f(x, t), t), x), x))+2*f(x, t)^2*(diff(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x), x))-4*f(x, t)*(diff(f(x, t), x))*(diff(diff(f(x, t), t), x))-14*f(x, t)*(diff(f(x, t), x))*(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x))-10*f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(diff(diff(f(x, t), x), x), x))+4*(diff(f(x, t), x))^2*(diff(f(x, t), t))+24*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))*(diff(f(x, t), x))^2+40*(diff(diff(diff(f(x, t), x), x), x))^2*(diff(f(x, t), x)))/f(x, t)^5+2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2 = 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"[DEBUG]:", "Rewritten SK Equation with bilinear terms", (-2*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(f(x, t), t))+18*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))-60*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(f(x, t), x))*(diff(diff(f(x, t), x), x))+2*f(x, t)^2*(diff(diff(diff(f(x, t), t), x), x))+2*f(x, t)^2*(diff(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x), x))-4*f(x, t)*(diff(f(x, t), x))*(diff(diff(f(x, t), t), x))-14*f(x, t)*(diff(f(x, t), x))*(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x))-10*f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(diff(diff(f(x, t), x), x), x))+4*(diff(f(x, t), x))^2*(diff(f(x, t), t))+24*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))*(diff(f(x, t), x))^2+40*(diff(diff(diff(f(x, t), x), x), x))^2*(diff(f(x, t), x)))/f(x, t)^5+2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2 = 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"Bilinear derivative result:", 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

 

"Rewritten SK Equation:", (-2*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(f(x, t), t))+18*(diff(diff(f(x, t), x), x))*f(x, t)*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))-60*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(f(x, t), x))*(diff(diff(f(x, t), x), x))+2*f(x, t)^2*(diff(diff(diff(f(x, t), t), x), x))+2*f(x, t)^2*(diff(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x), x))-4*f(x, t)*(diff(f(x, t), x))*(diff(diff(f(x, t), t), x))-14*f(x, t)*(diff(f(x, t), x))*(diff(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x), x))-10*f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))*(diff(diff(diff(f(x, t), x), x), x))+4*(diff(f(x, t), x))^2*(diff(f(x, t), t))+24*(diff(diff(diff(diff(diff(f(x, t), x), x), x), x), x))*(diff(f(x, t), x))^2+40*(diff(diff(diff(f(x, t), x), x), x))^2*(diff(f(x, t), x)))/f(x, t)^5+2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2 = 2*(diff(diff(f(x, t), x), x))*f(x, t)-2*(diff(f(x, t), x))^2

(2)

Download BD_berekening_22-12-2024_laatste_poging.mw

@salim-barzani  indeed its "mission impossible" as it seems 

A_Maple_Package_on_Symbolic_Computation_of_Hirota_Bilinear_Form_for_Nonlinear_Equations  [link to copyrighted material edited by moderator. See Mapleprimes' Terms of Use, section Conduct, items h and i]

 

First look at the parametervalues for the function T3?
The function T3 seems to be definied for all parametervalues 

@salim-barzani 

 

restart:
with(plots):
with(plottools):
with(Finance):

# Define the function T3
T3 := (B[1]*(tanh(2*n^2*(delta^2 - w)*k*t/((k*n - 1)*(k*n + 1)) + x) - 1))^(1/(2*n))
    * exp((-k*x + w*t + delta*W(t) - delta^2*t)*I):

# Default parameters
params := {B[1] = 1, n = 2, delta = 1, w = 1, k = 3}:

# Substitute numerical values into T3
solnum := subs(params, T3):

# Define a Wiener process and extract its path data
Wiener := WienerProcess():
N := 100:  # Number of time steps
P := PathPlot(Wiener(t), t = 0 .. 10, timesteps = N, replications = 1):
W_points := plottools:-getdata(P)[1, -1]:
t_grid := convert(W_points[.., 1], list):
W_values := W_points[.., 2]:

# Define grids for x and t
x_grid := [seq(-2 .. 2, 4 / N)]:
t_values := evalf(t_grid):

# Separate T3 into time- and space-dependent parts
T, X := map(mul, [selectremove(has, [op(expand(solnum))], t)])[]:
ST := unapply(eval(T, W(t) = w), w)~(W_values):
SX := evalf(unapply(X, x)~(x_grid)):

# Combine into a matrix
STX := Matrix(N $ 2, (it, ix) -> ST[it] * SX[ix]):

# Parameter control logic
valid_input := proc(B1, n, delta, w, k)
    if B1 > 0 and n > 0 and delta > 0 and w > 0 and k > 0 then
        return true:
    else
        return false:
    end if:
end proc:

# Explore interactive plot
Explore(
    if valid_input(B1, n, delta, w, k) then
        matrixplot(Re~(STX), style = surface, axes = boxed,
            labels = ["x", "t", "Re(T3)"],
            size = [800, 600],  # Increase plot size,
            title = cat("Interactive Plot of Re(T3) for Parameters: ",
                        "B[1] = ", B1, ", n = ", n,
                        ", delta = ", delta, ", w = ", w, ", k = ", k))
    else
        TextPlot("Invalid Parameters: Ensure all parameters are > 0.")
    end if,
    parameters = [
        [B1 = 0.1 .. 2],
        [n = 1 .. 5],
        [delta = 0.1 .. 2],
        [w = 0.5 .. 2],
        [k = 1 .. 5]
    ],
    initialvalues = [B1 = 1, n = 2, delta = 1, w = 1, k = 3]
);

"maple.ini in users"

(1)


 

Download Exploreplot_van_T3_functie_en_Wiener_data_18-12-2024.mw

@salim-barzani 
For the moment, a start ?
delta_error_onderzoek_wiener_matrix_18-12-2024.mw

parameter Delta is changing and other parameter  stay constant:?

params := {B[1]=1,n=2,delta=1,w=1,k=3 };

A Explore plot is not possible as it seems ..?

@salim-barzani 
At this first start question , there is a branch button ?
Transform data in maple to Matlab or make analysis by Excel worksheet for making Plot? - MaplePrimes
Or adding this question to the existing  row from  the start question ?

What else can be more done ?

This question may well become a candidate for deletion, given that another question has also been asked before that also has the same code fragments if I am not mistaken. 
May or may not go for deletion, you don't know with the moderator just doing whatever.
Note : probably it is not going to be deleted if the moderator addresses the question ?

@Carl Love 

By the looks of it, the Mapleprimes forum software is ‘lagging behind’ the current modern forum software. 
A ridiculous thing in itself, Maplesoft, a renowned company that wants its users to get on well with their software, does not create the conditions for this learning process, but instead fills Maple users with outdated forum software to learn to use Maple better.

This gives a moderator the opportunity to simply delete misplaced questions by a Maple user that do relate to topic , at will.
Unfortunately, there is no consistent approach from the moderator who should start deleting these misplaced questions.
Sometimes questions may or may not be removed and this creates confusion among the questioners and those answering the question.

I would put in big red letters above the forum: post questions related to the same topic together.

There are several moderators on the mapleprimes forum, so I would say delete wrongly asked questions immediately. 
Also now the forum shows a question related to previous questions on the forum , but posted separately by a user: this is a wrong attitude
Now if you as moderator(s) are so keen to remove wrong questions , do it consistently , if not , find something else to bother someone.

Bring this question under another question : How define D-operator (bilinear hirota derivative) for PDEs?

@salim-barzani 

How-Find-Bilinear-Form-For-Of-BLequation
This new question you must add to the already existing question here 
Adding or branching..

This standalone new question will probably yes or no deleted ?
note:  this new question is not the same as last one recently removed , its looks on a earlier question
So: keep all question together, doubling or partly doubling doesn't matter , keep all question  together
if it falls onder the same topic

So bring your latest question here ....

@salim-barzani 
Lol .. keep related questions together anyway in a startquestion : following a row or as branch
You are sure you did the right procedure for adding a branch ?
A branch belongs by the question i think: i never used it 

This undermines the whole flow of investigation

First 17 18 19 20 21 22 23 Last Page 19 of 73