MaplePrimes Questions

Looking at #6 in http://www.mit.edu/~pax/pdf/qualifying_round_2020_test.pdf

How do I entter the continued fraction in Maple?  I am using the command line interface (actually Emacs).

Hi,

I want to solve a set of equation (four equations) to plot variation of u[i10],u[i20],phi[d0] versus delta[d] for delta[i]=0.5 and different values of alpha (for example, alpha=0, 0.1,0.2)

How can I do that with Maple?

(It should be noted that depending on the sign of phi[d0], one must use Eq. 2a or 2b. The other equations are Eqs. 1,3,4)
I expect to plot figures like the attached figure.

1.zip

I am looking to find a distribution function (both PDF and CDF) for the distance between two points on the unit square.

Each point will be uniformly distributed on the [0,1] interval for both the x and y axes.  The distance between these points (dij) will of course be:

d[i, j] := sqrt((x[i] - x[j])^2 + (y[i] - y[j])^2)

I think that using a convolution may be required, but this is over my head.  If anybody can show me (preferably via a Maple worksheet), I would be very appreciative.

Thank you.

Hello,

I have a question about fitting a function to experiemental data. The experimental data is Di = X(zi) +I*Y(zi) for a zi = [z1 z1+dz ...z1+dz*N], where zi are real values. I want to fit a complex function f(z,a,b,c) to the data zi and Di , where a,b,c are complex-valued parameters. Does someone know how to fit a complex function to a complex data? The Maple function that I found work only with real functions and data.

Hello,

I want to define an orthonormal tetrad basis of my choice in a spacetime having a metric given in some system of coordinates. My problem is that Maple automatically proposes an orthonormal metric but this is not the one that suits my requirements. So, I would like to specify the tetrad basis manually. As an example, I am trying to reproduce the calculations in sections 6 and 7 of the article https://arxiv.org/abs/gr-qc/0510083 . Here, the metric $g$ is given by the line element $ds^2 = - (c(t,r)^2 - v(t,r)^2) dt^2 + 2 v(t,r) dr dt + dr^2 + r^2 (d\theta^2 + sin(\theta)^2 d\phi^2)$ in $(t, r, \theta, \phi)$ coordinates. My chosen signature is (- + + +). Let, us adopt the convention used by Maple and denote spacetime indices by Greek alphabets and tetrad indices by lowercase Latin letters. Now, I would like to define a tetrad $e_a = (V, S, \Theta, \Phi)$ (as in section 7 of the article referred to above) where:

V^\mu = \frac{1}{c\sqrt{1-\beta(t,r)^2}}[1, - (v + c \beta), 0, 0] \\

S^\mu = \frac{1}{c\sqrt{1-\beta^2}}[-\beta, c + v \beta, 0, 0] \\

\Theta^\mu = [0,0,1,0]

\Phi^\mu = [0,0,0,1].

Here, $|\beta(t,r)| < 1$. I do not know how I may specify this in my worksheet. This may come of use somewhere later. Now, with this choice of the tetrad, we know that $g(e_a, e_b) = \eta_{ab}$ with $\eta$ being the Minkowski metric in spherical coordinates. After defining this tetrad basis, I finally want to calculate Einstein tensor, components of energy-momentum tensr etc. I have problem with constructing this orthonormal tetrad basis myself. It would be great if you could help me with this.

 

An additional curiosity: when we work with multiple tetrad bases, is it possible to denote the the tetrad indices by hatted tetrad labels themselves, as in $\eta_{\hat V, \hat \Theta}$?

 

Thank you.
 

restart

with(Physics)

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

(1)

Setup(signature = `-+++`, coordinates = (X = [t, r, theta, phi]))

`* Partial match of  'coordinates' against keyword 'coordinatesystems'`

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (t, r, theta, phi)}

 

`Systems of spacetime Coordinates are: `*{X = (t, r, theta, phi)}

 

[coordinatesystems = {X}, signature = `- + + +`]

(2)

Setup(g_=-(c(t,r)^2 - v(t,r)^2)*dt^2 + 2*v(t,r)*dt*dr + dr^2 + r^2*dtheta^2 + r^2*sin(theta)^2*dphi^2)

