janhardo

435 Reputation

8 Badges

10 years, 232 days

MaplePrimes Activity


These are replies submitted by janhardo

@salim-barzani 
IIt didn't cross my mind that you wouldn't know algebra, no way. 
Someone else brought it up 
Oh, yes I'm not an expert, so don't expect anything from me 
 

@mmcdara , thanks

Great job though. 
Thought the intention was to get an identical expression ?
There I do assume @salim-barzani knows the elementary algebra rules, otherwise you can stop.  

I don't think Maple can do anything else with this to rewrite it in another form.
I've also had this happen years ago with an expression and asked on the forum here
There would be nothing more to do, given Maple's algorithm 

The only thing you can do is check the two expressions in Maple if they are the same?  

Indeed to get an expression into a particular shape, that really requires a thorough knowledge of Maple and mathematical understanding 
These examples of expression transformations can certainly be considered instructive.

In a book about Maple, used at a university somewhere in the Netherlands, it is also advised not to spend too much time on how a calculation of an expression looks like.
Because it does not matter to Maple how big the expression is. 

Indeed eq8 is derived, but it is still not the same as in the paper 
Well , now i want to see same expressions in Maple as challence, whatever it takes :-) 
 

@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 

First 10 11 12 13 14 15 16 Last Page 12 of 57