MaplePrimes Questions

I find that no matter how I modify the style in the Maple command, the LaTeX output seems to be always fixed. This is a bit frustrating. 

G:=Graph(6,{{1,2},{1,4},{4,5},{2,5},{2,3},{3,6},{5,6}});
DrawGraph(G);
vp:=[[0,0],[0.5,0],[1,0],[0,0.5],[0.5,0.5],[1,0.5]]:
SetVertexPositions(G,vp):
DrawGraph(G);

Latex(G, terminal, 100, 100)

\documentclass{amsart}
\begin{document}
\begin{picture}(100,100)
\qbezier(12.40,87.60)(12.40,50.00)(12.40,12.40)
\qbezier(12.40,87.60)(31.20,50.00)(50.00,12.40)
\qbezier(12.40,12.40)(31.20,50.00)(50.00,87.60)
\qbezier(12.40,12.40)(50.00,50.00)(87.60,87.60)
\qbezier(50.00,87.60)(68.80,50.00)(87.60,12.40)
\qbezier(50.00,12.40)(68.80,50.00)(87.60,87.60)
\qbezier(87.60,87.60)(87.60,50.00)(87.60,12.40)
\put(12.400000,87.600000){\circle*{6}}
\put(10.194,96.943){\makebox(0,0){1}}
\put(12.400000,12.400000){\circle*{6}}
\put(8.726,3.531){\makebox(0,0){2}}
\put(50.000000,87.600000){\circle*{6}}
\put(50.000,97.200){\makebox(0,0){3}}
\put(50.000000,12.400000){\circle*{6}}
\put(50.000,2.800){\makebox(0,0){4}}
\put(87.600000,87.600000){\circle*{6}}
\put(91.274,96.469){\makebox(0,0){5}}
\put(87.600000,12.400000){\circle*{6}}
\put(89.806,3.057){\makebox(0,0){6}}
\end{picture}
\end{document}

 

DrawGraph(G,
stylesheet=[vertexborder=false,vertexpadding=20,edgecolor = "Blue",
vertexcolor="Gold",edgethickness=3], font=["Courier",10],size=[180,180])

Even when I change their colors (any other thing), they always go their own way. I don't know if there is a setting that can make the LaTeX output more flexible and in line with our expectations after adjustment.

Hello, 

Ive followed the examples, and yet not the result the book gave. The question before this one, same type, and i did get the right answer there. 

Would you have a clue why it is not going as planned? 

Translation: "Through a resistancewire with the measured resistance R= (1.5+-0.5)Ohm goes an electric current with the measured strength I= (2.5+-0.05)A, During a timespan of t=(10+-0.5)s develops an amount of heat Q=RI^2*t. Give the estimate of the maximum relative deviation in Q."

Here i got the right answer of .42, and yet when doing the exact same thing in assignment 4, i got the wrong answers. 

Translation: "Two bodies with mass M and m have a massmidpointdistance r. For the gravitational force between these bodies counts: F=y*M*m/r^2, at which y is the gravitational constant. Give an estimation of the maximum realative deviation in F on ground of the following measurementdata: M=(7.0+-0.05)kg, m=(2.0+-0.02)kg and r=(5.0)+-0.05)m."

I had the answer -0.0029. The books says its wrong, but i cant see what i did wrong. 

Translation of the example: "According to the law of Ohm the currentstrength in the stream(/current)circle(circuit) with tension(voltage) U and resistance R is equal to I=U/R. For a given currentcircle((part of a)circuit) is given: U=(30.0+-0.05)Volt and R=(2.5+-0.03)Ohm. Determine the maximum absolute and relative deviation in I. 

Solution

The maximum absolute deviation in I is

This gives the currentstrength:

The maximum realtive deviation in I is: .... or about 1.4%"

Could somebody tell me what i am doing wrong?

Thank you!

Greetings,

The Function

#opdracht 3

R := 1.5; A := 2.5; t := 10; Q := R*A^2*t

1.5

 

2.5

 

10

 

93.750

(1)

NULL

restart

Q := R*A^2*t

R*A^2*t

(2)

diff(R*A^2*t, R)

A^2*t

(3)

diff(R*A^2*t, A)

2*R*A*t

(4)

diff(R*A^2*t, t)

R*A^2

(5)

NULL

R := 1.5; A := 2.5; t := 10

1.5

 

2.5

 

10

(6)

.5*A^2*t+2*R*A*t*0.5e-1+.5*R*A^2

39.6875

(7)

Q := R*A^2*t

93.750

(8)

39.6875/(93.750)

.4233333333

(9)

#Opdracht 4

restart

M := 7; m := 2; r := 5; F := y*M*m/r^2

7

 

2

 

5

 

(14/25)*y

(10)

restart

diff(y*M*m/r^2, M)

y*m/r^2

(11)

diff(y*M*m/r^2, m)

y*M/r^2

(12)

diff(y*M*m/r^2, r)

