janhardo

700 Reputation

12 Badges

11 years, 60 days

MaplePrimes Activity


These are replies submitted by janhardo

Give more details maybe someone can answer this?

Root two is an irrational number and you take this value for a
If you then assume that x is a real number. 
Then what will maple calculate for the function values ?

@scallopedpancake 
Setup screen ? in Physics package 

As a system of odes via  ODEsteps : lambda and mu  , for symbolic solving  there are no solutionsteps , but for lambda and mu = 1 there is a solution
Note : output odesteps not correct ?


 

"maple.ini in users"

(1)

restart;

"maple.ini in users"

(2)

with(Student:-ODEs):

 

"maple.ini in users"

(3)

# Definieer de nieuwe vector-matrix notatie
macro(Y = <y[1](eta), y[2](eta)>);
sys := diff(Y, eta) = Matrix([[0, lambda], [mu, 0]]).Y;

Y

 

Vector[column](%id = 36893490960308788268) = Vector[column](%id = 36893490960308788628)

(4)

ODESteps(sys);

Error, (in Student:-ODEs:-SolveSystem) unsupported system of ODEs

 

restart;

"maple.ini in users"

(5)

with(Student:-ODEs):

 

"maple.ini in users"

(6)

# Definieer de nieuwe vector-matrix notatie
macro(Y = <y[1](eta), y[2](eta)>);
sys := diff(Y, eta) = Matrix([[0, 1], [1, 0]]).Y;

Y

 

Vector[column](%id = 36893490861197088396) = Vector[column](%id = 36893490861197088756)

(7)

ODESteps(sys);

"[[,,"Let's solve"],[,,[?]=[?]],["&bullet;",,"Define vector"],[,,y(eta)=[?]],["&bullet;",,"System to solve"],[,,(&DifferentialD;)/(&DifferentialD;eta) y(eta)=[?]*y(eta)],["&bullet;",,"Define the coefficient matrix"],[,,A=[?]],["&bullet;",,"Rewrite the system as"],[,,(&DifferentialD;)/(&DifferentialD;eta) y(eta)=A*y(eta)],["&bullet;",,"To solve the system, find the eigenvalues and eigenvectors of" A],["&bullet;",,"Eigenpairs of" A],[,,[[-1,[?]],[1,[?]]]],["&bullet;",,"Consider eigenpair"],[,,[-1,RTABLE(18446744074197349982,MATRIX([[-1], [1]]),Vector[column])]],["&bullet;",,"Solution to homogeneous system from eigenpair"],[,,(y)[1]=[]],["&bullet;",,"Consider eigenpair"],[,,[1,RTABLE(18446744074198477606,MATRIX([[1], [1]]),Vector[column])]],["&bullet;",,"Solution to homogeneous system from eigenpair"],[,,(y)[2]=[]],["&bullet;",,"General solution to the system of ODEs"],[,,y=`c__1` (y)[1]+`c__2` (y)[2]],["&bullet;",,"Substitute solutions into the general solution"],[,,y=[]+[]],["&bullet;",,"Solution to the system of ODEs"],[,,[?]=[?]]]"

(8)

 


 

Download Find_ODE_solution_with_condition_parameter_als_syteem_via_odesteps_26-11-2024.mw

@dharr  "avoids square roots of negative numbers in practice" . This is calculated in the complex number system.
 

restart;

# Define the coupled differential equations
de1 := diff(F(eta), eta) = lambda * G(eta):
de2 := diff(G(eta), eta) = mu * F(eta):

# Solve the differential equations (general solution)
sol := dsolve({de1, de2}, {F(eta), G(eta)}):
sol_hyperbolic := convert(sol, trigh):  # Hyperbolic form

# General solution (hyperbolic, valid for all lambda and mu)
print("=== General Solution (valid for all lambda and mu) ==="):
print(sol_hyperbolic);

# Alternative solution for lambda * mu < 0 (explicit complex root)
assume(lambda < 0, mu > 0):  # Assume lambda * mu < 0
complexRoot := simplify(sqrt(lambda * mu)):  # Explicitly compute complex root
complexRoot_imag := I * sqrt(-lambda * mu):  # Write root in imaginary form

# Replace hyperbolic functions with trigonometric functions
sol_trig := subs(sqrt(lambda * mu) = complexRoot_imag, sol_hyperbolic):
sol_trig_converted := simplify(sol_trig):
print("=== Alternative Solution (Trigonometric Form for lambda * mu < 0) ==="):
print(sol_trig_converted);

# Add information from the image: interpretation and cases
print("=== Interpretation of Cases ==="):
print("Case (I): Covers all combinations of lambda and mu signs using hyperbolic functions.");
print("Case (II): If lambda * mu < 0, the solution can be rewritten in trigonometric form.");
print("Note: Hyperbolic functions naturally handle both positive and negative values of lambda * mu.");

# Validate both solutions with odetest
validation_hyperbolic := odetest(sol_hyperbolic, [de1, de2]):
validation_trig := odetest(sol_trig_converted, [de1, de2]):

print("=== Validation of Solutions ==="):
print("Validation of the hyperbolic solution:"):
print(validation_hyperbolic):  # Result must be 0
print("Validation of the trigonometric solution (lambda * mu < 0):"):
print(validation_trig);  # Result must be 0

 

No complex numbers anymore or do you mean something else ?

@Carl Love 

Yes, some explanation of the code can never hurt in my opinion.

