janhardo

690 Reputation

12 Badges

11 years, 36 days

MaplePrimes Activity


These are replies submitted by janhardo

# Eerste expressie definiëren
expr1 := (3*q*B[1]^2*A[1]*sin(W) + 3*q*B[1]*A[1]^2*cos(W) + 6*q*B[1]*A[1]*A[0])*sin(W)*cos(W)
         + q*A[1]^3*cos(W)^3 + 3*q*A[1]^2*cos(W)^2*A[0] 
         + (3*q*A[0]^2*A[1] + p*A[1] - s*A[1])*cos(W) 
         + q*B[1]^3*sin(W)^3 + 3*q*B[1]^2*sin(W)^2*A[0] 
         + (3*q*A[0]^2*B[1] + p*B[1] - s*B[1])*sin(W) 
         + q*A[0]^3 + p*A[0] - s*A[0]:

# Tweede expressie definiëren
expr2 := (A[1]*cos(W) + B[1]*sin(W) + A[0])*(q*A[1]^2*cos(W)^2 
         + 2*q*A[1]*(B[1]*sin(W) + A[0])*cos(W) 
         + q*B[1]^2*sin(W)^2 + 2*q*A[0]*B[1]*sin(W) 
         + q*A[0]^2 + p - s):

# Vereenvoudig het verschil om te controleren op gelijkheid
check_equiv := simplify(expr1 - expr2);

# Controleer of het verschil gelijk is aan nul
is_zero := evalb(check_equiv = 0);
is_zero;

 

@dharr , thanks for the solution, yes an error I have seen several times and thought I was going to solve it with with (package) but apparently that is not the right way for a procedure.
Why not, that's another specialist question....  

Error, (in Odegenerator) `DEtools` is not a module or member
Seems that uses not accept DEtools ?

@Carl Love , Thanks for correction!
It creeps in anyway ...

@WD0HHU 
Yes , the procedure can now calculate iteratively or manually.
In both calculations the odeadvisor has to determine the type of ode .
For iterative it is correct, but for manual I think not yet ,but not a big issue to solve

restart;
params := {alpha = 1, gg = 0.1, k = 1, mu = 10, sigma = 5, w = 2};
M := 2*sqrt(-(gg*(gg*k*mu - 2*k*sigma)*k/(gg*sigma - 1) + k^2)/alpha)*exp((-(4*gg*k*w + 4*k^2 - sigma^2)*t/(gg*sigma - 1) + sigma*x)*I)/sinh(-2*k*x + (-gg*k*(4*gg*k*w + 4*k^2 - sigma^2)/(gg*sigma - 1) - 2*k*sigma)*t/(gg*sigma - 1));
Explore(plot3d([Re, Im](M), t = 0 .. 5, x = 0 .. 5, view = -100 .. 100, grid = [150, 150], color = [red, blue], style = surface, adaptmesh = false, size = [500, 500]), alpha = 0.1 .. 2.0, gg = 0.1 .. 0.3, w = 1 .. 5, mu = 1.0 .. 10.0, sigma = 1.0 .. 4.0, k = 1.0 .. 2.0, placement = right);

Explore example plot of complex valued function
Can be used for trying to get a explore plot with Wiener function 

@salim-barzani , there is some direction now , but did you succeed in your code to get this reduced pde form (ode)  ?
I did, but  now how to go further ..well it seems there is enough probably to find the right information for me  : handbooks and so on
i do have another solution to your problem try contact : AndreiD.Polyanin or
AlexeiI.Zhurov from Russia they are experts pdes and odes 

 pde

u(x,t) is pde value of U(z) and is plot from a ode , it all revolves about a reduceded pde , to solve this 
How to solve this non lineair complex valued third orde ode , right?

Another second way of defining pde with a table U 