-2*y*M*m/r^3

(13)

M := 7; m := 2; r := 5; y := 9.81

7

 

2

 

5

 

9.81

(14)

0.5e-1*y*m/r^2+0.2e-1*y*M/r^2+(-2*y*M*m/r^3)*0.5e-1

-0.1569600000e-1

(15)

F := y*M*m/r^2

5.493600000

(16)

-0.1569600000e-1/(5.493600000)

-0.2857142857e-2

(17)

NULL

Download Mapleprimes_Question_Book_2_Paragraph_5.13_Question_4.mw

Why does this not return a quick solution?

sol := solve(.2894606222 = .4090662520/((1+0.1481289280e-2*x)^5.034901366*(1/(1+0.1481289280e-2*x)^5.034901366)^.1986136226), x)

mw.mw

120523_problem_parallel.mw

Last execution block is not producing any output. Why?

The 3x3 nonlinear system I am trying to solve is already a stylized version of my problem, as I already:

  1. Calibrated my equations before attempting to solve for them (search for "Calib_1" in my script)
  2. Split the original 6x6 system into two 3x3 sub-systems (since 3 out of 6 variables only appear in 3 out of 6 equations) and solved for one sub-system

What else can you think of? Should I instead use the parallel solver on the whole 6x6 system rather than just the unsolved 3x3 sub-system?

How to find, if exist, singular solutions? That is, some valuation of some parameters that will yield a solution that cannot be obtained by applying the same valuation to a general solution. Carl Love (who I cannot tag) once mentioned: "The parameter valuations that lead to singular solutions can often be guessed by using valuations that would produce zeros in denominators in the general solution. A singular solution can't be expressed as any instantiation of a generic symbolic solution. By instantiation I mean an assigment of numeric values to some parameters. Here's an example:"

#2x2 matrix and 2x1 vector. 5 parameters (a, b, d, x, y). The 2 decision variables are
#unseen and unnamed in this pure matrix-vector form. Their values are the two entries 
#in the solution vectors S0 and S1.

A:= <a, b; 0, d>;  B:= <x, y>;

#Get a generic solution:
S0:= LinearAlgebra:-LinearSolve(A, B);

#Instantiate 3 parameters (a, d, y) to 0 and solve again:
S1:= LinearAlgebra:-LinearSolve(eval([A, B], [a, d, y]=~ 0)[]);

#Note that no possible instantiation of S0 can produce S1.

Thank you!

