<

MaplePrimes Questions

In my papers, I frequently use characters surmounted with a symbol, e.g., an "overbar" (used, for example, to denote a sample mean), a caret (or "hat") (used, for example, for Fourier transforms, or estimated value of a parameter), or a tilde.  Can one create surmounted symbols like this in Maple?  If so, please explain how.

Hello,

I'm new to Maple, but somewhat competent in computer mathematics. Below is some code that I wrote. I start off with f, my original function, and try to simplify it. I tried defining some assumptions as best I could. When I calculate the integral, it gives me an odd range of validity.

I'm wondering if I can further add to my assumptions to make the integral result more concise, i.e. without the piecewise range of validity. All my variables in f and g are already real and positive, so there is no reason one of the expressions should be less than zero. 

Thank you in advance for any insight.

 flat-geometry_recalc_Aug20_singleS.mw
 

f := (Pi*x+2*c+2*m)/(mu__c*S)+2*epsilon/(mu__a*S)+(Pi*x+2*c)/(mu__s*S)

(Pi*x+2*c+2*m)/(mu__c*S)+2*epsilon/(mu__a*S)+(Pi*x+2*c)/(mu__s*S)

(1)

g := simplify(f, symbolic)

(((Pi*x+2*c+2*m)*mu__s+2*((1/2)*Pi*x+c)*mu__c)*mu__a+2*epsilon*mu__c*mu__s)/(mu__c*S*mu__a*mu__s)

(2)

`assuming`([g], [S__s::positive]); 1; S__c::positive, S__a::positive, epsilon::positive, mu__s::positive, mu__c::positive, mu__a::positive, c::positive, m::positive

S__c::positive, S__a::positive, epsilon::positive, mu__s::positive, mu__c::positive, mu__a::positive, c::positive, m::positive

(3)

int(1/g, x = 0 .. w, AllSolutions)

`assuming`([int(1/g, x = 0 .. w)], [0 < w])

piecewise(And((c*mu__a*mu__c+c*mu__a*mu__s+epsilon*mu__c*mu__s+m*mu__a*mu__s)/(mu__a*(mu__c+mu__s)) < 0, -2*(c*mu__a*mu__c+c*mu__a*mu__s+epsilon*mu__c*mu__s+m*mu__a*mu__s)/(Pi*mu__a*(mu__c+mu__s)) < w), undefined, mu__s*S*mu__c*(-ln(2)-ln(c*mu__a*mu__c+c*mu__a*mu__s+epsilon*mu__c*mu__s+m*mu__a*mu__s)+ln(Pi*mu__a*mu__c*w+Pi*mu__a*mu__s*w+2*c*mu__a*mu__c+2*c*mu__a*mu__s+2*epsilon*mu__c*mu__s+2*m*mu__a*mu__s))/(Pi*(mu__c+mu__s)))``

(4)

 

NULL


 

Download flat-geometry_recalc_Aug20_singleS.mw

 

Hi, 

I want to insert the symbol ( infinity) in my graph, but I did not succeed . ideas? Thank you

TickmarkQuestion.mw

 

I am providing analysis for a Graph I have made using the GraphTheory kit. I am attempting to find a way to find the Betweeness Centrality. So far I have only found one example of the code which is being used to find the Betweeness Centrality of a Network found in a pdf (Attatched below). I have been able to alter the code accordingly to my data but the last line requires some further understanding of how Matrices work in Maple. This is the line I fail to understand completely:

"""""""" BetweenessCentrality_data := < node_data[1.., 1] | < seq(add (ad_mat[i, j] * wt_mat[i, j], j = 1.. num_characters), i = 1. . num_characters)> >: BetweenessCentrality_sorted := FlipDimension( x[2])))>, 1)  """"""""

And this is all the code leading up to the line in question:

"""""""" data := FileTools:-JoinPath(["Excel", "Inter station database (2).xls"], base = datadir);

M := ExcelTools:-Import(data, "Hoja2");

edge_data := Matrix(727, 3, (i, j) --> M[i, j+2] );

with(ListTools);

node_data := Matrix(727, 2, (i, j) -->M[i, j+2] );

convert(Matrix(<<node_data>>), list);


listednode_data := convert(Matrix(<<node_data>>), list);

MakeUnique(listednode_data);

UniqueListedNode_data := MakeUnique(listednode_data);

node_data := Matrix(numelems(UniqueListedNode_data), 1, (i, j) -->UniqueListedNode_data[i]);
 

num_edges := RowDimension(edge_data);
 

num_characters := RowDimension(node_data);
 

G := Graph(node_data[() .. (), 1], weighted);
 

