MaplePrimes Questions

Please help me create a variation table of the function in maple like the above figure.

 

restartNULL

NULL``

Can I disable maple's use of the ' function? (aka prime/derivative function)

 

For example, if

 

f := x^2+1

x^2+1

(1)

it's derivative is obtained as

 

Diff(f(x), x) = diff(f(x), x)

Diff(x^2+1, x) = 2*x

(2)

.

We used the prime operator on the f to obtain f' on the right-hand-side.

 

The problem is, I use prime notation as a naming convention like in defining an integral equation such as:

"psi(t)=∫G(t,t')*psi(t') ⅆt' ."

NULL

This is common practice in many texts.

 

Is there a way that I can disable the operator function of ' so I can use it as a naming scheme? I have tried using the Alias( ) command which works on one evaluation but if an equation is passed to another function the Alias( ) command is extinguished by the previous evaluation and it takes the derivative again which is undesired.

how_do_i_disable_prime_operation.mw

I haven't managed to round values with units, and get the trailing zeroes cut away, so I'd like to use the MapleTA:-Builtin:-numfmt function to do the job.

The problem is, that this function doesn't accept values with units.

I have managed to write a rounding function to do the rounding, but the problem here is that it will write the values with trailing zeroes, which isn't what I want.

Any ideas how to fix that?

How to find values of w for which determinant of A is zero?

determinant.mw

I have a proc that takes a function. This function is called  when the proc needs it to. Normally it will simply do a computation. The return is generally ignored(since the proc is a bit non-deterministic). I would like, though, to store values computed within the function in a global variable. I can't seem to use assign since it forces the variable to be local.

I can print the result of the function and it shows up but what is the proper way to assign variables within a function:

e.g.,

plot(store(x),x=1..2);

Then store would somehow store the values passed to the function(and in this case probably returning x). The example is not my use case and may not actually work properly.I cannot use global in the function passed as an argument to create a global variable.

F := proc(f)

    blah blah f(3)
    blah blah f(4)

end proc;

R := []:

F(x->store(R, x));

R = [3,4]

The function

f := sin(x)/sqrt(2+sin(2*x));

has a simple elementary antiderivative but int(f,x) is huge and not elementary. What method would you suggest to find it?

restart;
with(plots):
with(geometry):
_EnvHorizontalName := x:
_EnvVerticalName := y:
R := 11:
r := 7:
a := sqrt(R*r):

b := 2:
circle(C1, [point(P1, [0, 0]), R]):
circle(C2, [point(P2, [R + 2*b + r, 0]), r]):
ellipse(p, (x - R - b)^2/b^2 + y^2/a^2 = 1):
draw([C1(color = yellow, filled = true), 
C2(color = red, filled = true), p(color = blue, filled = true), 
C1(color = black), C2(color = black), p(color = black)], 
axes = none, view = [-15 .. 35, -15 .. 15], scaling = constrained):
alpha := arctan((R - r)/(R + 2*b + r));
long := cos(alpha)*(R + 2*b + r);
evalf(%);
circle(C2, [point(P2, [long, r - R]), r]);
rotation(p1, p, alpha, 'clockwise');
detail(p1);
point(A, 0, -R);
point(B, long, -R);
line(L1, [A, B]);
point(cen, [(143*sqrt(5))/25, -(26*sqrt(5))/25]);
reflection(L2, L1, cen);
detail(L2);
Error, (in geometry:-reflection) unable to compute coeff
Error, (in geometry:-detail) unknown object:  L2

draw([C1(color = yellow, filled = true), C2(color = red, filled = true), p1(color = blue, filled = true), C1(color = black), C2(color = black), p1(color = black), L1(color = black)], axes = none, view = [-15 .. 35, -15 .. 15], scaling = constrained);
A Bug in reflection ? Why these error messages. Thank you.

Given

expr:=c[2]*sin(sqrt(3)*x/2) + c[3]*cos(sqrt(3)*x/2);
expr:=convert(expr,tan);

How to change the second result above (with the tan) back the the original form it was in?

I tried all different convert and simplification commands, and non managed to get back the original form.

convert(expr,sincos);
simplify(expr,size);
#etc...

Maple 2022.1 on windows 10

From an equation list originating from code optimization, a set of parameters and intermediate variables `tx` (where x is an integer) can be extracted.

{la, ra, rb, t, t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9, xa, za}

{la, ra, rb, t, t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9, xa, za}

(1)

 

To extract from this list the intermediate variables for further processing I do

with(StringTools); intermediates := NULL; for i in {la, ra, rb, t, t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9, xa, za} do if `and`(is(FirstFromLeft(convert(i, string), t) = 1), type(parse(convert(i, string)[2]), integer)) then intermediates := intermediates, i end if end do

{intermediates}

{t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9}

(2)

NULL

Quite some code for a little task. Can this be done more efficiently?

Download extract_tx.mw

I want to change the colors of a contour such that the region above zero is represented by a different color instead of yellow color,  and that the colors for conts <0 are one set of colors (maybe yellow to red), and the area for which conts >0 is one color which is very different from the others (so maybe white).

Case4Contour.mw

Hi!

I am doing some vector calculations with maple 2022, and I would like to gain a better understanding of how spherical derivatives of spherical vectors are calculated.  How can I ask maple to show the solution for this calculation?

spherical_derivatives.mw

Thanks in advance!

I want to use union, intersection and minus to find. Help me

I have a whole lot of conditions to test on the signum of answers. This gets difficult to read so I am wondering could something like the following be done?

a, b, c, d := 1, -1, 1, -1;
if a, b, c, d = 1, 0, -1, -1 then
    print("foo");
end if;

The above obviously doesn't work. The reason I would like to do this is it would be simple to read the patterns of 1's and 0's.

Any ideas?

matrix_inverse.mw

Here attached is my script. The execution of the worksheet gets stuck at the MatrixInverse(M) step. What do you suggest in order to speed up the computation?

As you can see, my matrix M is a 3x3 symmetric matrix, but quite convoluted. Eventually, I need to multiply the resulting inverse by another (row) vector.

Thank you for looking into this!

Hello. There is some system of differential equations with respect to the unknowns u1(x), u2(x), u3(x) with boundary conditions. Solved numerically using the dsolve command.
Is it possible to build a graph of a function of the form W=a*u1(x)+b*u2(x)+c*u3(x) based on this solution?

Thank you for your answers.

First 180 181 182 183 184 185 186 Last Page 182 of 2330