MaplePrimes Questions

 I'd like to  make following function  composition 6 times,  the  notation @  is used  6 times.  How to write it easily?

f:=x->sqrt(1+x);
(f@f@f@f@f@f)(x)

HOW TO WRITE BOX COUNTING DIMENSION IN FRCATAL

Hello

I have lots of lists of indexed variables (I am not sure if that is the correct name for it. Please correct me if it is not).  One example is (length of the list can change as well as the indices of the variables):

ans1 := [alpha[3, 7], alpha[3, 8], alpha[3, 9]]

and I need to retrieve two lists from it:  1) [3,3,3] and 2) [7,8,9].  I could not figure out how to do it.

Many thanks.

Ed

Dear Brothers and Sisters,

I faced warnning while simulating the code below was running

restart;
with(plots);
beta := 0.143e-1; delta := 0.7e-1; PI := 2.5; mu := 0.16e-1; tau := .7; rho := 0.4e-3; epsilon := .15; sigma[2] := 0.2e-1; sigma[1] := 0.1e-3; eta := 0.1e-1;
a[1] := 2; a[2] := 5; w[1] := 10; w[2] := 50; w[3] := 20; T := 4;


u[1] := min(max(0, z), 1); z := beta*(1-u[3])*s(t)*(sigma[2]*e(t)+sigma[1]*i[t])*(lambda[2](t)-lambda[1](t))/w[1]; u[2] := min(max(0, c), 1); c := (lambda[2](t)*e(t)+beta*i(t)+lambda[4](t)*((1-tau)*delta*e(t)+epsilon*i(t))+lambda[3](t)*(delta*tau*e(t)+epsilon*i(t)))/w[2]+lambda[2](t)*e(t)/w[2]; u[3] := min(max(0, e), 1); e := (beta*(1-u[1])*s(t)*sigma[2]*e(t)+sigma[1]*i[t])/w[3];
Error, recursive assignment

sys := diff(s(t), t) = PI+eta*r(t)-((1-u[1])*(1-u[1]))*beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-mu*s(t), diff(e(t), t) = (((1-u[1])*(1-u[1]))*beta*beta)*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-(u[2]+u[3]+delta+mu)*e(t), diff(i(t), t) = (1-u[2])*tau*delta*e(t)-(u[2]+u[3]+epsilon+rho+mu)*i(t), diff(r(t), t) = (1-u[2])*(1-tau)*delta*e(t)+(1-u[2])*epsilon*i(t)-(mu+eta)*r(t), diff(lambda[1](t), t) = lambda[1]*((1-u[3])*(1-u[1])*beta*(e*sigma[2]+i*sigma[1])-mu)-lambda[2]*(1-u[3])*(1-u[1])*beta*(e*sigma[2]+i*sigma[1]), diff(lambda[2](t), t) = -a[1]+lambda[1]*((1-u[3])*(1-u[1])*beta*sigma[2]*s-lambda[2]*(1-u[3])*(1-u[1])*beta*sigma[2]*s-u[2]-u[3]-delta-mu)-lambda[3]*(1-u[2])*tau*delta-lambda[4]*(1-u[2])*(1-tau)*delta, diff(lambda[3](t), t) = -a[2]+lambda[1]*(1-u[3])*(1-u[1])*beta*sigma[1]*s-lambda[2]*(1-u[3])*(1-u[1])*beta*sigma[1]*s+lambda[3]*(u[2]+u[3]+epsilon+rho+mu)-lambda[4]*(1-u[2])*epsilon, diff(lambda[4](t), t) = -lambda[1]*eta+lambda[4]*(mu+eta), s(0) = 1000000, e(0) = 1000, i(0) = 89, r(0) = 16, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0, lambda[4](T) = 0;
p1 := dsolve({sys}, type = numeric, method = bvp[midrich], abserr = .1);
Error, (in dsolve/numeric/bvp/convertsys) e(t) and e cannot both appear in the given ODE
p2o := odeplot(p1, [t, i(t)], 0 .. 2, numpoints = 100, labels = ["Time (months)", "i"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution
plots[display](p2o);

 

May I get your help please? Thank you in advance. Lokking forward...

Dear friends, please I would like to ask for your help with the following situation: 

Suppose I have an Array   A:=Array([4]);   and I have to take the element A[i], add 1 to it and then append it to A, with i = 1..3. The result would be, 

A:= [4 5 6 7] 

I do know how to perform the task with a for loop, however I know that for large i it is more advisable to use seq for speed reasons.   I cannot find the right syntax to perform such a task with seq. Could you please advise me how to do so? 

Many thanks for your help. 

Hi.

I'm working on an electronics project currently. In that project I have been trying to solve a system of inequalities, as shown by the picture from Maple below:

restart;

R__1 := 1;
lign1 := V__i/(R__4*(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4)) = C*(k__1 - R/R__C + R);
lign2 := V__i*(1/R__1 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__2 - R/R__C + R);
lign3 := V__i*(1/R__2 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__3 - R/R__C + R);
lign4 := V__i*(1/R__3 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__4 - R/R__C + R);
lign5 := V__i*(1/R__1 + 1/R__2 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__5 - R/R__C + R);
lign6 := V__i*(1/R__1 + 1/R__3 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__6 - R/R__C + R);
lign7 := V__i*(1/R__2 + 1/R__3 + 1/R__4)/(1/R__1 + 1/R__2 + 1/R__3 + 1/R__4) = C*(k__7 - R/R__C + R);
solve({lign1, lign2, lign3, lign4, lign5, lign6, lign7}, [R__4, R__2, R__3, R__C, R, C, V__i]);

Here's a picture as well:

However, the solution is simply that V_i = 0 and C=0, which is not really helping me. Am I doing something wrong here or is my system of equalities simply unsolvabe?

 

Can you please post the procedure for interfacing maple with visual molecular dynamics (VMD) software. Thank you.

Hi all,

For some range of my model parameter, the numerical integration fails to give a numerical answer rather a symbolic expression. Any idea why?

Please see this attached.NumericInt.mw.

I'm trying to plot several plottools:-line

 

The only issue is that when I use a mouse to select the lines in the plot only one line segment is plotted. There seems to be no line sequence. How do I group all the lines in to one line structure so the mouse will select them all? [This is because when one selects a line with the mouse in the plot maple highlights it and this can make it easier to follow from other paths]

I want to do the following: Suppose we are given a linear recurrence operator with polynomial coefficients say (n+2)N^2+(2n^2-3n+5)+(n-4) where N is the shift operator with respect to n. I want to apply the following substitution:

(i) N-> (N+1)

(ii) n->n(N^(-1)+1)

and compute the corresponding equation. To do this, I want to use Maple's Ore_Algebra package. However, I could not define N and N^(-1), i.e N inverse, at the same time.

To sum up, I want to get something like

A := Ore_Algebra(shift= [N,n] , dual_shift=[Ninv,n]); however it is not allowed. 

Thanks, in advance.

 

 

Hi, 

I'm pretty new to Maple and am currently trying to figure out this error I have. I tried to load this package http://www.math.lsa.umich.edu/~jrs/software/SF2.4v.txt via the command: 

read "//Users//boe//Desktop//Maple//MapleFiles//SF.txt"; 

however, I got "Warning, `SF` is implicitly declared local to procedure" in return. I also couldn't call any function defined in the package after running the command (I assume it's because of the local to procedure thing). I looked into the source code, and IF I understand correctly, SF is only used as the name of the package and in the line "SF:=table():". I tried modifying to "global SF:=table():", but it doesn't seem to help. 

I have a friend who ran the same command (with the modification to the reading path) with the original source file, but he had no issue using the package. The only difference is that I'm using Maple 2019 while he's using some older version, so I'm assuming version difference is the cause. (or maybe there's some setting to my maple I need to do?)