[metric = {(1, 1) = -c(t, r)^2+v(t, r)^2, (1, 2) = v(t, r), (2, 2) = 1, (3, 3) = r^2, (4, 4) = r^2*sin(theta)^2}]

(3)

PDETools:-declare(c(t, r), v(t, r))

` c`(t, r)*`will now be displayed as`*c

 

` v`(t, r)*`will now be displayed as`*v

(4)

with(Tetrads)

`Setting lowercaselatin_ah letters to represent tetrad indices `

 

0, "%1 is not a command in the %2 package", Tetrads, Physics

 

0, "%1 is not a command in the %2 package", Tetrads, Physics

 

[IsTetrad, NullTetrad, OrthonormalTetrad, PetrovType, SegreType, TransformTetrad, e_, eta_, gamma_, l_, lambda_, m_, mb_, n_]

(5)

e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078438692614)

(6)

``


 

Download dynBH.mw

 


 

 

 

#include<iostream>
#include<vector>
#include<cmath>
#define NODE 8

using namespace std;
int graph[NODE][NODE] = {
   {0,1,1,0,0,0,0,0},
   {1,0,1,1,1,0,0,0},
   {1,1,0,1,0,1,0,0},
   {0,1,1,0,0,0,0,0},
   {0,1,0,0,0,1,1,1},
   {0,0,1,0,1,0,1,1},
   {0,0,0,0,1,1,0,0},
   {0,0,0,0,1,1,0,0}
};
int tempGraph[NODE][NODE];
int findStartVert() {
   for(int i = 0; i<NODE; i++) {
      int deg = 0;
      for(int j = 0; j<NODE; j++) {
         if(tempGraph[i][j])
            deg++; //increase degree, when connected edge found
      }
      if(deg % 2 != 0) //when degree of vertices are odd
      return i; //i is node with odd degree
   }
   return 0; //when all vertices have even degree, start from 0
}
int dfs(int prev, int start, bool visited[]){
   int count = 1;
   visited[start] = true;
   for(int u = 0; u<NODE; u++){
      if(prev != u){
         if(!visited[u]){
            if(tempGraph[start][u]){
               count += dfs(start, u, visited);
            }
         }
      }
   }
   return count;
}
bool isBridge(int u, int v) {
   int deg = 0;
   for(int i = 0; i<NODE; i++)
      if(tempGraph[v][i])
   deg++;
   if(deg>1) {
      return false; //the edge is not forming bridge
   }
   return true; //edge forming a bridge
}
int edgeCount() {
   int count = 0;
   for(int i = 0; i<NODE; i++)
      for(int j = i; j<NODE; j++)
         if(tempGraph[i][j])
   count++;
   return count;
}
void fleuryAlgorithm(int start) {
   static int edge = edgeCount();
   static int v_count = NODE;
   for(int v = 0; v<NODE; v++) {
      if(tempGraph[start][v]) {
         bool visited[NODE] = {false};
         if(isBridge(start, v)){
            v_count--;
         }
         int cnt = dfs(start, v, visited);
         if(abs(v_count-cnt) <= 2){
            cout << start << "--" << v << " ";
            if(isBridge(v, start)){
               v_count--;
            }
            tempGraph[start][v] = tempGraph[v][start] = 0; //remove edge from graph
            edge--;
            fleuryAlgorithm(v);
         }
      }
   }
}
int main() {
   for(int i = 0; i<NODE; i++) //copy main graph to tempGraph
   for(int j = 0; j<NODE; j++)
      tempGraph[i][j] = graph[i][j];
   cout << "Euler Path Or Circuit: ";
   fleuryAlgorithm(findStartVert());
}

Kind help 

 

 

Hi, I generated latex formate of an equation by using a command of maple but when I paste it into MathType, could not get the required equation, can anyone help me

