MaplePrimes Questions

I was introduced to DataFrame by some kind people here the other day and I thought I understood.  Then I tried this

M := DataFrame(<0,0,0;0,1,a;0,a,1>,rows=[0,1,a],columns=[0,1,a])

Now M[1, a] returns 0.  What's going on here? 

do not accept substitution after line EQ
restart;
with(LinearAlgebra);
A := [1, -2];
B := [-2, 3];
C := [1, 1];
M := [x, y];
ProjPL := proc(C, A, B) local M, AB, AM, Q, eq, EQ, eq1, a, b, c, t, tt, n, dist, x, y, xH, yH, H, CH, no; M := [x, y]; AM := M - A; AB := B - A; Q := Matrix(2, [AM, AB]); eq := Determinant(Q); a := coeff(eq, x); b := coeff(eq, y); c := tcoeff(eq); dist := abs(a + b + c)/sqrt(a^2 + b^2); n := [a, b]; x := C[1] + n[1]*t; y := C[2] + n[2]*t; EQ := eq = 0; tt := solve(subs(x = C[1] + n[1]*t, y = C[2] + n[2]*t, EQ), t); xH := subs(t = tt, x); yH := subs(t = tt, y); H := [xH, yH]; CH := H - C; no := sqrt(CH[1]^2 + CH[2]^2); RETURN(EQ, dist, H, no); end proc;
ProjPL(C, A, B);
Thank you for your help.

Here is a graph (g.txt) in Graphlet (gml) format that I threw up with another program. I want to import it by maple. 

I am expecting to do two things:

  • Import the graph correctly;
  • draw the graph according to the vertex position, vertex color, vertex shape and edge color etc. in the file.

This question may come from https://www.mapleprimes.com/questions/235457-How-To-Draw-A-Directed-but-Maybe-Not-Acyclic. My intention is to use this format to efficiently pass graphs and other attributes such as vertex positions, vertex colors, and edge colors. 

However maple doesn't seem to be able to handle them even it cannot handle  the above first point well.

Import ("G:\\test\\g.gml");
# or 
GraphTheory:-ImportGraph ("G:\\test\\g.gml",graphlet)

Error, (in Import) incorrect syntax in parse: unexpected number (near 12th character of parsed string)

Error, (in GraphTheory:-ImportGraph) incorrect syntax in parse: unexpected number (near 12th character of parsed string)

I'm not sure what type of the mistake is here.

 

Mathematica can do it nicely:

g=Import["G:\\test\\g.gml"]

List @@@ PropertyValue[g, VertexLabels]
GraphEmbedding[g]

 

{{8, "x8"}, {12, "b3"}, {14, "x14"}, {2, "b2"}, {13, "x13"}, {5, 
  "r3"}, {7, "r5"}, {9, "r6"}, {11, "x11"}, {6, "r4"}, {1, "b1"}, {15,
   "x15"}, {3, "r1"}, {4, "r2"}, {10, "x10"}}

{{1080, 1440}, {480, 320}, {660, 560}, {420, 160}, {1380, 880}, {1020,
   720}, {720, 880}, {660, 800}, {2160, 0}, {0, 0}, {1500, 
  480}, {1320, 800}, {1800, 240}, {900, 1120}, {1080, 1360}}

PropertyValue[g, VertexStyle]

 

Is there a way to write a function definition that involves multiple cases so that it looks nice with braces as one would write on paper. 
For example, the function $f(x)=|x|$ which is $f(x)=x$ if $x>0$ and $f(x)=-x$ if $x<0$.

First of all, I'd like to be able to write this out with braces in non-executable math in my worksheet. This would already be great.

Then, is it possible to actually define a function this way (ie, not just display the braces in non-executable, but actually run in executable math and have a defined function)?

I would like to create a fuction from the values in a vector. Say I have a 3 vectors , A,F,Theta.

A=col vect of Amplitudes (order n)
F=col vector of Frequecies (order n)
Theta=col vector of phases (order n)

I want to create a function 

