Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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.

This seems like a very simple questaion, but I have been spinning my wheels trying to find the answer.

Is there a single command the will return a list of all symbols used in a symbolic expression?

Thank you, David

I want to check whether the last expression is zero symbolically in maple. I am trying to learn how to calculate symbolically in Maple. Any suggestion would be very appreciated.


restart;

with(Physics);
with(Physics[Vectors]);

[`*`, `.`, Annihilation, AntiCommutator, Antisymmetrize, Assume, Bra, Bracket, Check, Christoffel, Coefficients, Commutator, CompactDisplay, Coordinates, Creation, D_, Dagger, Decompose, Define, Dgamma, Einstein, EnergyMomentum, Expand, ExteriorDerivative, Factor, FeynmanDiagrams, FeynmanIntegral, Fundiff, Geodesics, GrassmannParity, Gtaylor, Intc, Inverse, Ket, KillingVectors, KroneckerDelta, LeviCivita, Library, LieBracket, LieDerivative, Normal, NumericalRelativity, Parameters, PerformOnAnticommutativeSystem, Projector, Psigma, Redefine, Ricci, Riemann, Setup, Simplify, SortProducts, SpaceTimeVector, StandardModel, SubstituteTensor, SubstituteTensorIndices, SumOverRepeatedIndices, Symmetrize, TensorArray, Tetrads, ThreePlusOne, ToContravariant, ToCovariant, ToFieldComponents, ToSuperfields, Trace, TransformCoordinates, Vectors, Weyl, `^`, dAlembertian, d_, diff, g_, gamma_]

 

[`&x`, `+`, `.`, ChangeBasis, ChangeCoordinates, Component, Curl, DirectionalDiff, Divergence, Gradient, Identify, Laplacian, Nabla, Norm, Setup, diff]

(1)

 

 

 

H[s]:=sum(Norm(p_[n])^2/2/m+U(q_[n]),n=1..s)+(1/2)*sum(sum(V(q_[i]-q_[j]),j=i..s),i=1..s);

sum((1/2)*Physics:-Vectors:-Norm(p_[n])^2/m+U(q_[n]), n = 1 .. s)+(1/2)*(sum(sum(V(q_[i]-q_[j]), j = i .. s), i = 1 .. s))

(2)

H[N-s]:=sum(Norm(p_[n])^2/2/m+U(q_[n]),n=s+1..N)+(1/2)*sum(sum(V(q_[i]-q_[j]),j=s+1..N),i=s+1..N);

sum((1/2)*Physics:-Vectors:-Norm(p_[n])^2/m+U(q_[n]), n = s+1 .. N)+(1/2)*(sum(sum(V(q_[i]-q_[j]), j = s+1 .. N), i = s+1 .. N))

(3)

 

 

Download Ch3.mw
 

 

 

 

I do not remember is this was asked before.

In other OOP languages such as Java, it allows one to name object variable name same as method name. I found this example on the net for java to illustrate

class Test {

  private boolean isVal;

  public boolean isVal() {
      return isVal;
  }

}

In Maple, this is not allowed. So now I have to come up with new name for either the method or the variable that returns that hidden internal variable.

Here is an example

A:=module()
  option object;
  local is_valid::truefalse:=false;
  export is_valid::static:=proc(_self,$)::truefalse;
    return _self:-is_valid;
  end proc;
end module;

THis gives error

Error, (in A) exported variable `is_valid` cannot be multiply declared

It will be nice if Maple allows this. For now one has to rename either the variable or the method. Which is little annoying.

Is this something that could  be easily added to Maple in a future release?

I changed today my code to use DEtools:-odeadvisor(ode,y(x),[linear]); to check that the ode is linear or not before calling DEtools:-convertAlg 

The problem is that sometimes the advisor returns _linear on what is not linear ode (at least the way it is originally written). Here is an example

              (x+y(x))*diff(y(x),x) = 0;

From help page:

 

In the event that convertAlg cannot isolate for the proper list form (for instance, if the DE is not a linear ODE) then FAIL is returned.

 

So now I am worried  that using odeadvisor to check for linear ode is not the right method.

Is there a build-in method in Maple to check if an ode is linear or not? (I do have my own code to do this, but I thought it is better to use a buildin method, as it will be more robust).

Should DEtools:-odeadvisor(ode,y(x),[linear]) have returned _linear in this case?

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

ode:=(x+y(x))*diff(y(x),x) = 0;
DEtools:-odeadvisor(ode,y(x));
#check if linear ODE
DEtools:-odeadvisor(ode,y(x),[linear]);

(x+y(x))*(diff(y(x), x)) = 0

[_quadrature]

[_linear]

DEtools:-convertAlg(ode,y(x));

FAIL

 

Download why_fail_sept_17_2022.mw