${\frac {1}{51200\, \left( {x}^{2}+2 \right) ^{6}} \left( -187110\,

 \left( {x}^{2}+2 \right) ^{6}\sqrt {2} \left( {Q}^{3}+ \left( {\frac

{18\,k}{11}}-{\frac{18}{11}} \right) {Q}^{2}+ \left( {\frac {320\,{k}^

{2}}{297}}-{\frac {40\,k}{27}}+{\frac{320}{297}} \right) Q+{\frac {80

\,{k}^{3}}{297}}-{\frac {80\,{k}^{2}}{189}}+{\frac {80\,k}{189}}+{

\frac {640\,\lambda}{2079}}-{\frac{80}{297}} \right) \arctan \left( 1/

2\,x\sqrt {2} \right) -93555\, \left( {x}^{2}+2 \right) ^{6}\pi\,

 \left( {Q}^{3}+ \left( {\frac {18\,k}{11}}-{\frac{18}{11}} \right) {Q

}^{2}+ \left( {\frac {320\,{k}^{2}}{297}}-{\frac {40\,k}{27}}+{\frac{

320}{297}} \right) Q+{\frac {80\,{k}^{3}}{297}}-{\frac {80\,{k}^{2}}{

189}}+{\frac {80\,k}{189}}+{\frac {640\,\lambda}{2079}}-{\frac{80}{297

}} \right) \sqrt {2}-374220\, \left(  \left( {Q}^{3}+ \left( {\frac {

18\,k}{11}}-{\frac{18}{11}} \right) {Q}^{2}+ \left( {\frac {320\,{k}^{

2}}{297}}-{\frac {40\,k}{27}}+{\frac{320}{297}} \right) Q+{\frac {80\,

{k}^{3}}{297}}-{\frac {80\,{k}^{2}}{189}}+{\frac {80\,k}{189}}+{\frac

{640\,\lambda}{2079}}-{\frac{80}{297}} \right) {x}^{10}+ \left( {

\frac {34\,{Q}^{3}}{3}}+ \left( {\frac {204\,k}{11}}-{\frac{204}{11}}

 \right) {Q}^{2}+ \left( {\frac {10880\,{k}^{2}}{891}}-{\frac {1360\,k

}{81}}+{\frac{10880}{891}} \right) Q+{\frac {2720\,{k}^{3}}{891}}-{

\frac {2720\,{k}^{2}}{567}}+{\frac {2720\,k}{567}}+{\frac {21760\,

\lambda}{6237}}-{\frac{2720}{891}} \right) {x}^{8}+ \left( {\frac {264

\,{Q}^{3}}{5}}+ \left( {\frac {432\,k}{5}}-{\frac{432}{5}} \right) {Q}

^{2}+ \left( {\frac {512\,{k}^{2}}{9}}-{\frac {704\,k}{9}}+{\frac{512}

{9}} \right) Q+{\frac {128\,{k}^{3}}{9}}-{\frac {1408\,{k}^{2}}{63}}+{

\frac {1408\,k}{63}}+{\frac {97280\,\lambda}{6237}}-{\frac{128}{9}}

 \right) {x}^{6}+ \left( {\frac {4496\,{Q}^{3}}{35}}+ \left( {\frac {

80928\,k}{385}}-{\frac{80928}{385}} \right) {Q}^{2}+ \left( {\frac {

287744\,{k}^{2}}{2079}}-{\frac {35968\,k}{189}}+{\frac{287744}{2079}}

 \right) Q+{\frac {3328\,{k}^{3}}{99}}-{\frac {3328\,{k}^{2}}{63}}+{

\frac {3328\,k}{63}}+{\frac {10240\,\lambda}{297}}-{\frac{3328}{99}}

 \right) {x}^{4}+ \left( {\frac {10672\,{Q}^{3}}{63}}+ \left( {\frac {

21344\,k}{77}}-{\frac{21344}{77}} \right) {Q}^{2}+ \left( {\frac {

1094656\,{k}^{2}}{6237}}-{\frac {136832\,k}{567}}+{\frac{1094656}{6237

}} \right) Q+{\frac {35584\,{k}^{3}}{891}}-{\frac {35584\,{k}^{2}}{567

}}+{\frac {35584\,k}{567}}+{\frac {235520\,\lambda}{6237}}-{\frac{

35584}{891}} \right) {x}^{2}+{\frac {25376\,{Q}^{3}}{231}}+ \left( {

\frac {12352\,k}{77}}-{\frac{12352}{77}} \right) {Q}^{2}+ \left( -{

\frac {7936\,k}{63}}+{\frac {63488\,{k}^{2}}{693}}+{\frac{63488}{693}}

 \right) Q-{\frac{512}{27}}+{\frac {512\,{k}^{3}}{27}}-{\frac {5632\,{

k}^{2}}{189}}+{\frac {102400\,\lambda}{6237}}+{\frac {5632\,k}{189}}

 \right) x \right) }$

 

 

 

