janhardo

445 Reputation

8 Badges

10 years, 234 days

MaplePrimes Activity


These are answers submitted by janhardo

I have here an example of a table with a complex function, in which the Explore command is inserted in the table cell.
An absolute complex plot is not attached 
It's more of a draft worksheet to get some ideas 

mprimes_parameter_13-10-2024-salim.mw

@Susana30 
Yes, you can copy it from here. 
To get floating point numbers( decimal)  , add a  period with zero ( i did for  2 ) for one intersection point  in Cartesian coordinates.
 

theta_values := [2.0*Pi/3, 4*Pi/3]:  # The two theta values for the intersection points
with(plots):

# Exercise: Calculate the intersection points in Cartesian coordinates
# Step 1: Solve the equation to find theta
theta_values := [2.0*Pi/3, 4*Pi/3]:  # The two theta values for the intersection points

# Step 2: Calculate the radius values (r) for the found angles
r_circle := map(t -> -6*cos(t), theta_values):  # For the circle

# Step 3: Calculate the Cartesian coordinates for the two intersection points
points_cartesian := [
    [r_circle[1]*cos(theta_values[1]), r_circle[1]*sin(theta_values[1])],  # Intersection point 1
    [r_circle[2]*cos(theta_values[2]), r_circle[2]*sin(theta_values[2])]   # Intersection point 2
]:

# Display the calculated intersection points in Cartesian coordinates
points_cartesian;  # This will display the two points as (x, y)

# Expected output:
# [-1.5, 2.598], [-1.5, -2.598]

# Step 4: Plot the circle and cardioid in polar coordinates
p2 := polarplot([-6*cos(theta), 2 - 2*cos(theta)], theta = 0..2*Pi, color = [green, purple], legend = ["Circle", "Cardioid"]):

# Step 5: Plot the intersection points in Cartesian coordinates
intersection_points := pointplot(points_cartesian, symbol=circle, color=red, symbolsize=15):

# Step 6: Combine the plots
display(p2, intersection_points);

 


 

# Define n, the size of the matrix (n+1 x n+1)
n := 3:  # Example value, you can change it

# Initialize the matrix P
P := Matrix(n+1, n+1):

# Define the binomial coefficient function for clarity
binom := (a, b) -> binomial(a, b):

# Define the entry formula for p_kr
for k from 0 to n do
    for r from 0 to n do
        P[k+1, r+1] := (2*r + 1) * add((-1)^j * binom(n-k, j) * (n+k+j+1)/(k+j+1) *
            add((-1)^l * binom(n-r, l) * (n+r+l+1)/(k+r+l+j+2), l=0..n-r), j=0..n-k);
    end do;
end do;

# Display the matrix P
P;

Matrix(4, 4, {(1, 1) = 9/32, (1, 2) = 73/160, (1, 3) = 29/32, (1, 4) = 1477/160, (2, 1) = 17/480, (2, 2) = 3/32, (2, 3) = 25/96, (2, 4) = 301/96, (3, 1) = 1/160, (3, 2) = 1/32, (3, 3) = 5/32, (3, 4) = 105/32, (4, 1) = -1/160, (4, 2) = -1/32, (4, 3) = -5/32, (4, 4) = 343/32})

(1)

variant  2

# Definieer n (de matrixorde)
n := 3:  # Voorbeeldwaarde

# Initialiseer de matrix P
P := Matrix(n+1, n+1):

# Verkorte notatie voor binomiale coëfficiënt
binom := (a, b) -> binomial(a, b):

# Constructie van de matrixentry-formule met somnotatie
for k from 0 to n do
    for r from 0 to n do
        P[k+1, r+1] := (2*r + 1) * add(
            (-1)^j * binom(n-k, j) * (n+k+j+1) / (k+j+1) *
            add(
                (-1)^l * binom(n-r, l) * (n+r+l+1) / (k+r+l+j+2),
                l=0..n-r),
            j=0..n-k);
    end do;
end do;

# Toon de matrix P
P;

Matrix(4, 4, {(1, 1) = 9/32, (1, 2) = 73/160, (1, 3) = 29/32, (1, 4) = 1477/160, (2, 1) = 17/480, (2, 2) = 3/32, (2, 3) = 25/96, (2, 4) = 301/96, (3, 1) = 1/160, (3, 2) = 1/32, (3, 3) = 5/32, (3, 4) = 105/32, (4, 1) = -1/160, (4, 2) = -1/32, (4, 3) = -5/32, (4, 4) = 343/32})

(2)

 

variant 3

n := 3;  # Define the order of the matrix (replace 5 with your desired order)

# Define binomial coefficients
binom := (a, b) -> binomial(a, b);

# Define p_kr elements
p_kr := (k, r) -> (2*r+1) * sum((-1)^j * binom(n-k, j) * (n+k+j+1)/(k+j+1) *
                       sum((-1)^l * binom(n-r, l) * (n+r+l+1)/(k+r+l+j+2), l=0..n-r), j=0..n-k);

