janhardo

775 Reputation

12 Badges

11 years, 178 days

MaplePrimes Activity


These are replies submitted by janhardo

@salim-barzani 
Its possible to get your expresssions in the wanted form (the art of expression massage :-))
https://www.mapleprimes.com/questions/238929-How-Simplify-This-Expresion-In-Maple
This former thread is a nice example how you can study this art and become better

I did a small part for eq_8  only and made also a procedure for it 
Look how i split the commands and i am using also a AI maple coding expert for questions if they com e up.. 
You have to be creative and make an analysis of an expression and discover something mathematical in it  
I did just a little begin.
This_way_mccdarr_ode_manipulatie4-9-2024Mprimes.mw

myODEProcedure := proc()
    local eq_7, negsol, CS, replace, B1B2, eq_8;

    # Define the differential equation
    eq_7 := diff(G(eta), eta$2) + sigma*G(eta) = nu;

    # Solve the ODE under the assumption that sigma < 0
    negsol := rhs(dsolve(eq_7) assuming sigma < 0);

    # Display the intermediate result for the original solution
    print("The intermediate result for negsol is:", negsol);

    # Convert the solution to a trigonometric form and expand
    negsol := convert(negsol, trig);
    negsol := expand(negsol);

    # Display the intermediate result after trigonometric conversion and expansion
    print("The intermediate result for negsol after trigonometric conversion and expansion is:", negsol);

    # Define the replacements for hyperbolic functions
    CS := [C, S];
    replace := convert(indets(negsol, function), list) =~ CS;

    # Display the replacements that will take place
    print("The replacements for hyperbolic functions are:", replace);

    # Replace cosh and sinh with C and S and collect terms
    negsol := collect(eval(negsol, replace), CS);

    # Display the result after replacing and collecting terms
    print("The intermediate result for negsol after replacement and collection of terms is:", negsol);

    # Solve the coefficients in terms of B1 and B2
    B1B2 := solve({coeff(negsol, C) = B1, coeff(negsol, S) = B2}, [_C1, _C2]);

    # Display the result of the coefficient solution
    print("The solution for the coefficients B1 and B2 is:", B1B2);

    # Create the final equation eq_8 by substituting the found solutions
    eq_8 := eval(eval(negsol, B1B2[]), (rhs = lhs)~(replace));

    # Return the final equation
    return eq_8;
end proc:


eq_8 := myODEProcedure();

 

@salim-barzani 
What book you are using ?,then i can do more ( i hope:-) )
 

 
EXPLORATIONS OF MATHEMATICAL MODELS IN BIOLOGY WITH MAPLE™
MAZEN SHAHIN Department of Mathematical Sciences Delaware State University

@Paras31 ,Thanks
Try out some values for mu : 1/2,1,3/2 ,3 

Module_VanderPol_sytemsexpl_2-9-2024_Mprimes_module.mw

Simplify it for radians and look what is left :-) 
2Pi radians = 360 degrees 

 

I  like to see a better fieldplot and used dfieldplot from DEtools
No vector procdedure  input anymore, but a system of ODe's



 

# Definieer de procedure om flowlines te tekenen en het vectorveld te plotten
flowlines := proc(eq1, eq2, initconds, t, t_range, x_range, y_range)
    uses plots;
    with(DEtools);
    local sol, flowplots, veldplot, i, n;

    # Bepaal het aantal flowlines (stroomlijnen)
    n := nops(initconds);

    # Geef een boodschap weer over het aantal flowlines
    printf("Er zijn %d flowlines te zien in de animatie.\n", n);

    # Lijst om de verschillende flowline plots op te slaan
    flowplots := [];

    # Voor elke initiële conditie
    for i from 1 to n do
        # Stel het systeem van DE's op als een lijst van vergelijkingen
        sol := dsolve({eq1, eq2, x(0) = initconds[i][1], y(0) = initconds[i][2]}, numeric);

        # Voeg de flowline voor deze stroomlijn toe aan de lijst van plots
        flowplots := [op(flowplots), odeplot(sol, [x(t), y(t)], t_range, frames=100)];
    end do;

    # Maak een plot van het vectorveld met dfieldplot
    veldplot := dfieldplot([eq1, eq2], [x, y], t = t_range, x = x_range, y = y_range, arrows = small, color = blue);

    # Combineer het vectorveld plot met de flowlines
    display([veldplot, op(flowplots)], title = "Vector Field with Flowlines", scaling=constrained, color= green);
end proc:

# Definieer het systeem van differentiaalvergelijkingen
eq1 := diff(x(t), t) = y(t);   # Richting in de x-richting
eq2 := diff(y(t), t) = -x(t);  # Richting in de y-richting

# Definieer de lijst van initiële condities
initconds := [[1, 0], [2, 1], [1, 1]];