with(PDEtools): 
declare(u(x,t)); 
U := diff_table(u(x,t));
interface(showassumed = 0); 
assume(k > 0);
PDE1 := I*U[t] + U[x,x] + k*abs(U[])^2*U[] = 0;
Sol1 := u(x,t) = C1*exp(I*(C2*x + (k*C1^2 - C2^2)*t + C3));
Test1 := pdetest(Sol1, PDE1); 
Test11 := simplify(evalc(Test1));
Sol2 := u(x,t) = A*sqrt(2/k)*(exp(I*B*x + I*(A^2 - B^2)*t + I*C1))/(cosh(A*x - 2*A*B*t + C2));
Test2 := pdetest(Sol2, PDE1); 
Test21 := simplify(evalc(Test2));# jd complexe getallen

a third way is : direct 

with(PDEtools):(u(x,y));
PDE1:=x*diff(u(x,y),y)-diff(u(x,y),x)=g(x)*u(x,y)^2;
Sol1:=pdsolve(PDE1);

pdetest(Sol1,PDE1);

a fourth way example is with declare 

with(PDEtools): declare(u(x,y)); # hier word declare gebruikt
PDE1:=u(x,y)*diff(u(x,y),y)=diff(u(x,y),x);
sysCh:=charstrip(PDE1,u(x,y)); funcs:=indets(sysCh,Function);
Sol1:=dsolve(sysCh,funcs,explicit);

As notation seems te be handier in this example an note how this is done 
with(PDEtools): with(plots): tr1:=x-c*t=z; tr2:={a=1,b=1,c=1}; # JD traveling wave 
Eq1:=u->diff(u,t)+a*u*diff(u,x)+b*diff(u,x$3)=0;
Eq2:=expand(Eq1(U(lhs(tr1)))); Eq3:=algsubs(tr1,Eq2);
Eq4:=map(convert,Eq3,diff); Eq5:=map(int,lhs(Eq4),z)-C1=0;
Eq6:=expand(Eq5*2*diff(U(z),z)); Eq7:=map(int,Eq6,z);
Eq8:=lhs(Eq7)=C2; Eq9:=subs({C1=0,C2=0},Eq8);
Sol1:=[dsolve(Eq9,U(z))]; Sol11:=subs(_C1=0,simplify(Sol1[2]));
Sol12:=convert(Sol11,sech); Sol2:=eval(subs(z=x-c*t,Sol11),tr2);
convert(Sol2,sech);
animate(plot,[rhs(Sol2),x=-20..20,color=blue],t=0..20,numpoints=100,
frames=50,thickness=2);
pdetest(u(x,t)=rhs(Sol2),subs(tr2,Eq1(u(x,t))));


your pde

Eq1 := u -> (diff(u, t, t) - c^2*diff(u, x, x))*I + diff(U(-t*tau + x)^2*u, t) - lambda*c*diff(U(-t*tau + x)^2*u, x) + 1/2*diff(u, t, x, x) - 1/2*epsilon*c*diff(u, x, x, x) = 0

PDE
ans := pdsolve(PDE)
pdetest(ans, PDE)

Ai says separation of variables is possible in a resulting ODE ?

Have made a few more attempts to make the function T3 work via explore plot, unfortunately not successful yet.
The function T3 is a complex function and should the explore plot be able to show the real part of the function T3 ?   

By induction can this proved ?
no.. thats only for one variabele

this example is a intersection in implicit 2D functions
Add any two implicit function you can think of in the intersections ( )  proc 
let's look how intersections( ) can handle this :-)  

Its about polynome expressions, so all functions as polynomes expressed can be used


 