Hi,

I am trying to build a procedure to check to see if an nxn matrix is elementary. I am working with the standard definition of an elementary matrix, a square matrix that is formed by performing exactly one row operation on the corresponding identity matrix. It could also be interpreted as a matrix that is exactly one row operation from becoming the identity matrix. Does anyone have any idea how this might be done?

Thanks!

Hello Everyone,

I am currently in the process of building a user interface where a user can input a ply layup for a composite part which needs to be calculated. I want to forbid the use of non-numerical value in the matrix which represents my ply layup, before it gets sent to be calculated, but I am wondering how to check if my matrix has non-numerical values in it. 

At best, it would not only check if the matrix has non-numerical entries, but also give me the indices where exactly that value is present. I have yet been unsuccessful trying to find a fitting command. Do you perhaps know something that might work.
For clairification, allowable entries are in a range of -90 to 90, so it should not look for the "-" in the matrix. 

Best Regards,
Lennart

Hello Everyone,

So I am currently plotting some data within an embedded plot component using the following code:

SetProperty("DeterminantenRaumPlot1", value, dataplot(DetAnalysisNx2, DetAnalysisDeterm2));

Which is working just fine, DetAnalysisNx2 and DetAnalysisDeterm2 are single rows vectors with numbers in it.

However I need the plot to be in logarithmic mode for the vertical axis, but I do not know how to achieve this. I can set it manually, but when I save and reopen the document and re-do the calculation it turns back to linear vertical axis.

What kind of code segment am I missing? I have tried adding this like 'mode = log' but it is not working with dataplot. Maybe I need a different kind of plot? But then my Vectors will not work anymore, dataplot makes it so easy to use and the setting is available manually.

 

Any help would be fantastic!
Thanks and best regards,
Lennart

Hello all, 

Would you allow me to ask this question?

Is there a way to make the expression 'expression1', given below, to expression 'expression3'?


 

restart;

expression1 := -cos(theta)/2 + sin(theta)*sqrt(3)/2;

-(1/2)*cos(theta)+(1/2)*sin(theta)*3^(1/2)

(1)

expression2 := expand(cos(theta-2/3*Pi));

-(1/2)*cos(theta)+(1/2)*sin(theta)*3^(1/2)

(2)

is(expression1 = expression2);

true

(3)

expression3 := cos(theta-2/3*Pi);

-cos(theta+(1/3)*Pi)

(4)

 


Thank you, 

Download Q20201007.mw

I got a maple key for students which is limited to one device, would that include as well maple calculator for mobile? Because it's another device, and when trying to login with my maple account on the calculator it doesn't recognize my e-mail.

I have four equations,

y = 1/x, y=3, y=1, x=0

restart;

P1 := plots:-implicitplot(y=1/x, x=-1..2, y=0..4, color=black, scaling=constrained):
P2 := plots:-implicitplot(y=3,   x=-1..2, y=0..4, color=black):
P3 := plots:-implicitplot(y=1,   x=-1..2, y=0..4, color=black):

plots:-display([P1,P2,P3]);

How do I fill the area between the first three equations and the y axis (x=0)?

Is it possible to do this with plottools:-transform?

How to obtain the multiple solution and graph given in the paper. 

Stefan Blowing and Slip Effects on Unsteady Nanofluid Transport Past a Shrinking Sheet: Multiple Solutions

https://doi.org/10.1002/htj.21470

 

Can anyone help to get solutions.

Hi,

It might be a really silly question, but I am wondering is it possible to simplify expression like this

a^2+b^2+2*a*b+c^2. Just by looking it we know that we can write it in the form of (a+b)^2+c^2. This is the basic exmaple I come up with. I have very lengthy expressions in maple, which can be factorize like this, but factor command will not work as it will try to factorize entire expression. So I am wondering is it doable in maple or I have to do it manually by collecting terms and check whether they can be factorize or not.

Thanks in Advance.

With Regards

sunit

First 438 439 440 441 442 443 444 Last Page 440 of 2375