MaplePrimes Questions

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?

I want to test how well Maple's numeric solver respects a variety of conservation laws. To do so, I must numerically integrate a numerical derivative; however, every method I've tried using does not work. In essence, I need the following code to work.

restart;
with(PDEtools); with(plots); with(DEtools);
pde := diff(v(x, t), t, t) = diff(v(x, t), x, x);
f := xi -> exp(-xi^2);
a := -10; b := 10; dx := 1/50; t_final := 10;

pds := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0, v(x, 0) = f(x + 5), D[2](v)(x, 0) = -eval(diff(f(x), x), x = x + 5)}, numeric, range = a .. b, time = t, spacestep = dx);

sol_proc := rhs(pds:-value(output = listprocedure)[3]);
sol := (x, t) -> piecewise(a < x and x < b, sol_proc(x, t), 0);
int(fdiff(sol(x, t), [t = 0]), a .. b);

Error, (in depends) too many levels of recursion

Verification_24_09_2024.mw

In the attached file, in the subsection named #Transmittance calculation I had an issue with the absolute value calculation. The calculation in the first part for the expression a1 was carried out although with addition of some strange t parameter in the exponent power. The second one just didn`t. I will be more than grateful for some help and advice. In addition, I have been struggling with that for a long time so if you have in mind some book or youtube lesson that clarifies all of that I will be more than happy. Nothing valuable was found on the web so far :(

The result of the function was computed successfully using the proc function, but how to plot the computed image? Using the seq command but the step size can not get the desired, using the for loop is too cumbersome, what should be done?fuxian.mwfuxian.mw

Hi everyone, I buy a new laptop with high resolution (2560x1600), I wanna zoom in the size of toolbar (like the icon size of File, Edit, View,......). I modify the fontsize, so for well-proportioned I wanna modify the icon size but I failed.


 

How can I make some triangles in a bigger triangle knowing its perimeters like this picture?

Hello everyone,

I successfully plotted the intersection point of two linear equations using a matrix-based approach. Still, I’m facing an issue when trying to achieve the same result using the second method — solving the system symbolically and plotting without matrices.

The Matrix-Based Approach (Working): I used the following steps to plot both equations and mark the intersection point (solution). However, when I switch to solving the system symbolically without matrices, I can plot the two lines, but I'm unable to plot the intersection point correctly.

It seems that the symbolic solution isn't being properly converted to a numeric form for pointplot, even though I’m using evalf.

Any help would be greatly appreciated!

Download Linear_System.mw

Hi,
How can I remove the mentioned error in attached worksheet?

s1.mw

I was wondering if there is a way to measure/extract the contact forces that occur during a contact event? Preferably I would like to visualize the contact forces in the 3D result view.

I would also like to extract information about slippage in a contact.

Is this somehow possible?

First 68 69 70 71 72 73 74 Last Page 70 of 2427