A Hamiltonian walk on a connected graph is a closed walk of minimal length which visits every vertex of a graph (and may visit vertices and edges multiple times). (See https://mathworld.wolfram.com/HamiltonianWalk.html)

 

Please note that there is a distinction between a Hamiltonian walk and a Hamiltonian cycle. Any graph can have a Hamiltonian walk, but not necessarily a Hamiltonian cycle.  The Hamiltonian number h(n) of a connected G is the length of a Hamiltonian walk. 

For example, let's consider the graph FriendshipGraph(2).

g:=GraphTheory[SpecialGraphs]:-FriendshipGraph(2);
DrawGraph(g)

Then its Hamiltonian number is 6.  A Hamiltonian walk is as shown in the following picture.

 

 

 

PS: After being reminded by others, I learned that a method in the following post seems to work, but I don't understand why it works for now. 

it's possible to formulate this as a Travelling Salesman Problem by augmenting the sparse graph into a complete graph by adding edges. These new edges represent shortest paths between any two vertices in the original graph and have weight equal to the path length.

 

It seems that the correctness of this transformation requires rigorous proof.

 

Hello Everyone;

Hope you are fine. I I have make a code but there is error and dsolve comand is working. I also need to plot. Kindly help me. I am waiting kind response. Code is attached.

restart; Cm := 1.0; ENa := 50.0; EK := -77.0; ELeak := -54.387; gNa := 120.0; gK := 36.0; gLeak := .3; II := piecewise(`and`(t >= 10, t <= 40), 10.0, 0.); alpha_m := proc (V) .1*(V+40.0)/(1.0-exp((-1)*(V+40.0)/10.0)) end proc; beta_m := proc (V) 4.0*exp((-1)*(V+65.0)/18.0) end proc; alpha_h := proc (V) 0.7e-1*exp((-1)*(V+65.0)/20.0) end proc; beta_h := proc (V) 1.0/(1.0+exp((-1)*(V+35.0)/10.0)) end proc; alpha_n := proc (V) 0.1e-1*(V+55.0)/(1.0-exp((-1)*(V+55.0)/10.0)) end proc; beta_n := proc (V) .125*exp((-1)*(V+65.0)/80.0) end proc; eq1 := diff(V(t), t) = (II-gNa*m(t)^3*h(t)*(V(t)-ENa)-gK*n(t)^4*(V(t)-EK)-gLeak*(V(t)-ELeak))/Cm; eq2 := diff(m(t), t) = alpha_m(V(t))*(1-m(t))-beta_m(V(t))*m(t); eq3 := diff(h(t), t) = alpha_h(V(t))*(1-h(t))-beta_h(V(t))*h(t); eq4 := diff(n(t), t) = alpha_n(V(t))*(1-n(t))-beta_n(V(t))*n(t); ics := {V(0) = -65, h(0) = .6, m(0) = 0.5e-1, n(0) = .32}

1.0

 

50.0

 

-77.0

 

-54.387

 

120.0

 

36.0

 

.3

 

20

 

proc (V) .1*(V+40.0)/(1.0-exp((-1)*(V+40.0)/10.0)) end proc

 

proc (V) 4.0*exp((-1)*(V+65.0)/18.0) end proc

 

proc (V) 0.7e-1*exp((-1)*(V+65.0)/20.0) end proc

 

proc (V) 1.0/(1.0+exp((-1)*(V+35.0)/10.0)) end proc

 

proc (V) 0.1e-1*(V+55.0)/(1.0-exp((-1)*(V+55.0)/10.0)) end proc

 

proc (V) .125*exp((-1)*(V+65.0)/80.0) end proc

 

diff(V(t), t) = 3.683900000-120.0000000*m(t)^3*h(t)*(V(t)-50.0)-36.00000000*n(t)^4*(V(t)+77.0)-.3000000000*V(t)

 

diff(m(t), t) = .1*(V(t)+40.0)*(1-m(t))/(1.0-exp(-.1000000000*V(t)-4.000000000))-4.0*exp(-0.5555555556e-1*V(t)-3.611111111)*m(t)

 

diff(h(t), t) = 0.7e-1*exp(-0.5000000000e-1*V(t)-3.250000000)*(1-h(t))-1.0*h(t)/(1.0+exp(-.1000000000*V(t)-3.500000000))

 

diff(n(t), t) = 0.1e-1*(V(t)+55.0)*(1-n(t))/(1.0-exp(-.1000000000*V(t)-5.500000000))-.125*exp(-0.1250000000e-1*V(t)-.8125000000)*n(t)

 

{V(0) = -65, h(0) = .6, m(0) = 0.5e-1, n(0) = .32}

(1)

sol := dsolve({eq1, eq2, eq3, eq4, ics})

Error, (in dsolve) invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received {{V(0) = -65, h(0) = 3/5, m(0) = 1/20, n(0) = 8/25}}

 

NULL

Download Question1.mw

Thanks

I would like to collect in derivatives of a function(s) in a worksheet where I have the Physics package loaded but It does not want to do it. When I bring the expression to a blank worksheet it does everything just fine. Am I missing something small? Or is there additional commands/options I need to input? 

Thoughts?

CollectDiff.mw

The highly oscillatory integrand is: 

(sin(x + sqrt(x)) + x*BesselJ(0, x^2))/(1 + x): # int(%, x = 0 .. infinity, numeric); # Note that the upper limit of `x` is NOT finite.

Unfortunately, Maple still cannot return a result in a few minutes. For instance, 

restart;
infolevel[`evalf/int`] := 1:

smartplot((sin(x+sqrt(x))+x*BesselJ(0, x^2))/(1+x))

 

timelimit(0.1e3, evalf(Int((sin(x+sqrt(x))+x*BesselJ(0, x^2))/(1+x), x = 0 .. infinity)))

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)
Control: d01amc failed
evalf/int/control: NAG failed result = result
evalf/int/improper: integrating on interval 0 .. infinity
evalf/int/improper: applying transformation x = 1/x
evalf/int/improper: interval is 0 .. 1 for the integrand:

                        /     (1/2)\            /    2\
                     sin\x + x     / + x BesselJ\0, x /
                     ----------------------------------
                                   1 + x               

and interval is 0 .. 1 for the integrand:

                                                /   1 \
                                         BesselJ|0, --|
                        /       (1/2)\          |    2|
                        |1   /1\     |          \   x /
                     sin|- + |-|     | + --------------
                        \x   \x/     /         x       
                     ----------------------------------
                                 /    1\  2            
                                 |1 + -| x             
                                 \    x/               

Control: Entering NAGInt
Control: trying d01ajc (nag_1d_quad_gen)
Control: d01ajc failed
evalf/int/control: NAG failed result = result

evalf/int/control: singularity at left end-point
evalf/int/transform: series contains {x^(1/2), x^(3/2), x^(5/2), x^(7/2), x^(9/2), x^(11/2), x^(13/2), x^(15/2), x^(17/2), x^(19/2), x^(21/2), x^(23/2), x^(25/2)}

evalf/int/singleft: applying transformation x = x^2
evalf/int/singleft: interval is 0 .. 1. for the integrand:

                  /   / 2            \    2        /    4\\  
                2 \sin\x  + csgn(x) x/ + x  BesselJ\0, x // x
                ---------------------------------------------
                                        2                    
                                   1 + x       &nbs