janhardo

700 Reputation

12 Badges

11 years, 45 days

MaplePrimes Activity


These are replies submitted by janhardo

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 

About Duffings eq : how about seeing it  in DSys procedure ?

Duffing_eq_as_system.mw

Possible to ad a list of ic , to show the solutioncurve better 
Adding population curves and add Explore for handling parameters?
Don't know if is possible to use a connected Phase plot with population curves ? 

faseplots_ics_not_ics24-8-2024Mprimes_evenwichtpunten_.mw

@Paras31 ,thanks
Another procedure , the same as yours example, need some adjustments 


faseplots_ics_not_ics23-8-2024Mprimes_evenwichtpunten.mw

Adding a procedure for plotting  phase plots 

22-8-2024_Mprimes_evenwichtpunten_Dsys

@Scot Gould , thanks for this exercise, get some help en ideas from it.  

@Paras31  i made it a little bit more userfriendly 

Mprimes21-8-20124sytem_ode_population_B.mw
 

with classification of equilibrium points
If the system is in equilibrium : the growth rates of both populations are then 0.

Mprimes21-8-20124sytem_ode_population_A_.mw

 

First 26 27 28 29 30 31 32 Last Page 28 of 73