vs140580

490 Reputation

8 Badges

5 years, 17 days

MaplePrimes Activity


These are questions asked by vs140580

I want to use python which has some added installtion inside my system in maplesoft itself as code is it possible

It may use networkx package say.

 

with(Python)

ImportModule("networkx");
Error, (in Python:-ImportModule) unable to start Python: could not create process, C:\Program Files\Maple 2020\bin.X86_64_WINDOWS\mpython

 

Python out will be as below it can be any arbitray Matrix of this for 

A:= [[0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
 [1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.]
 [0. 1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
 [0. 0. 1. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 1. 0. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 1. 0. 1. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 1. 0. 1. 1. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 1. 0. 0. 1. 1. 1. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]

we can observe the ". " is their which we need to replace by , and at the end of each ] inside it should need to be ],

If anyone can give a direct code like if i copy paste the above matrix it will output the maple type matrix for my input

Now A becomes

A:=[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

To remember the progam should work any arbitary such matricies not for this only case.

Any good online training for maple soft to purchase 

K := x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

f := (x, y) -> K; f(t, x);

 

It displays as x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

 

instead of t^3*x^4 + 6*t^2*x^3 + 3*t*x^4 + t^2*x^2 + 2*t*x^3

 

But if i do direct assignment like f := (x, y) ->x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

Then f(t,x) becomes and displays as t^3*x^4 + 6*t^2*x^3 + 3*t*x^4 + t^2*x^2 + 2*t*x^3;

But I want it like f:=(x,y)->K Later I should be able to make f(t,x) or f(p,s) like that K i can take some arbitary polynomial

 

What I mean by shortest distance between vertex and edge is

 

In the above petersen graph consider the vertex say 1 it's distance to

(1,6) will be 0 as 1 is part of the same edge

((1,2) will be 0 again

(1,5) it will zero again

(5,8) will be 1 that is (1,5)-(5,8)

(8,9) it will be 2 that is (1,5)-(5,8)-(8,9)

(5,4) it will be 1 that is (1,5)-(5,4)

(9,10) it will be 2 (1,5)-(5,4)-(9,10)

Etc for all edges the graph from a given vertex v given a Graph G

The order in which the edges are chosen to find the distances should be maintained so that each index in the list correspond to distance of that vertex from the same edge in different vertex lists in a order 

Kind help I apologize to take your time 

In output I need a list say T=[0, 0,1,2,..]

First 18 19 20 21 22 23 24 Page 20 of 24