But to really understand maple code better, the AI is also a good helper, but paid via ChatGPTplus
Unfortunately the Maple coding expert does not seem to be around anymore, so it will be Wolfram or yet other chats .

@Aung 

Then you should rewrite a general expression of the current integral expression into a general form of an integral by parts ?
 =   ( with partiele integration )

Both expressions i let check this  with  parameters and they seem to be numeric equal 


 

@Aung 

This is another methode from acer of solving your expression than dharr did for your expression.

acer methode :
"Do you need a fully programmatic way to transform the integral of a sum into the sum of integrals? For example, programmatically extracting and re-using not just the integrand but also the ranges of integration and summation".

Suppose you take the first term of the sum and solve this integral by parts : what to do with this expression?

@dharr 

I'm not a fan of your code, which only shows maple commands.
Keep in mind , that someone is asking for your help and needs some more explanation. 

Make "free" a variable 

x := 5;  # Assigning a value to x
x := 'x';# Releasing the variable by resetting it to a symbol


                             x := 5

                             x := x

 

@janhardo 

# Definieer lijst van polynomen
L := [u[0]*ux[0]*uxx[0],
      u[0]*ux[0]*uxx[1] + u[0]*ux[1]*uxx[0] + u[1]*ux[0]*uxx[0],
      u[0]*ux[0]*uxx[2] + u[0]*ux[1]*uxx[1] + u[0]*ux[2]*uxx[0] +
      u[1]*ux[0]*uxx[1] + u[1]*ux[1]*uxx[0] + u[2]*ux[0]*uxx[0]]:

# Maak een lege tabel met kolommen voor de naam van het polynoom en zijn waarde
the_table := Array(1..0):
the_table ,= ["Polynoom", "Waarde"]:

# Toewijs elk polynoom aan een naam en voeg toe aan de tabel
for i from 1 to nops(L) do
    naam := cat("polynoom_", i-1);
    waarde := eval(L[i]);
    the_table ,= [naam, waarde]:
end do:

# Converteer de tabel naar lijstformaat voor presentatie
the_table := convert(the_table, listlist):
DocumentTools:-Tabulate(the_table, width=60):

 

# Definieer lijst van polynomen
L := [u[0]*ux[0]*uxx[0],
      u[0]*ux[0]*uxx[1] + u[0]*ux[1]*uxx[0] + u[1]*ux[0]*uxx[0],
      u[0]*ux[0]*uxx[2] + u[0]*ux[1]*uxx[1] + u[0]*ux[2]*uxx[0] +
      u[1]*ux[0]*uxx[1] + u[1]*ux[1]*uxx[0] + u[2]*ux[0]*uxx[0]]:

# Print de tabelkop met een vaste breedte
printf("%-12s %-60s\n", "Polynoom", "Waarde"):

# Print elke rij met polynoomnaam en corresponderende waarde
for i from 1 to nops(L) do
    naam := cat("polynoom_", i-1);
    waarde := eval(L[i]);
    printf("%-12s %-60s\n", naam, convert(waarde, string)):
end do:

Polynoom     Waarde                                                      
polynoom_0   u[0]*ux[0]*uxx[0]                                           
polynoom_1   u[0]*ux[0]*uxx[1]+u[0]*ux[1]*uxx[0]+u[1]*ux[0]*uxx[0]       
polynoom_2   u[0]*ux[0]*uxx[2]+u[0]*ux[1]*uxx[1]+u[0]*ux[2]*uxx[0]+u[1]*ux[0]*uxx[1]+u[1]*ux[1]*uxx[0]+u[2]*ux[0]*uxx[0]

 
 

 

Download polynoom_adomian_uitvoerprocedure_2_variabelen_in_tabel_7-11-2024.mw

seems that output:
[u[0]*ux[0]*uxx[0], u[0]*ux[0]*uxx[1] + u[0]*ux[1]*uxx[0] + u[1]*ux[0]*uxx[0], u[0]*ux[0]*uxx[2] + u[0]*ux[1]*uxx[1] + u[0]*ux[2]*uxx[0] + u[1]*ux[0]*uxx[1] + u[1]*ux[1]*uxx[0] + u[2]*ux[0]*uxx[0]]
could be correct in a different notation only 
to check...

L := [u[0]*ux[0]*uxx[0], 
      u[0]*ux[0]*uxx[1] + u[0]*ux[1]*uxx[0] + u[1]*ux[0]*uxx[0], 
      u[0]*ux[0]*uxx[2] + u[0]*ux[1]*uxx[1] + u[0]*ux[2]*uxx[0] + 
      u[1]*ux[0]*uxx[1] + u[1]*ux[1]*uxx[0] + u[2]*ux[0]*uxx[0]]:

# Toewijzen van elk element aan een dynamische naam L1, L2, ...
for i from 1 to nops(L) do
    assign(cat(L, i), L[i]);
end do:

# Weergeven van de variabelen en hun waarden
for i from 1 to nops(L) do
    print( polynome(i-1)= eval(cat(L, i)));
end do:

                polynome(0) = u[0] ux[0] uxx[0]

      polynome(1) = u[0] ux[0] uxx[1] + u[0] ux[1] uxx[0]

         + u[1] ux[0] uxx[0]

 polynome(2) = u[0] ux[0] uxx[2] + u[0] ux[1] uxx[1]

    + u[0] ux[2] uxx[0] + u[1] ux[0] uxx[1] + u[1] ux[1] uxx[0]

    + u[2] ux[0] uxx[0]
First 20 21 22 23 24 25 26 Last Page 22 of 74