for i from 1 to num_edges do

AddEdge(G, [{edge_data[i, 1], edge_data[i, 2]}, edge_data[i, 3]])

end do;

wt_mat := WeightMatrix(G);
ad_mat := AdjacencyMatrix(G); """"""""

To provide further context, my graph is strongly connected.

If anyone could kindly provide a breakdown of the line of code in question, It would be very appreciated. 

Here is the link to the pdf I used as source for my code:https://www.maplesoft.com/applications/view.aspx?SID=154530

 

Hi MaplePrimes,

I'm trying to explore the polynomial r = n^2+n+39.  where n is an integer

I want restrictions on n such that r will factor into two trinomials.

Here is how far I got - 

prime_poly_39_explore.mw

The 'has' function may be helpful.

Any help is appreciated.

Regards,

Matt

 

Hi 

I was wondering whether anyone could help me. I am trying to plot a large number of functions on the same graph and am struggling with a way of inputting this without having to manually enter each.

 

Basically, I have a for do loop that runs from i being 0 to n. Within the loop, it takes a[i] = some function of my variables so in essence I have n functions that I would like to plot on the same graph. Currently I'm working with a low number for n to make sure that the code is running how I want it to, however I'm looking to increase my n number significantly which will obviously mean I have a significant number of functions.

I am using:

plot3d({a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], a[16], a[17], a[18], a[19], a[20]}, z = 0 .. m, x = -M .. M, lightmodel = none, orientation = [180, 0, 180], style = surfacecontour, shading = zhue)

to plot my functions however I don't want to have write out each of the a[ ] when increasing this n value. So I was wondering whether anyone has any ideas how to write this in a shorter form?

I hope that makes sense and any help would be greatly appreciated.

So I have two differently parametrised plots:

p1 := plot([2^(1/3)*Pi*AiryAi(x)/(Q*(P*AiryAi(x) + Q*AiryBi(x))), -2*(-0.0008397983056*2^(1/6)*AiryAi(1, x) + 0.004845212367*2^(1/6)*AiryBi(1, x))/((-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x))^3*(648.3911162*2^(1/6)*AiryAi(1, x)/(-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x)) - 648.3911162*2^(1/6)*AiryAi(x)*(-0.0008397983056*2^(1/6)*AiryAi(1, x) + 0.004845212367*2^(1/6)*AiryBi(1, x))/(-0.0008397983056*2^(1/6)*AiryAi(x) + 0.004845212367*2^(1/6)*AiryBi(x))^2)), x = -1 .. 5])

and

p2 := plot([(sin(x) - sin(ap))/K, abs(sin(x)/cos(x)), x = 0 .. 2])

 

I would like to show the sum of these two plots. How would I go about doing this?

 

Does maple provide any platform for running calculation something like cloud facility

When was the Mathematical formula question introduced in Maple TA?

From a book, it shows the following

Verified by hand the last result  above x^(2/3)+y^(2/3)-a^(2/3)=0 is correct. The input is always 2 equations in x and y as shown above, and there is always one constant C in both that needs to be eliminated to obtain a solution (one equation) that contains y,x and any other parameters, but without c.

have been trying to use eliminate command to do the same as above. I assume eliminate is the right command for this. But not able to get close to what the book shows above for final result. 

Does any one knows how obtain same result as above using Maple's eliminate?  (I can't follow the same steps as hand solution, since that would apply only to the above example. I need to use a generic approach). 

Sometimes it is hard to obtain same result using computer as one can do by "hand".

Here is some of my attempts

restart;

assume(x::real,y::real,a::real);
eq1:=x=-a/(1+c^2)^(3/2);
eq2:=y=a*c^3/(1+c^2)^(3/2);

x = -a/(c^2+1)^(3/2)

y = a*c^3/(c^2+1)^(3/2)

result:=eliminate([eq1,eq2],c);
result:=DEtools:-remove_RootOf(result[2,1]):
result:=DEtools:-remove_RootOf(result);
result:=simplify(result,power,symbolic);
result:=expand(result);

[{c = RootOf(_Z^2-RootOf(_Z^3*x+a)^2+1)}, {y*(RootOf(_Z^3*x+a)^2)^(3/2)-RootOf(_Z^2-RootOf(_Z^3*x+a)^2+1)*RootOf(_Z^3*x+a)^2*a+a*RootOf(_Z^2-RootOf(_Z^3*x+a)^2+1)}]

x*((a^2-y^2)*(a*y^2)^(1/3)*a*((a*y^2)^(2/3)+a*(a*y^2)^(1/3)+y^2))^(3/2)/(a*y^2*(a^2-y^2)^3)+a = 0