In the website https://en.wikipedia.org/wiki/Geodesic there is an animation of an insect tracing a path on a torus while walking "forward". The caption to the animation says that the path is then by definition a geodesic.

I would like to duplicate this animation in Maple (and other "walking forward" geodesics on other surfaces) which seems to require an exact definition of walking forward but I cannot find such a definition on this or any other website.

Also, I thought that a geodesic is the shortest distance between two points in space, but no such end points are shown in the website's animation. Then how can the word geodesic apply to the insect's path?

Have you ever wondered about the people behind the scenes at Maplesoft? What about the students who help design the products?

This week, we thought we’d introduce ourselves. We are some of the co-op students at Maplesoft, who in between studying believe that Math Matters.

I’ll go first. My name is Pleiades, I’m 21 and my pronouns are they/them. I am a product management intern at Maplesoft, working with Maple Learn and Maple Calculator. I'm not a math student, but my favorite thing about math is how expressive its language is. Mathematical equations and symbols can be used to express incredibly complex ideas, and even if you don't understand the sense, you can still read the "words". My favorite thing about working for Maplesoft is the flexibility. I have many different types of tasks, and I’m able to learn so many different things.

Keep reading, and find out more about my fellow students below!

Quality Assurance:

Hello, my name is Matilda (she/her)! I am 19 years old, studying physics and astronomy at the University of Waterloo. I am part of the QA team here at Maplesoft, working as a quality assurance analyst co-op. I find math fascinating as it is a broad field that can be challenging, but also invokes a lot of creativity. As I am a new addition at Maplesoft, I am excited to work with the various Maple products.  I am looking forward to meeting new students and individuals, and to help grow not only myself but the company further. 

 

My name is Kat, I’m 20 and my pronouns are she/her. In my spare time, I enjoy reading and rock climbing. I am a QA analyst at Maplesoft, mostly working on Maple 2023. I am a student at UW studying mathematical physics and I would like to also minor in astronomy/astrophysics. My favorite thing about math is the objectivity of it, how there is a set structure and logical solution to any problem. I especially like calculus and trigonometry. I’m excited to be at Maplesoft because I will be learning everything about Maple from the inside perspective, which is used in many 300 and 400-level applied math courses that I will be taking at UW. I also really like the office environment and my coworkers.

 

Development:

Hey, my name is Paul C, I am 22 years old, and I am working as a Web and Mobile developer with Steve Metzger for the next 4 months. At the University of Waterloo, I study Mathematical Physics, though, I love the Computational Mathematics courses I’ve taken at UWaterloo. As for the world of Mathematics, I have always been fond of how everything can be thoroughly proven through basic arguments and logic. I am very excited to be working at Maplesoft, as I have for a long time been intrigued as to how Maple, Symbolab, and WolframAlpha function. So, this position is finally giving me the opportunity to truly explore how such software is developed.

Sales:

My name is Robin, I’m 21 years old and my pronouns are he/him. I am currently working as a Business Operations Analyst at Maplesoft, working with the sales department. I am a candidate of Bachelors of Business Administration at Wilfrid Laurier University with a minor in Economics and a specialization in Finance. My favorite thing about math is how it is present everywhere. Numbers help us understand world and Math helps us understand the number. My favorite part about working at Maplesoft is the extremely positive culture that we work in. Rather than competing with other people in the department, sales team has a very healthy approach towards work and are always there to help out each other.

 

Content Creation:

My name is Nikolas (he/him), I’m 20 years old and I’m an undergraduate physics student at the University of Waterloo. I’m part of the math content team at Maplesoft, focussing on creating new content for Maple Learn. The thing I like most about math is that while it may be a very objective discipline, it still involves an incredible amount of creativity. My favourite part of working at Maplesoft is the chance to share what I’ve learned about physics and math through Maple Learn content.

Good morning, afternoon, or evening!  I'm Miles (age 23, he/him), and I'm a UW mathematics student majoring in combinatorics and optimization and minoring in biology.  This term at Maplesoft, I work in content development for Maple Learn, which involves creating examples for the Maple Learn Document Gallery, working on special requests for users, and more.  My favorite thing about math is the fact that it is the analytical backbone of so many other areas of research.  You may think of biological research as performing experiments or medical trials, but behind the scenes, data entry and analysis are key to finding valuable conclusions and discoveries.  Biology is my particular favorite, of course, but there are countless fields of study with these mathematical aspects.

I'm looking forward to expanding my skillset and repertoire of tasks at Maplesoft.  This is my second term working here; last term I got my bearings as a content developer and am looking forward to so much more.  More advanced documents and workshops/presentations are on the horizon! :D

Hi senior, I am using Maple 2022 version. I am facing a issue regrading opening of maple worksheet. If connected with wifi then maple worksheet will open and work properly, while i disconnected the internet, maple crashed and pop up a message to activate license again..

First 156 157 158 159 160 161 162 Last Page 158 of 2097