Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi there.

As we all know if we multiply two polynomials f(x) and g(x) of degrees m and n respectively we get polynomial h(x)= f(x)*g(x) of degree m+n and with m+n+1 coefficients in general. Function modp1(('Multiply')(...)) doing this very well. But sometimes we don't need full resulting h(x) - just subset of monomials and subset of coefficients of h(x) - so we don't need to calculate all m+n+1 coefficients of h(x) and waste time and resources for that.

I would request some additional rework of modp1 package: by adding to modp1(('Multiply')(...)) two optional parameters - degrees of first and last calculating coefficients of h(x).

For example:

h:=modp1(Multiply(f, g,n-1,n+1), p) could calculate only monomials with n-1, n and n+1 degrees and set other monomials to zero.

Or maybe it should be new function:

h:=modp1(Multiply_Truncate(f, g,n-1,n+1), p)

 

Is it possible?

It would be great and very efficient in many tasks.

Thank you.


 

restart;

M__h := 0.352e-1;

0.352e-1

 

0.34e-1

 

0.8354e-1

 

0.96e-2

 

.123

 

0.7258e-1

 

0.214e-1

 

0.219e-1

 

.123

 

.7902

 

.11

 

0.136e-3

 

0.5e-1

 

0.8910e-1

 

0.45e-1

 

.7

 

.7214

 

1.354

 

0.235e-1

(1)

pdes := [diff(B(t, x), t) = M__h-beta__1*B(t, x)*G(t, x)/N__h+beta__2*B(t, x)*G(t, x)/N__h-mu__h*B(t, x)+sigma__h*E(t, x)*(diff(B(t, x), x, x)), diff(C(t, x), t) = beta__1*B(t, x)*G(t, x)/N__h-u[1]*C(t, x)/(1+C(t, x))-mu__h*C(t, x)*(diff(C(t, x), x, x)), diff(DD(t, x), t) = beta__2*DD(t, x)*G(t, x)/N__h-u[1]*DD(t, x)/(1+DD(t, x))-mu__h*DD(t, x)-delta__1*DD(t, x)*(diff(DD(t, x), x, x)), diff(E(t, x), t) = u[1]*C(t, x)/(1+C(t, x))+u[1]*DD(t, x)/(1+DD(t, x))-(mu__h+sigma__h)*E(t, x)*(diff(E(t, x), x, x)), diff(F(t, x), t) = M__b-beta__3*F(t, x)*C(t, x)/N__b+beta__4*F(t, x)*DD(t, x)/N__b-mu__b*F(t, x)*(diff(F(t, x), x, x)), diff(G(t, x), t) = beta__3*F(t, x)*C(t, x)/N__b+beta__4*F(t, x)*DD(t, x)/N__b-mu__b*G(t, x)*(diff(G(t, x), x, x))];

[diff(B(t, x), t) = 0.352e-1-0.891056911e-1*B(t, x)*G(t, x)-0.96e-2*B(t, x)+0.8910e-1*E(t, x)*(diff(diff(B(t, x), x), x)), diff(C(t, x), t) = .6791869919*B(t, x)*G(t, x)-0.45e-1*C(t, x)/(1+C(t, x))-0.96e-2*C(t, x)*(diff(diff(C(t, x), x), x)), diff(DD(t, x), t) = .5900813008*DD(t, x)*G(t, x)-0.45e-1*DD(t, x)/(1+DD(t, x))-0.96e-2*DD(t, x)-0.235e-1*DD(t, x)*(diff(diff(DD(t, x), x), x)), diff(E(t, x), t) = 0.45e-1*C(t, x)/(1+C(t, x))+0.45e-1*DD(t, x)/(1+DD(t, x))-0.9870e-1*E(t, x)*(diff(diff(E(t, x), x), x)), diff(F(t, x), t) = .7214-.1739837398*F(t, x)*C(t, x)+.1780487805*F(t, x)*DD(t, x)-1.354*F(t, x)*(diff(diff(F(t, x), x), x)), diff(G(t, x), t) = .1739837398*F(t, x)*C(t, x)+.1780487805*F(t, x)*DD(t, x)-1.354*G(t, x)*(diff(diff(G(t, x), x), x))]

(2)

bcs := [(D[2](B))(t, 0) = 0, (D[2](B))(t, 1) = 0, (D[2](C))(t, 0) = 0, (D[2](C))(t, 1) = 0, (D[2](DD))(t, 0) = 0, (D[2](DD))(t, 1) = 0, (D[2](E))(t, 0) = 0, (D[2](E))(t, 1) = 0, (D[2](F))(t, 0) = 0, (D[2](F))(t, 1) = 0, (D[2](G))(t, 0) = 0, (D[2](G))(t, 1) = 0, B(0, x) = 100, C(0, x) = 70, DD(0, x) = 50, E(0, x) = 70, F(0, x) = 100, G(0, x) = 70]