intersections := proc(P, Q, T, rangeX, rangeY)
    local R, W, w, t, a, b, sol, symbolicAlgcurves, buff, v, eq1, eq2, solplot, points, yvals, xvals, final_solutions, i;

    sol := [];  # List for numerical solutions

    # Gebruik `algcurves` voor expliciete symbolische oplossingen
    with(algcurves):
    symbolicAlgcurves := intersectcurves(P, Q, X, Y);

    if nops(symbolicAlgcurves) > 0 then
        yvals := Y = ~[solve(symbolicAlgcurves[1][2][2], Y)];
        xvals := map2(eval, symbolicAlgcurves[1][2][1], yvals);
        final_solutions := zip((x, y) -> {solve(x, {X})[], y}, xvals, yvals);

        print("Symbolic solutions (explicit notation):");
        for i in final_solutions do
            print(i);
        end do;
    else
        print("No symbolic solutions found.");
    end if;

    # Swap variable depending on T
    if T = Y then
        W := X;
    else
        W := Y;
    end if;

    # Compute resultant to eliminate one variable
    R := resultant(P, Q, T);
    print("Resultant:");
    print(R);

    # Numerical solution for the resultant equation
    w := [fsolve(R, W, rangeX)];  # Solutions for W
    t := [];

    # Solve for the dependent variable
    for v in w do
        t := [op(t), op([fsolve(subs(W = v, P), T, rangeY)])]; # Add solutions to the list
    end do;

    # Validate and store unique solutions
    for a in w do
        for b in t do
            if T = Y then
                buff := abs(subs(X = a, Y = b, P)) + abs(subs(X = a, Y = b, Q));
                if buff < 1/100000000 then
                    if not member([a, b], sol) then
                        sol := [op(sol), [a, b]];
                    end if;
                end if;
            else
                buff := abs(subs(X = b, Y = a, P)) + abs(subs(X = b, Y = a, Q));
                if buff < 1/100000000 then
                    if not member([b, a], sol) then
                        sol := [op(sol), [b, a]];
                    end if;
                end if;
            end if;
        end do;
    end do;

    # Display results
    printf("Number of unique numerical solutions: %a", nops(sol));
    print("");
    print("Numerical solutions:");
    print(sol);

    # Format points for pointplot
    points := [seq([sol[i][1], sol[i][2]], i = 1 .. nops(sol))];

    # Determine dynamic ranges for plotting
    eq1 := plots:-implicitplot(P, X = rangeX, Y = rangeY, color = red, grid = [100, 100]);
    eq2 := plots:-implicitplot(Q, X = rangeX, Y = rangeY, color = blue, grid = [100, 100]);
    solplot := plots:-pointplot(points, symbol = solidcircle, symbolsize = 12, color = black);

    # Combine and display plots
    plots:-display([eq1, eq2, solplot], title = "Intersections of the Curves", scaling = constrained);
end proc:

intersections(Y-X^2 ,Y+(X^2)-1 , X, -2 .. 2, -2 .. 2);

"Symbolic solutions (explicit notation):"

 

{Y = 1/2, {X = -(1/2)*2^(1/2)}, {X = (1/2)*2^(1/2)}}

 

"Resultant:"

 

(-2*Y+1)^2

 

Number of unique numerical solutions: 2

 

""

 

"Numerical solutions:"

 

[[-.7071067812, .5000000000], [.7071067812, .5000000000]]

 

 

intersections(X^2 + Y^2 - 1 , X - Y, X, -2 .. 2, -2 .. 2);

"Symbolic solutions (explicit notation):"

 

{X = (1/2)*2^(1/2), Y = (1/2)*2^(1/2)}

 

{X = -(1/2)*2^(1/2), Y = -(1/2)*2^(1/2)}

 

"Resultant:"

 

2*Y^2-1

 

Number of unique numerical solutions: 2

 

""

 

"Numerical solutions:"

 

[[-.7071067812, -.7071067812], [.7071067812, .7071067812]]

 

 

intersections(Y^2 + X^2-3/2 , (1/4)*X^2 + Y^2 - 1, X, -2 .. 2, -2 .. 2);# rational input

"Symbolic solutions (explicit notation):"

 

{Y = (1/6)*30^(1/2), {X = -(1/3)*6^(1/2)}, {X = (1/3)*6^(1/2)}}

 

{Y = -(1/6)*30^(1/2), {X = -(1/3)*6^(1/2)}, {X = (1/3)*6^(1/2)}}

 

"Resultant:"

 

(1/64)*(6*Y^2-5)^2

 

Number of unique numerical solutions: 4

 

""

 

"Numerical solutions:"

 

[[-.8164965809, -.9128709292], [.8164965809, -.9128709292], [-.8164965809, .9128709292], [.8164965809, .9128709292]]

 

 

 


 

Download snijpunten_van_2d_curves_maple_primesDEF_6-1-2025.mw

 
First 15 16 17 18 19 20 21 Last Page 17 of 73