f(x):=x->A[0]*cos(F[0]*x+Theta[0] + A[1]*cos(F[1]*x+Theta[1] + ... + A[n]*cos(F[n]*x+Theta[n]

I would then like to create a vector x, and get the values for f(x). I am trying to create a function that is a sum of sinusoids that I can then create data from using a vector x.

I have tried many things but I can't seem to get it right. Can anyone help me with this.

Thanks

Hello guys,

I created a palette, but when I click on an entry, the following occurs:

If the entry line, where the mouse cursor is, is empty, insertion takes place on this line.
If the input line has any expression and the mouse cursor is to the left of the expression, insertion takes place on the line above.

If the input line has any expression and the mouse cursor is to the right of the expression, insertion takes place on the line below.

Does anyone know how to fix this?

Sincerely,

Oliveira

Before answering, Please Note,

Do not suggest I use

maple <filename.maple>

The conversion in maple to convert an ".mw" file in xmaple for a text file to be executed with

maple command

does not work and I therefore need a way to execute and operate a ".mw" workksheet straight in terminal without the need for X.

This is a Linux based question.

I have batches of about 50 maple processes that I run in parallel accross several 32-core and 64-core servers.
I am not using the built in spawning process commands, but rather run a new instance of maple.

Some of these batches need to be developed in xmaple it is just not feasable to do it in a text editor to be executed by "maple"

QUESTION:

Is there any switches in maple that I can run a ".mw" maple file as a terminal operation without starting the interface ?

e.g. how can I run

xmaple <mystery switches> maplefile.mw   such that the interface doesnt load but the file is executed completely in terminal without the need for X.

Thanks

Hello, 

I am new to modelica modeling in Maplesim, how do I add ports to the custom component created by Modelica Custom Component in MapleSim?

thanks. 

How do I find the maximum value of k by putting dw/dk = 0? Also, how to find the range of k for which w is real? 

restart

w = -(1/2)*sqrt(960*c^6*gamma^2*k^2-336*c^4*gamma^2*k^4+64*c^2*gamma^2*k^6-4*gamma^2*k^8+576*alpha*c^6*gamma*k-288*alpha*c^4*gamma*k^3-16*alpha*c^2*gamma*k^5+8*alpha*gamma*k^7-144*alpha^2*c^4*k^2-48*alpha^2*c^2*k^4-4*alpha^2*k^6+128*c^4*gamma*k^2-40*c^2*gamma*k^4+4*gamma*k^6+48*alpha*c^4*k-16*alpha*c^2*k^3-4*alpha*k^5+4*c^2*k^2-k^4)

w = -(1/2)*(960*c^6*gamma^2*k^2-336*c^4*gamma^2*k^4+64*c^2*gamma^2*k^6-4*gamma^2*k^8+576*alpha*c^6*gamma*k-288*alpha*c^4*gamma*k^3-16*alpha*c^2*gamma*k^5+8*alpha*gamma*k^7-144*alpha^2*c^4*k^2-48*alpha^2*c^2*k^4-4*alpha^2*k^6+128*c^4*gamma*k^2-40*c^2*gamma*k^4+4*gamma*k^6+48*alpha*c^4*k-16*alpha*c^2*k^3-4*alpha*k^5+4*c^2*k^2-k^4)^(1/2)

(1)

diff(w = -(1/2)*(960*c^6*gamma^2*k^2-336*c^4*gamma^2*k^4+64*c^2*gamma^2*k^6-4*gamma^2*k^8+576*alpha*c^6*gamma*k-288*alpha*c^4*gamma*k^3-16*alpha*c^2*gamma*k^5+8*alpha*gamma*k^7-144*alpha^2*c^4*k^2-48*alpha^2*c^2*k^4-4*alpha^2*k^6+128*c^4*gamma*k^2-40*c^2*gamma*k^4+4*gamma*k^6+48*alpha*c^4*k-16*alpha*c^2*k^3-4*alpha*k^5+4*c^2*k^2-k^4)^(1/2), k)

0 = -(1/4)*(1920*c^6*gamma^2*k-1344*c^4*gamma^2*k^3+384*c^2*gamma^2*k^5-32*gamma^2*k^7+576*alpha*c^6*gamma-864*alpha*c^4*gamma*k^2-80*alpha*c^2*gamma*k^4+56*alpha*gamma*k^6-288*alpha^2*c^4*k-192*alpha^2*c^2*k^3-24*alpha^2*k^5+256*c^4*gamma*k-160*c^2*gamma*k^3+24*gamma*k^5+48*alpha*c^4-48*alpha*c^2*k^2-20*alpha*k^4+8*c^2*k-4*k^3)/(960*c^6*gamma^2*k^2-336*c^4*gamma^2*k^4+64*c^2*gamma^2*k^6-4*gamma^2*k^8+576*alpha*c^6*gamma*k-288*alpha*c^4*gamma*k^3-16*alpha*c^2*gamma*k^5+8*alpha*gamma*k^7-144*alpha^2*c^4*k^2-48*alpha^2*c^2*k^4-4*alpha^2*k^6+128*c^4*gamma*k^2-40*c^2*gamma*k^4+4*gamma*k^6+48*alpha*c^4*k-16*alpha*c^2*k^3-4*alpha*k^5+4*c^2*k^2-k^4)^(1/2)

(2)

NULL

NULL

Download drelation.mw

So I have a problem when copying multiple output from Maple to Word. I am using a simple example here. 

When I copy each part of the output as an image SEPERATELY, it comes out much cleaner than if I highlight everything together and then copy. Is there a reason this is the case and is there a way to fix this problem?

Here is the Maple Code:

with(plottools);
with(plots);
ttt1 := textplot([0, 1, "3  +  5  =  __", color = "black", font = ["Arial", "bold", 120]]);
display(ttt1, size = [1000, 200], axes = none);
ttt1 := textplot([0, 1, "1  +  3  =  __", color = "black", font = ["Arial", "bold", 120]]);
display(ttt1, size = [1000, 200], axes = none);

I also uploaded the Maple Worksheet

Here is the output:

There are TWO imges in the output in this example. I tried copying both together and pasting them, and then I tried copying them individually. The output is very different in quality.

The one copied alot is much cleaner once copied and pasted in Word. Does anyone why this is happening? I don't want to have to copy images individally for obvoius reasons. I know this example is only two images but what if there was alot more, etc.

Thank you

NULL

with(plottools); with(plots); ttt1 := textplot([0, 1, "3  +  5  =  __", color = "black", font = ["Arial", "bold", 120]]); display(ttt1, size = [1000, 200], axes = none); ttt1 := textplot([0, 1, "1  +  3  =  __", color = "black", font = ["Arial", "bold", 120]]); display(ttt1, size = [1000, 200], axes = none)

 

 

NULL

Download Copy_Images.mw

y''(x)+2(y'(x))^2+8y(x)=0   

y(0)=0 , y'(0)=1

Hello there, 

Is there any chance to ask if there is a way to simplify the numeric outcome from an operation?

Here is what I've been trying:

restart;

with(LinearAlgebra):

interface(imaginaryunit=j):

Amat := Matrix(2, 2, [[-0.1428571428*K__D, -0.1081971238], [376.9911185, 0]]);

Matrix(2, 2, {(1, 1) = -.1428571428*`#msub(mi("K"),mi("D",fontstyle = "normal"))`, (1, 2) = -.1081971238, (2, 1) = 376.9911185, (2, 2) = 0})

(1)

Eigenvalues(Amat);

Vector(2, {(1) = -0.7142857140e-1*`#msub(mi("K"),mi("D",fontstyle = "normal"))`+0.2000000000e-9*sqrt(0.1275510203e18*`#msub(mi("K"),mi("D",fontstyle = "normal"))`^2-0.1019733868e22), (2) = -0.7142857140e-1*`#msub(mi("K"),mi("D",fontstyle = "normal"))`-0.2000000000e-9*sqrt(0.1275510203e18*`#msub(mi("K"),mi("D",fontstyle = "normal"))`^2-0.1019733868e22)})

(2)

Desired := sqrt((2.000000000*10^(-10))^2 * (1.275510203*10^17*K__D^2 - 1.019733868*10^21));

(0.5102040812e-2*K__D^2-40.78935472)^(1/2)

(3)

 


I tried to simplify the Eigen values, to make them in the formality of the 'Desired' numerical expression, but no success yet. 

Thank you, 

Download Q20230110_m1.mw

Consider this matrix

a b c

b c a

c a b

I would like to reference the entries with letters, not numbers.  The b,c entry would be a, for instance.  Any way to do this?

If I draw a new molecule in chemdraw and save can we input it in someway and get the 3D coordinates , 2D , and many other details which we can get from the structure.

As I am new and I am planning to buy this toolbox please kind help

First 178 179 180 181 182 183 184 Last Page 180 of 2364