janhardo

430 Reputation

8 Badges

10 years, 217 days

MaplePrimes Activity


These are replies submitted by janhardo

Maybey  its usable ?
The simulation for 5 cases , so you need one procedure for one case to start with

klein-gordon_eg_-_8-9-2024-mprimes.mw

@Paras31,  If you have the maple code that represents a situation for parameter alpha , then you could basically start making it generic 

@salim-barzani 

restart;

# Step 1: Define the simplified differential equation
# This assumes the right-hand side form is: C / (lambda * (C * zeta + D))
eq_case3 := diff(G(zeta), zeta) / G(zeta)^2 = C / (lambda * (C*zeta + D));

# Step 2: Rearrange the equation to isolate G'(zeta)
eq_case3_rearranged := diff(G(zeta), zeta) = C * G(zeta)^2 / (lambda * (C*zeta + D));

# Step 3: Solve the differential equation using Maple's dsolve
sol_case3 := dsolve(eq_case3_rearranged, G(zeta));

# Step 4: Simplify the solution, if necessary
simplified_sol_case3 := simplify(sol_case3);

# Display the final solution
simplified_sol_case3;
odeadvisor(diff(G(zeta), zeta)/G(zeta)^2 = C/(lambda*(C*zeta + D))):
                          [_separable]

In the beginning with the first photo printout with the colored indicated formulas and the 1st and 2nd corrected response from @mmcdara I could still follow what was happening. 
What happened next in the thread is not clear to me with multiple photo printouts of information. 
Has any feedback come from @salim-barzani that each code solution step of @mmcdara's elaborations are clear to him ( understood so )? 
If not, that needs to be worked on first as a basis to proceed. 

@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

 

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