[(D[2](B))(t, 0) = 0, (D[2](B))(t, 1) = 0, (D[2](C))(t, 0) = 0, (D[2](C))(t, 1) = 0, (D[2](DD))(t, 0) = 0, (D[2](DD))(t, 1) = 0, (D[2](E))(t, 0) = 0, (D[2](E))(t, 1) = 0, (D[2](F))(t, 0) = 0, (D[2](F))(t, 1) = 0, (D[2](G))(t, 0) = 0, (D[2](G))(t, 1) = 0, B(0, x) = .100, C(0, x) = .70, DD(0, x) = .50, E(0, x) = .70, F(0, x) = .100, G(0, x) = .70]

(3)

sol := pdsolve(pdes, bcs, numeric);

module () local INFO; export plot, plot3d, animate, value, settings; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; end module

(4)

sol:-plot3d([B(t, x), C(t, x)], t = 0 .. 20, x = 0 .. 20)

Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.25):
Newton iteration is not converging

 

``


 

Download spatial_1.mw

Hi all,

We want to find a curve fit for an integer sequence.

We have n such that n^2+n+17 is a prime number.

See oeis.org/A007635 and comments.

Use the Maple CurveFitting package.

I tried with(CurveFitting).

We do not know if this is best represented by a polynomial or exponential curve fit.

 

n2_and_n_and_17_in_OEIS_007635.mw

n2_and_n_and_17_in_OEIS_007635.pdf

Regards,

Matt

Since I am a mathematician, I am wondering how Maple goes about solving an identity for 3 functions.
Let's say we have af1(t)+bf_2(t)+cf_3(t) = 0 for all t. How does maple actually find a triplet a,b,c that works for all real t?
It does with solve(identity( ),[a,b,c]). But what is the theory behind it?
We know, of course, a priori, that such a triplet exists.

Thank you!

mapleatha

 



 


Dear Colleagues,

Apologies for the generic question below.

I am trying to obtain the Nash equilibrium solutions for a two-person game. I am not sure of any in-built packages that can help me in obtaining the solutions computationally. The algorithms that I created do not seem to give good solutions that are meaningful in my application. Any suggestion would be much appreciated. 

Regards,

Omkar

 

 

I've been studying the  drawing  of graph lately .    One of the themes is  1-planar graph .

A 1-planar graph is a graph that can be drawn in the Euclidean plane in such a way that each edge has at most one crossing point,  where it crosses a single additional edge. If a 1-planar graph, one of the most natural generalizations of planar graphs, is drawn that way, the drawing is called a 1-plane graph or 1-planar embedding of the graph.

 

 

 

 

 

I know it is NP hard to determine whether a graph is a 1-planar . My idea is to take advantage of some mathematical software to provide some roughly and  intuitive understanding before determining .

Now,  the layout of vertices or edges becomes important.  The drawing of a plane graph is a good example.

G1:=AddEdge( CycleGraph([v__1,v__2,v__3,v__4]),{{v__2,v__4},{v__1,v__3}}):
DrawGraph(G1)
DrawGraph(G1,style=planar)

K5 := CompleteGraph(5);
DrawGraph(K5);
vp:=[[-1,0],[1,0],[-0.2,0.5],[0.2,0.5],[0,1]];
SetVertexPositions(K5,vp);  #modified the vertex position

DrawGraph(K5);

My problem is that I see that  Maple2020 has updated a lot of layouts about DrawGraph  graph theory backpack , and I don’t know which ones are working towards the least possible number of crossing of  each edges of graph . 

Some links that may be useful:

https://de.maplesoft.com/products/maple/new_features/Maple2020/graphtheory.aspx

https://de.maplesoft.com/support/help/Maple/view.aspx?path=GraphTheory/SetVertexPositions

I think the software can improve some calculations related to topological graph theory, such as crossing number of graph, etc.

 

How to find sgn on maple?

signum.mw

Maple Apps-Venn Diagrams does not work.  In box on the right there is an error message.

#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) }$

 

 

 

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,

I would like to instal Maple 9.5 in my laptop, once I already have some few programs for his version. I don't know how much cost Maple 9.5, and how do download it. 

I live in Brazil.

Thanks in advance.

Carrijo.

jose.carrijo@gmail.com

Hi.

in the ThermophysicalData[Chemicals] package that compute the coefficients for different species how I can find that coefficients for seven coefficients not nine of them

in other words, I am seeking to find Databases for the NASA Seven-Coefficient Polynomial Fits for Calculating Thermodynamic Properties of Individual Species.

Best

How do I use to compute d(logS(t)) and use this to find the closed form solution of S(t)

Hi

I have the following of fractional of ode system.

.How to solve it by maple.

First 55 56 57 58 59 60 61 Last Page 57 of 2097