MaplePrimes Questions

I've made a worksheet (updated)in which I'm timing a program (GTS2) because it sometimes takes a long time to run, and I am not interested in timing the cases where it takes an exceptionally long time to run I've created a timer function that runs GTS2 through timelimit.

timelimit(20, GTS2(H, F, Na, Nd))

this should run the function for 20 seconds, and then stop it if it overruns, before returning that the whole function ( GTS2timer2  ) has taken 20 seconds.

On line 3.3 GTStimer2 is run with two sets of inputs which give a runtime >40s. My guess is that the 20+ extra seconds that the operation takes are spent running solve which is called in GTS, and I expect i can solve the problem by putting solve in the timelimit function directly (if i'm wrong about this please tell my why).

My question is why timelimit isn't able to stop GTS after 20 seconds.

EDIT:

Playing around with the worksheet the morning after I made it the case that was running for 40+s is now giving the error

Error, (in factor/diophant) time expired

My guess is that as it is stopping the solve in GTS2  needs a try/catch of its own. Any idea how to make that work? 

In Physics package there is this compact notation X=(t,x,y,z)

Is there something similar in the VectorCalculus packge?

For example

restart;

with(VectorCalculus);

SetCoordinates(cartesian[x, y, z]);

v := VectorField([vx, vy, vz]);

Jacobian(v);

 

I don't explicitly want to write the arguments (x,y,z) of the functions vx,vy,vz everytime.

In following loop why Maple returns m=2, where I expect 1?

restart;
X := Vector[row](2, [1, 1]):
M := 1:
for m from 1 to M do

S := X[m] :

end do:
                              
m;
                               2
 

Has anyone installed and run maple under ubuntu installed the Windows Subsystem for Linux?   We are having trouble doing this: specifically running programs with text input files, etc.

 

 

How do I plot just 10 points of the equation?

I got ..

with(plots):
a := x+2*y = 3;
implicitplot(a, x = -5 .. 5, y = -5 .. 5, style = point);
 

but I only need 10 points. How do I do that? Thank you

 

Dear Friends!
I want to generate a system of the equation from the matrices! please help me in this regard! Thanks!

I was making a maple worksheet (out of functions from another), when i noticed that  execution groups and new execution groups that i was making were not showing an output.  I'm wondering why this happens, and how it can be fixed.

in more detail there are 4  [> groups of commands, the first two give the correct output when i hit enter, however, if enter is pressed on any group of commands after the second the command wont return the any output.

I believe this is a formatting issue that comes from the way i cut/paste and edited the previous worksheet down to this, but i'd like to understand so i can avoid it happening again.

3d_plot_of_Lie_derivatives_against_Dimensions_of_solutions_timer.mw

Ahh, this is a teathing problem, I had been using writeto so i could store measurements of RAM; this changes the nature of the question.

How do you implement writeto so only some things are sent there? (in the case of this worksheet the output of GTS2usage
 

Dear users!

Hope everyone fine here. I want to compare the coefficients of like power of exponential function in attachemed file. Please see and fix my problem.

Help.mw

WC51 III
Maple 2015

With straight line selected in following plot, I right-click on plot and select Line → Line Width...  In Set line width dialog I toggle line width to 1 and click OK.

I have the changes I want, but if I choose Restart → Execute Worksheet all my changes are lost.  It is often easier to use the Plot Options Toolbar instead of hunting for Maple syntax to make changes in a plot graphic.  I'm wondering if there is a way to "lock" my plot edits so that they won't disappear as I continue working on a Maple worksheet?

restart;
with(plots);
eq1 := -y^3+x^2+x*y-7; eq2 := y = (8/9)*x-2/3;
implicitplot({eq1, eq2}, x = 0 .. 4, y = 0 .. 3, axis = [gridlines = [6, color = "MidnightBlue"]], size = [1/2, 1], axesfont = ["Roman", bold, 10], thickness = 3);





 

e1 := tau-gamma*S__1-beta*S__1*S__3/(S__3*alpha__1+1)-beta*xi*S__1*S__4/(S__4*alpha__1+1)+phi*S__5 = 0;
e2 := beta*S__1*S__3/(S__3*alpha__1+1)+beta*xi*S__1*S__4/(S__4*alpha__1+1)-(gamma+eta__1+eta__2)*S__2;
e3 := eta__1*S__2-(gamma+gamma__1+delta__1+omega)*S__3;
e4 := eta__2*S__2+omega*S__3-(gamma+gamma__2+delta__2)*S__4;
e5 := delta__1*S__3+delta__2*S__4-(gamma+phi)*S__5;
solve({e1, e2, e3, e4, e5}, {S__1, S__2, S__3, S__4, S__5});
 

Hello,

      I've found that, occasionally, solve won't work if the solving variables are specified---but it will work if the variables aren't specified. For instance:

eqns:=
[x=1, -1/(exp(h)+1/exp(h))^(1/2)/(exp(h)-1/exp(h))^(1/2)*(exp(h)^2-2+1/exp(h)^2)^(1/2)*x = tanh(h)^(1/2)]:

# Works
solve(eqns);

# Doesn't work
solve(eqns, x);

I was wondering why this is, and if there is a workaround?

(I want to specify the solving variables so that solve doesn't attempt to solve for parameters---like h in this case. Also, I'm using solve as opposed to a consistency checker because, in general, I'm applying the same code to larger systems with additional variables to solve for).

Thanks!

I have a say sum(F(k) ,k=1..n)  It fails unless n is an actual integer.  But sum(F(k), k=1..a) works. Then then eval(%,a=n) completes it. That is probably correct but not necessarily a valid assumption. Details in attached. Also it is hard to understand the error message.
 

restart

``

``

Sinta := (k^2+n^2-k)*n/((k^2+n^2-2*k+1)*(k^2+n^2))

(k^2+n^2-k)*n/((k^2+n^2-2*k+1)*(k^2+n^2))

(1)

Ai := sum(Sinta, k = 1 .. n)

-((1/2)*I)*(2*n^2+I*n)*Psi(n-I*n)/(4*n^2+1)+((1/2)*I)*(2*n^2-I*n)*Psi(n+I*n)/(4*n^2+1)+((1/2)*I)*(-2*n^2+I*n)*Psi(n+1-I*n)/(4*n^2+1)-((1/2)*I)*(-2*n^2-I*n)*Psi(n+1+I*n)/(4*n^2+1)+((1/2)*I)*(2*n^2+I*n)*Psi(-I*n)/(4*n^2+1)-((1/2)*I)*(2*n^2-I*n)*Psi(I*n)/(4*n^2+1)-((1/2)*I)*(-2*n^2+I*n)*Psi(1-I*n)/(4*n^2+1)+((1/2)*I)*(-2*n^2-I*n)*Psi(1+I*n)/(4*n^2+1)

(2)

Souta := n/(k^2+n^2-k)

n/(k^2+n^2-k)

(3)

NULL

sum(Souta, k = 1 .. n)

Error, (in assuming) when calling 'Dfnt_4'. Received: 'when calling 'Dfnt_4'. Received: 'when calling 'unknown'. Received: 'invalid input: Dfnt_4 expects its 3rd argument, fpts, to be of type Or(list, piecewise), but received 0'''

 

"(->)"

Error, invalid input: evalf[10] expects 1 argument, but received 0

 

 

 

This works

sum(Souta, k = 1 .. a)

n*Psi(a+1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(a+1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)+n*Psi(1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)

(4)

Ao := eval(%, a = n)

n*Psi(n+1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(n+1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)+n*Psi(1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)

(5)

"(->)"

n*Psi(n+.5000000000-.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)-1.*n*Psi(n+.5000000000+.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)-1.*n*Psi(.5000000000-.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)+n*Psi(.5000000000+.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)

(6)

````

``


 

Download Summation_problem.mw

Hi all, 

Still a new visualisation problem ...
I have two random variables X and Y linked together with a dependency structure named "Gumbel copula" (just a technical stuff, if you prefer replace the bold text by "two correlated gaussian RVs X and Y").

I would like to represent on a same figure:

  • the set {(x[n], y[n]), n=1..N} of a sample of size N drawn from the joint distribution of X and Y
    (a ScatterPlot does this very well, even if I use a plot(..., style =point) in the attached file
     
  • the empirical marginal distribution of X (Histogram), put below the line "y = min({y[n], n=1..N} )" and rotated by 180 degrees
     
  • the empirical marginal distribution of Y (Histogram), put left the line "x = min({x[n], n=1..N} )" and rotated counterclockwise by 90 degrees
     

The attached file gives you two examples.

Ideally, if it's not too much to ask, I would like to have the main axes placed in more adequate locations.
For instance, the option "axes=boxed" reject the axes on the left and bottom boundary of the box which contains the 3 plots (not very astute) ; on the other side the default locations of the axes seem better but one of them "cuts" a histogram ... not very smart.
In fact the position of the axes in the "scatter plot" part is good enough for me and I would like to "add" the two histograms without changing these axes.

Is there a solution to do that (I think I read here a rather close problem where a "zom" of a plot was put within this same plot?) ?
TIA


GumbelCopula.mw

The deltoid plane curve with parameter a  is the set of all points (x, y) in the plane satisfying the equation 
     (1)   (x^2+y^2)^2 - 8ax(x^2 - 3y^2) + 18a^2(x^2+y^2)=27a^4

and the same curve may be described by the parametric equations:

     (2)    
                  x = a (2 cos(t) + cos(2 t))
,      
                  y = a (2 sin(t) - sin(2 t))


(a) Using equation (1) and the command implicitplot graph the deltoid curves with parameters a = 1, 2, and 3 on the same axes.

(b) Using equations (2) and the plot command graph the deltoid curves with parameters a = 1, 2, and 3 on the same axes.

Remark: You will need to do some experimenting with the ranges of the plots and the option numpoints in question (a) to get a decent picture. Note that you can copy and paste equations (1) and (2) and with some judicious editing can save yourself the trouble of typing them. 


      

 

Using spacecurve I've created a diagram of two curves in space, they are reflections in the plane x=y (in this diagram they are labeled k[a1]=k[a2]). How can I add the plane to the diagram?

My intuition is to use 3dplot, and then combine them with display. The problem with that is that 3d plot wants a function of the form z=f(x,y) rather than x=y.

(here is the code for the diagram)

spacecurve({[(5*10^(-4)*100)/C[T], 100*10^(-3)/C[T], C[T]], [100*10^(-3)/C[T], (5*10^(-4)*100)/C[T], C[T]]}, C[T] = 10 .. 100, labelfont = [TIMES, 32], axesfont = [TIMES, 32], titlefont = [TIMES, 32], captionfont = [TIMES, 32], labels = [conjugate(k)[a1], conjugate(k)[a2], conjugate(C)[T]], tickmarks = [[0.1e-2 = k[a1], 5*10^(-3) = 5*k[a1], 10^(-2) = 10*k[a1]], [0.1e-2 = k[a1], 5*10^(-3) = 5*k[a1], 10^(-2) = 10*k[a1]], [0 = 0, 10 = (1/10)*C[T], 50 = (1/2)*C[T], 100 = C[T]]], view = [0 .. 0.1e-1, 0 .. 0.1e-1, 0 .. 100])

First 628 629 630 631 632 633 634 Last Page 630 of 2261