MaplePrimes Questions

How to use maple to compute the solution of two coupling equations that both have higher order derivatives? I used dsolve and couldn't solve it.

question928.mw

I must approximate the coefficients a, b, c, and d in an exponential equation. Is it possible to plot?

Please help!

Ea := 0.00762014687*t + a*t^2 + b*t^3 + c*t^4 + d*t^5;
E1 := diff(Ea, t);
E2 := subs(t = 435, Ea);
E3 := subs(t = 528, Ea);
E4 := subs(t = 33168, Ea);

E1 = 5.012764943*10^(-24)*Ea/(exp(Ea/(4.100527530*10^(-21))) - 1)

Aph1.mw

the programs calculates the gcd of 2x2 matrices using procedures. I created a MLA file and loadad this in another work sheet. To my surprise I received an error altghough the original version runs fine.

240926_gcd.mw

given :

Zin := ((Rsp + (omega*L2 - omega02^2*L2/omega)*I)*(Rpp + (omega*L1 - omega01^2*L1/omega)*I) + 0.01*omega^2*L1*L2)/(Rsp + (omega*L2 - omega02^2*L2/omega)*I)

how do I get Maple to cancel out the common term, and simplify this equation into:

Zin := Rpp + (omega*L1 - omega01^2*L1/omega)*I + (0.01*omega^2*L1*L2)/(Rsp + 
(omega*L2 - omega02^2*L2/omega)*I)

Why doesn't Maple do this automatically with something like simplify or some other command?

Thank you!

How to find KKT conditions using maple for maximization function with constraint?

Decision variable are k1 and k2.

Attaching sheet:Q_KKT.mw

Hi

I want to count in a list L with many sublists the number of sublists, that contain m elements and only primes. How can I do that?

Example:

L:=[[2,3,5,7],[7,13,29],[2,3,4],[5,31,53]], m=3

The result should be 2, because only [7,13,29] and [5,31,53] satiesfy both criteria.

Thank you for an answer!

Why Maple gives

           improper op or subscript selector

On this ode? I was not expecting to see steps for this, but was just trying to see what it will show.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1810 and is the same as the version installed in this computer, created 2024, September 18, 18:16 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

ode:=sin(x)*diff(y(x),x$2)+cos(x)*diff(y(x),x)+(sin(x)-cos(x))*y(x)=0;

sin(x)*(diff(diff(y(x), x), x))+cos(x)*(diff(y(x), x))+(sin(x)-cos(x))*y(x) = 0

dsolve(ode);

y(x) = c__1*(tan((1/2)*x)+I)^(1/2+(1/2)*(5-4*I)^(1/2))*(tan((1/2)*x)-I)^((1/2)*(5+4*I+(5+4*I)^(1/2))/(5+4*I)^(1/2))*HeunG(2, 2*(((3/4)*(5-4*I)^(1/2)+7/4-I)*(5+4*I)^(1/2)+5/4+I+(5/4+I)*(5-4*I)^(1/2))/(5+4*I)^(1/2), 1+(1/2)*(10+2*41^(1/2))^(1/2), (1/2)*((5+4*I)^(1/2)*(5-4*I)^(1/2)+5+4*I+2*(5+4*I)^(1/2))/(5+4*I)^(1/2), 1+(5-4*I)^(1/2), 1, 1-I*tan((1/2)*x))+c__2*(tan((1/2)*x)+I)^(1/2-(1/2)*(5-4*I)^(1/2))*(tan((1/2)*x)-I)^((1/2)*(5+4*I+(5+4*I)^(1/2))/(5+4*I)^(1/2))*HeunG(2, -2*(((3/4)*(5-4*I)^(1/2)+(-7/4+I))*(5+4*I)^(1/2)+(-5/4-I)+(5/4+I)*(5-4*I)^(1/2))/(5+4*I)^(1/2), -(1/2)*(5-4*I)^(1/2)+1+(1/2)*(5+4*I)^(1/2), (1/2)*(-(5+4*I)^(1/2)*(5-4*I)^(1/2)+5+4*I+2*(5+4*I)^(1/2))/(5+4*I)^(1/2), 1-(5-4*I)^(1/2), 1, 1-I*tan((1/2)*x))

Student:-ODEs:-ODESteps(ode)

Error, (in Student:-ODEs:-OdeSolveOrder2) improper op or subscript selector

 


 

Download internal_error_ODEsteps_sept_26_2024.mw

Hi I wanna move the expressions except a^2 in the first term of p1 to after a^2 in the last term, and move the expressions except a^2+b^2 in the second term to after a^2+b^2 in the second-to-last term, etc., and achieve the reverse effect on p1 through  operation.

Maple code is as below (I add more letters in maple code compared to the above image)

with(ListTools)

p := map[scan = `+`](proc (x) options operator, arrow; x^3 end proc, [a, b, c, d, e, f, g, h, i, j, k])

[a^3, a^3+b^3, a^3+b^3+c^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3]

(1)

p1 := Reverse(p)

[a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3, a^3+b^3, a^3]

(2)

nops(p1)

11

(3)
 

``

Download The_inverse_operation_of_map_on_the_elements_in_list.mw

How to collect coefficients of eta^j, j=0,1 from (7)?

restart

with(LinearAlgebra)

with(plots)

with(Physics)

interface(showassumed = 0)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

quantumOperators := {H, Id, Mqu, Mqu1, Theta, X, X1}

{H, Id, Mqu, Mqu1, Theta, X, X1}

(2)

Setup(quantumoperators = quantumOperators)

[quantumoperators = {H, Id, Mqu, Mqu1, Theta, X, X1}]

(3)

assume(x::real); assume(t::real)