a*((y^(2/3)*a^(2/3)+a^(4/3)+y^(4/3))^(3/2)*x+(a^2-y^2)^(3/2))/(a^2-y^2)^(3/2) = 0

x*a*(y^(2/3)*a^(2/3)+a^(4/3)+y^(4/3))^(3/2)/(a^2-y^2)^(3/2)+a = 0

 

Download how_to_eliminate.mw

Notice: The reason I am asking the above, is becuase I was doing it this way: I first solve for from one equation, then use this result in the second equation (this is what one would do normally by hand). but this could result in many solutions and hard to know which to pick to match the book result. That is why I am thinking of using Elminate instead:

restart;

assume(x::real, y::real,a::real);
eq1:=x=-a/(1+c^2)^(3/2);
eq2:=y=a*c^3/(1+c^2)^(3/2);

x = -a/(c^2+1)^(3/2)

y = a*c^3/(c^2+1)^(3/2)

#brute force method
c_found:=Vector([solve(eq1,c)])

Vector(6, {(1) = sqrt((-a*x^2)^(2/3)-x^2)/x, (2) = -sqrt((-a*x^2)^(2/3)-x^2)/x, (3) = (1/2)*sqrt(2)*sqrt(I*sqrt(3)*(-a*x^2)^(2/3)-(-a*x^2)^(2/3)-2*x^2)/x, (4) = -(1/2)*sqrt(2)*sqrt(I*sqrt(3)*(-a*x^2)^(2/3)-(-a*x^2)^(2/3)-2*x^2)/x, (5) = (1/2)*sqrt(-(2*I)*sqrt(3)*(-a*x^2)^(2/3)-2*(-a*x^2)^(2/3)-4*x^2)/x, (6) = -(1/2)*sqrt(-(2*I)*sqrt(3)*(-a*x^2)^(2/3)-2*(-a*x^2)^(2/3)-4*x^2)/x})

map(x->simplify(subs(c=x,eq2),symbolic),c_found)

Vector(6, {(1) = y = -(1/4)*sqrt(2)*(I*a^(2/3)*sqrt(3)-a^(2/3)-2*x^(2/3))^(3/2), (2) = y = (1/4)*sqrt(2)*(I*a^(2/3)*sqrt(3)-a^(2/3)-2*x^(2/3))^(3/2), (3) = y = -((1/4)*I)*sqrt(2)*(I*a^(2/3)*sqrt(3)+a^(2/3)+2*x^(2/3))^(3/2), (4) = y = ((1/4)*I)*sqrt(2)*(I*a^(2/3)*sqrt(3)+a^(2/3)+2*x^(2/3))^(3/2), (5) = y = -(a^(2/3)-x^(2/3))^(3/2), (6) = y = (a^(2/3)-x^(2/3))^(3/2)})

 

 

Looking at result above, I think I can safely eliminate all y solutions with complex number I in them. This leaves the last two listed above (real y). Which is a little better than before.

Download how_to_eliminate_brute_force.mw

 

 

with(plottools);

with(plots);

display(line([.8, 0], [1, .2], color = red), line([.6, 0], [1, .4], color = red), line([.4, 0], [1, .6], color = red), line([.2, 0], [1, .8], color = red), line([0, 0], [1, 1], color = red), line([0, .2], [.8, 1], color = red), line([0, .4], [.6, 1], color = red), line([0, .6], [.4, 1], color = red), line([0, .8], [.2, 1], color = red), rectangle([0, 1], [1, 0], color = red, transparency = .5, thickness = 1), axes = none)

how can type print display by for ?

Please help me
 

Download help_plots.mw

into 

 

 

 

I'm trying to solve the following linear system

eq1 := -t*x + y*z = j;
eq2 := t*x + y*z = -m;
eq3 := t*z - x*y = -b;
eq4 := t*z + x*y = a;

I have made many unsuccessful attempts.

Would anyone have the solution to the problem?

Thanks!

Hello

The following maple command returns an error in Maple 14 (internal error in Typesetting ... "invalid subscript selector") but not in Maple 2017.   

f:=(l::list)-> eval([y,y*z-x,-15*x*y-x*z-x],[x,y,z]=~l):

What did I miss?

 

Many thanks

 

Ed

 

 

 

 

 

 

Hello. I want to solve a differential equation on a thickening grid. That is, to be solved first at N=10, then N=20, then N=40 and so on.
Tried the design
for N from 10 to 160 by 2*N do
but for Maple it is difficult. Do you have any ideas how to implement this type of cycle?

First 381 382 383 384 385 386 387 Last Page 383 of 2156