# Generate the matrix P
P := Matrix(n+1, n+1, (k, r) -> p_kr(k-1, r-1));  # Matrix indices in Maple start from 1, so adjust for 0-based indexing

# Display the matrix
#;

n := 3

 

binom := proc (a, b) options operator, arrow; binomial(a, b) end proc

 

p_kr := proc (k, r) options operator, arrow; (2*r+1)*(sum((-1)^j*binom(n-k, j)*(n+k+j+1)*(sum((-1)^l*binom(n-r, l)*(n+r+l+1)/(k+r+l+j+2), l = 0 .. n-r))/(k+j+1), j = 0 .. n-k)) end proc

 

Matrix(%id = 36893491146477614012)

(3)

n := infinity;  # Define the order of the matrix (replace 5 with your desired order)

# Define binomial coefficients
binom := (a, b) -> binomial(a, b);

# Define p_kr elements
p_kr := (k, r) -> (2*r+1) * sum((-1)^j * binom(n-k, j) * (n+k+j+1)/(k+j+1) *
                       sum((-1)^l * binom(n-r, l) * (n+r+l+1)/(k+r+l+j+2), l=0..n-r), j=0..n-k);

# Generate the matrix P
P := Matrix(n+1, n+1, (k, r) -> p_kr(k-1, r-1));  # Matrix indices in Maple start from 1, so adjust for 0-based indexing

# Display the matrix
#;

infinity

 

proc (a, b) options operator, arrow; binomial(a, b) end proc

 

proc (k, r) options operator, arrow; (2*r+1)*(sum((-1)^j*binom(n-k, j)*(n+k+j+1)*(sum((-1)^l*binom(n-r, l)*(n+r+l+1)/(k+r+l+j+2), l = 0 .. n-r))/(k+j+1), j = 0 .. n-k)) end proc

 

Error, (in Matrix) dimension parameters are required for this form of initializer

 

 


 

Download matrix_sommen_-maple_primes.mw

sol := dsolve(sys union ics, {x(t), y(t)}, numeric, method = rkf45, range = 0 .. 20000, maxfun = 10000000, output = listprocedure, abserr = 1e-12, relerr = 1e-12, stepsize = 0.001);

 

 


 

"maple.ini in users"

(1)

f:=(x,y)->3*x^3*exp(2*y)+x^2*y^2;

proc (x, y) options operator, arrow; 3*x^3*exp(2*y)+x^2*y^2 end proc

(2)

f__x:= D[1](f);

proc (x, y) options operator, arrow; 9*x^2*exp(2*y)+2*x*y^2 end proc

(3)

f__xx:=D[1,1](f);

proc (x, y) options operator, arrow; 18*x*exp(2*y)+2*y^2 end proc

(4)

f__x3:=D[1$3](f);

proc (x, y) options operator, arrow; 18*exp(2*y) end proc

(5)

f__y:=D[2](f);

proc (x, y) options operator, arrow; 6*x^3*exp(2*y)+2*x^2*y end proc

(6)

f__yxx:=D[2,1,1](f);

proc (x, y) options operator, arrow; 36*x*exp(2*y)+4*y end proc

(7)

f__xy2x:=D[1,2$2,1](f);# f__xyyx:=D[1,2$2,1](f);

proc (x, y) options operator, arrow; 72*x*exp(2*y)+4 end proc

(8)

 


 

Download maple_primes_post_partiel_diff.mw

with(Student:-Calculus1)
infolevel[Student[Calculus1]] := 1

To get a idea , you can use Hint  from Rule package
If you are uncertain about which rule to apply next to a problem, ask for a hint.
Hint(Limit(-tanh(sqrt(2)*(a*x+b)),x=0));
Check one-sided limits separately
 

The output from the Hint command can always be used as the index to the Rule command.
Rule[[chain]](Diff(sin(x^2), x)); (see example Maple ) , how it goes further ?
 

I assume ax+ b that all variables are real numbers ?

@GFY 
This simplification for now
 

variable := 15

Leaf count value of the original expression: 6879


Leaf count value of method 15 (simplify(e, symbolic)  ,  e is expression                                                  ): 2967

you can check both expressions if they are equal 
example :

restart;
                      "maple.ini in users"

e1 := -sqrt(-(exp(-2 + 2*x) - 2)*exp(-2 + 2*x))/(exp(-2 + 2*x) - 2);
e2 := 1/sqrt(2*exp(-2*x)*exp(2) - 1);
                                                   (1/2)
               (-(exp(-2 + 2 x) - 2) exp(-2 + 2 x))     
       e1 := - -----------------------------------------
                           exp(-2 + 2 x) - 2            

                                  1              
              e2 := -----------------------------
                                            (1/2)
                    (2 exp(-2 x) exp(2) - 1)     