# Roep de procedure aan om de flowlines en het vectorveld te plotten
flowlines(eq1, eq2, initconds, t, 0..2*Pi, -2..2, -2..2);

diff(x(t), t) = y(t)

 

diff(y(t), t) = -x(t)

 

[[1, 0], [2, 1], [1, 1]]

 

Er zijn 3 flowlines te zien in de animatie.

 

 

 


 

Download DDA_procedure_omgezet_31-8-2024_Mprimes_ODEsyteem.mw

 

If you want to see flowlines of a system ode's 

 

"maple.ini in users"

(1)

# Definieer de componenten van het vectorveld als functies
F1 := (x, y) -> y;      # F[1] = y (component in de x-richting)
F2 := (x, y) -> -x;     # F[2] = -x (component in de y-richting)

# Definieer de procedure om flowlines te tekenen en het vectorveld te plotten
flowlines := proc(F1, F2, initconds, t, range, xrange, yrange)
    uses plots;
    local eq1, eq2, sol, flowplots, veldplot, i, n;

    # Bepaal het aantal flowlines (stroomlijnen)
    n := nops(initconds);

    # Geef een boodschap weer over het aantal flowlines
    printf("Er zijn %d flowlines te zien in de animatie.\n", n);

    # Lijst om de verschillende flowline plots op te slaan
    flowplots := [];

    # Voor elke initiële conditie
    for i from 1 to n do
        # Stel de differentiaalvergelijkingen afzonderlijk op
        eq1 := diff(x(t), t) = F1(x(t), y(t));  # Gebruik de functie F1 voor de x-richting
        eq2 := diff(y(t), t) = F2(x(t), y(t));  # Gebruik de functie F2 voor de y-richting

        # Stel het systeem van DE's op als een lijst van vergelijkingen
        sol := dsolve({eq1, eq2, x(0) = initconds[i][1], y(0) = initconds[i][2]}, numeric);

        # Voeg de flowline voor deze stroomlijn toe aan de lijst van plots
        flowplots := [op(flowplots), odeplot(sol, [x(t), y(t)], range, frames=100)];
    end do;

    # Maak een plot van het vectorveld
    veldplot := fieldplot([F1(x, y), F2(x, y)], x=xrange, y=yrange, arrows=small, color=blue);

    # Combineer het vectorveld plot met de flowlines
    display([veldplot, op(flowplots)], title = "Vector Field with Flowlines", scaling=constrained);
end proc:

# Definieer de lijst van initiële condities
initconds := [[1, 0], [2, 1], [1, 1]];

# Roep de procedure aan om de flowlines en het vectorveld te plotten
flowlines(F1, F2, initconds, t, 0..2*Pi, -2..2, -2..2);

proc (x, y) options operator, arrow; y end proc

 

proc (x, y) options operator, arrow; -x end proc

 

[[1, 0], [2, 1], [1, 1]]

 

Er zijn 3 flowlines te zien in de animatie.

 

 

 

 


 

Download DDA_procedure_omgezet_30-8-2024_Mprimes.mw
 

 

 


 

	
#new_sol
new_sol:=lhs(sol)=evalindets(rhs(sol),'specfunc(anything,Sum)',X->Sum(expand(op(1,X)),op(2,X)));

I don't understand this, but it works 
There is also a another approach,but for that you must know some sum rules  

@nm 
Thanks,
This is the right general solution. 
Note: the first solution pic was wrong, because i copied not the whole expression (scrolling not complete )
Note 1 did not use a book text, but ask ai 


@nm ,  thanks , good idea to add small code directly

and c is wave speed 

Impressive ...
A good exercise to do (try ) this in geometric expression app

Lotka_Volterra system as start for experimentation with bifurcation 
Note: the spiral must be bigger ..
IterativeMaps:-Bifurcation ..use?
I do have extensive old  Maple studymateria from my education  for Lotka -Volterra , but it is not using ODE's, but works with difference equations, to study the phaseplot with equibrillium lines


lotka-volterra_bifurcatie_analyse_test_-25-8-2024.mw

Dynmod08_-_kopie.mws

@Paras31 
Getting a good plot in Maple is still a challence as a non-expert as i am.
You have done well.

@Paras31 
 

systems := [
    (x, y) -> y, 
    (x, y) -> -delta * y - alpha * x - beta * x^3 + gamma * cos(omega * t)
];

Conclusion:

For the given system with a time-dependent forcing term gamma * cos(omega * t), there are no true equilibrium points in the classical sense because the term gamma * cos(omega * t) is time-dependent and prevents the system from reaching a stationary point. 

Putting the system in the right input format of the Dsys procedure ,then you will probably see this phaseplot?
For t = 10 , this is a solution curve 

First 32 33 34 35 36 37 38 Last Page 34 of 80