Any help would be greatly appreciated!

Hello,
I am trying to write a program that will return a partial or complete list of points on an elliptic curve.
In order to do this using examples provided to me, the command "msqrt" was used, which would return FAIL if the conditions were not met.
However, as I am using Maple 2018, this was replcaed with "ModularSquareRoot" which returns an error message.
My question; Is there anyway to circumvent this error message, as it is really causing me a lot of headache. Thanks.

This should be pretty simple. 

    with(Units:-Standard);
    local var::Unit(kg);     #generates a warning
    var := 1;
    var;                     #-> 1 kg... alas this doesn't work (it's just 1)

In other words, I want to declare a variable with an unknown quantity and known `Unit` at the outset similar to how things are done in C-style languages, and later set the numeric value. The goal is to make it easier to manipulate functions that deal with lots of different physics unit types without having to write them each individual line. For example on lines 10-13 I manually include the units when it would be more convenient if they were already tied to the variable they're associated with.

Solving a simple physics problem to find the radius of a planet with the universal gravitational constant & known density:

I know types exists in Maple, i.e. 

    evalfr := proc(expr, iexact::integer := 0) 
      if   0 < iexact   then  return convert(evalf(expr), rational, iexact); 
      elif iexact = -1  then  convert(evalf(expr), rational, exact); 
      else                    return convert(evalf(expr), rational); 
    end if; end proc

This just being a wrapper with `iexact` typed as an `integer` setting up a set of conditionals around `evalf` to rationalize an expression when using `ScientificConstants`.

I've considered using anonymous functions to emulate this behavior with setters and getters, but that seems like overkill for something that is probably builtin. For the time being I have configured my worksheet so it references secondary variables, 

    var := var2*Unit(kg)

This strikes me as somewhat inelegant. Also trying to use the same variable name in-line (i.e. `var := var*Unit(kg)`) gives `Error, recursive assignment`.

I am curious if there is a correct Maple way to do something like this. Or would I have to implement some sort of anonymous function to get the behavior I want? Appreciate any help!

  [1]: https://i.stack.imgur.com/ovZSB.png

Dear all

I have data and a vector d. 
I would like to sum the elements of the vector d corresponding to the index  of the element data <=0.01 

Step 1: we select the index of data that corresponds to data<=0.01

step 2: we select the consecutive index corresponding to data<=0.01

Step 3 : we sum the element of d corresponding to the previous index

step 4: update d=d/number(index) ;

Please see my attached code. It's done by hand how can reformulate the code.

 

 

code_vector.mw

many thanks

 

First 415 416 417 418 419 420 421 Last Page 417 of 2279