# Definieer de expressies
simplified_e1 := simplify(e1);
simplified_e2 := simplify(e2);


                                                         (1/2)
                     (-(exp(-2 + 2 x) - 2) exp(-2 + 2 x))     
  simplified_e1 := - -----------------------------------------
                                 exp(-2 + 2 x) - 2            

                                       1             
          simplified_e2 := --------------------------
                                                (1/2)
                           (2 exp(-2 x + 2) - 1)     

# Stel de vergelijking op
eq := simplified_e1 = simplified_e2;


                                                  (1/2)   
              (-(exp(-2 + 2 x) - 2) exp(-2 + 2 x))        
      eq := - ----------------------------------------- = 
                          exp(-2 + 2 x) - 2               

                    1             
        --------------------------
                             (1/2)
        (2 exp(-2 x + 2) - 1)     


# Vermenigvuldig beide zijden van de vergelijking met de noemer van de rechterkant
left_side := lhs(eq):
right_side := rhs(eq):
new_eq := left_side*(2*exp(-2*x + 2) - 1) = right_side*(2*exp(-2*x + 2) - 1);


new_eq := - 

                                      (1/2)                         
  (-(exp(-2 + 2 x) - 2) exp(-2 + 2 x))      (2 exp(-2 x + 2) - 1)   
  --------------------------------------------------------------- = 
                         exp(-2 + 2 x) - 2                          

                       (1/2)
  (2 exp(-2 x + 2) - 1)     


# Vereenvoudig de nieuwe vergelijking
simplified_new_eq := simplify(new_eq);


simplified_new_eq := 

                                                             (1/2)   
  (-2 exp(-2 x + 2) + 1) (-(exp(-2 + 2 x) - 2) exp(-2 + 2 x))        
  ---------------------------------------------------------------- = 
                         exp(-2 + 2 x) - 2                           

                       (1/2)
  (2 exp(-2 x + 2) - 1)     


solutions := solve(simplified_new_eq, x);


                         solutions := x

solutions;
                               x


==========================================================================
                      
another example 
# Definieer de expressies
expr1 := exp(x) + exp(-x) assuming(x::complex);
expr2 := 2*cosh(x) assuming(x::complex);

# Stel de vergelijking op
eq := expr1 = expr2:

# Vereenvoudig de vergelijking
simplified_eq := simplify(eq):

# Los de vergelijking op voor x (om te controleren of ze gelijk zijn)
solutions := solve(simplified_eq, x):

# Output de resultaten
simplified_eq;
solutions;

                   expr1 := exp(x) + exp(-x)

                       expr2 := 2 cosh(x)

                  exp(x) + exp(-x) = 2 cosh(x)

                               x

is(expr1 = expr2) assuming(x::complex);
                              true



..as you can see here :
 Each trigonometric function in terms of each of the other five List of trigonometric identities - Wikipedia

(all this mathematical knowledge here on wiki is included in Maple i think) 

Knowing the unit circle and all the graphs of sin, cos , tan for deducing some formulas and for goniometric equations.

Manual adding table in Maple and then add plots into the cells is probably not useful for you?

Got this from someone else here on forum

restart

NULL

NULLz := x+I*y

````

Plts := seq(plot3d([Re(k*log(z)), Im(k*log(z))], x = -3 .. 3, y = -3 .. 3, labels = ["Re(z)", "Im(z)", " ln(z)"], size = [800, 800]), k = [1, 2, 4, 6])
NULL

NULL

 

Plts[1]

Plts[2]

Plts[3]

Plts[4]

 

 

plots:-display(Plts)

NULL

Download complex_log_plot.mw




f := x -> x^sin(x):

Inflpts := [fsolve(D(D(f))(x), x=0..16, maxsols=6)];

Q := map(p->[p,f(p)], Inflpts):

T := seq(plot(D(f)(p)*(x-p)+f(p), x=p-1..p+1, color=red), p=Inflpts):

plots:-display(plot(f, 0.0..16.0, color=black), T,

        plots:-pointplot(Q, symbolsize=10, symbol=solidcircle, color=blue),

        map(p->plots:-textplot(evalf[4]([p[1]-sign(D(f)(p[1]))*2/3,p[2]+1,p]),

                               font=[Times,8]),Q), size=[800,400]);

a example fo infliction points, can be adjusted for find min/max  :to give a idea

with(Student[Basics]);
  [ExpandSteps, FactorSteps, LinearSolveSteps, LongDivision, 

    OutputStepsRecord, PracticeSheet, SolveSteps]


-----------------------------------------------------------------

FactorSteps(Y^2*x^3-x^3);  
How about for complex numbers ?

Given a polynome in C : z^4-2.z^3+ 3.z^2-2.z+2

1 2 Page 2 of 2