alias(q = q(x, t), qb = qb(x, t), r = r(x, t), rb = rb(x, t), psi = psi(x, t), phi = phi(x, t), g = g(x, t), gb = gb(x, t), H = H(x, t), X = X(x, t), X1 = X1(x, t), Theta = Theta(x, t), eta = eta(t), Mqu = Mqu(x, t))

q, qb, r, rb, psi, phi, g, gb, H, X, X1, Theta, eta, Mqu

(4)

``

NULL

D1 := (Id*eta-H).X

eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X)

(5)

D2 := diff(D1, x); D3 := subs({diff(X, x) = Mqu}, D2)

eta*Physics:-`*`(Id, diff(X, x))-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, diff(X, x))

 

eta*Physics:-`*`(Id, Mqu)-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, Mqu)

(6)

D3+D1 = D1*Mqu1

eta*Physics:-`*`(Id, Mqu)-Physics:-`*`(diff(H, x), X)-Physics:-`*`(H, Mqu)+eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X) = Physics:-`*`(eta*Physics:-`*`(Id, X)-Physics:-`*`(H, X), Mqu1)

(7)

collect(coeff, eta, 1)

1

(8)

collect(coeff, eta, 0)

0

(9)
 

NULL

Download coefff.mw

Hello,

I am a completely new user; please forgive me for this newbie quesiton:

When trying to solve for the intersection between a parabola and a line (or a similar system), if the solutions involve integers, Maple display the solutions well. However, when the solutions involve square roots, the solution is much less "neat". Please see the picture below.

I wonder if there is some setting I can flip so that Maple outpus solutions with radicals? Thank you.

Daniel

I recently encountered an interesting issue when solving for the domain of a function in Maple using two different approaches, and I am curious about the differences in results between the following commands:

  1. domain := solve(0 < x and x <> 2, x);
  2. domain := solve({0 < x, x <> 2}, x);

I wonder if anyone could explain why Maple might treat these two syntaxes differently.

restart

``

h := proc (x) options operator, arrow; ln(x)/(x-2) end proc

proc (x) options operator, arrow; ln(x)/(x-2) end proc

(1)

domain_ln := solve(x > 0, x)

RealRange(Open(0), infinity)

(2)

denom_undefined := solve(x-2 = 0, x)

2

(3)

domain := solve(`and`(x > 0, x <> 2), x)

RealRange(Open(0), infinity)

(4)

solve({x > 0, x <> 2}, x)

{2 < x}, {0 < x, x < 2}

(5)

``

plot(h(x), x = 0 .. 10, discont = true, color = blue)

 

``


 

Download domain.mw

I am new to Maple will appreciate any advice.

I am trying to write a procedure to solve a cubic equation using fsolve, print the root at each stage, and store results in a table for later use.  

I have restricted the range of fsolve, but I know from other sources that there is a solution within this range.

The instructions work if entered manually line by line, but not as a procedure.

The code is copied below.  Thanks for any suggestions.

Stephen Martin

Reg_IV := proc (beta, n) local alpha, b, c, d, k, `&alpha;L`, 

   `&alpha;R`, delta, eqn, x; `&alpha;L` := 3+beta-6*beta^(1/2);\

   `&alpha;R` := 1-beta; delta := (`&alpha;R`-`&alpha;L`)/n; 

   print(`&beta; = `, evalf(beta, 5), `n = `, evalf(n, 5)); 

   print(`&alpha;L = `, evalf(`&alpha;L`, 5), ` &alpha;R = `, 

   evalf(`&alpha;R`, 5), `&delta; = `, evalf(delta, 5)); 

   print(``); for k from 0 to n+1 do alpha := `&alpha;L`+k*delta\

  ; b := -5+alpha-3*beta; c := 8-4*alpha-6*beta+2*beta^2-2*alpha\

  *beta; d := -(4*beta+4)*(1-alpha-beta); eqn := proc (b, c, d, 

   x) options operator, arrow; {x^3+b*x^2+c*x+d} end proc; x[k] 

   := fsolve(eqn, 0 .. 2); print(evalf(x[k], 5)) end do; 

   print(``); print(evalf(x, 5)) end proc


Reg_IV(0.2, 4);
                    &beta; = , 0.2, n = , 4.

 &alpha;L = , 0.51672,  &alpha;R = , 0.8, &delta; = , 0.070820


                      fsolve(eqn, 0 .. 2)

                      fsolve(eqn, 0 .. 2)

                      fsolve(eqn, 0 .. 2)

                      fsolve(eqn, 0 .. 2)

                      fsolve(eqn, 0 .. 2)

                      fsolve(eqn, 0 .. 2)


   TABLE([0 = fsolve(eqn, 0 .. 2), 1 = fsolve(eqn, 0 .. 2), 

     2 = fsolve(eqn, 0 .. 2), 3 = fsolve(eqn, 0 .. 2), 

     4 = fsolve(eqn, 0 .. 2), 5 = fsolve(eqn, 0 .. 2)])


 

Using the parametric representation of a circle in 2 dimensions:  c + r*cos(t)*v + r*sin(t)*u, t = 0..2*Pi,  where c is the center, r is the radius, v and u are orthogonal unit vectors, I want to animate the circle for r = r1..r2.

Example:

animate(plot, [c+r*cos(t)+r*sin(t),t=0..6.3],r=5..10);

I don't understand why this doesn't work!!  

Thank you

Hi

I am looking for a more efficient way to find all Divisors of n that are smaller than m as

Divisors(n) intersect {seq(i),i=1..m}

For example: For n=24 and m=7 it should result {1.2.3.4.6}.

Thanks for your help!

mm.mw    I want to obtain T_1*P_1*T_2*P_2*T_3*P_3. What should I do?

First 66 67 68 69 70 71 72 Last Page 68 of 2426