Items tagged with integer

Hello everyone, I asked yesterday a question in the newbies section. I have found a partial answer which I detail further down but still have some questions and errors. I hope someone can give me a hand. Thanks. The question is more or less the following: Given the parameter k. One declares a nested list like the following: L[n[1],n[2],...n[k],m[1],m[2],.... m[k] ], where all 'n' and 'm' indexes run in the interval: n[i] =0,1,.. ,d-1 m[i] =0,1,.. ,d-1 QUESTION: How can we translate this list into a square matrix of dimension d^k that has the indexes:
I have seen a number of forum questions concerning showing students the steps in a problem. There seems to be some confusion about how to do this reliabley and easily. A method I have found useful is seen below:
Hello, Earlier this year I reached an impasse with Maple's numerical integration package over the need for a high-resolution (say 50 or more digits) evaluation of multiple integrals for a Bayesian statistics application. An integral such as sqrt(1.+4.852800000000*chi[2]^1411+5.887416960000*chi[1]^200+4.852800000000*chi[1]^100+5.887416960000*chi[2]^2822-21.48043392000*chi[1]^100*chi[2]^1411) over a rectangular range like chi[1]=0..0.9999,chi[2]=0..0.9999999 would return unevaluated. Infolevel[`evalf/int`] explained that the methods available in Maple would not return the required precision. But the problem persisted even when I swallowed my pride and settled for 12 digits of precision. Stuck as I am, I haven't even tried to present the problem to Maple in higher dimensions.
According to the helpfile, the syntax for using the command ReplaceChild in the XMLTools package is ReplaceChild(spec, XMLtree) where spec is an equation which is acceptable to subsop(). However, when I try to do this: XMLTools:-ReplaceChild( [1,1]="foo", doc); where doc is an XMLtree I have previously defined, I receive this error message: Error, (in ReplaceChild) child position must be specified as a positive integer, but received [1, 1]. Sounds like yet another oversight in XMLTools.
I have the following matrix solution problem. A-1 * C * D-1 * A * v = v where C is a square matrix (integer values). A & D are diagonal matrices. (A-1 and D-1 are inverse matrices) The diagonal elements of D are the column sums of the matrix C. The diagonal elements of A also are integer valued). v is a vector of variables whose values I want to solve for. I cannot figure out how I can get Maple to do this. Do I need to use some other software? It seems to me that I should be able to obtain a soltion to the problem. Is there a reason why there may be no solution? Thanks.
I have the following matrix solution problem. M * v = v where M is a square matrix (integer values). v is a vector of variables whose values I want to solve for. I cannot figure out how I can get Maple to do this. Do I need to use some other software? It seems to me that I should be able to obtain a soltion to the problem. Is there a reason why there may be no solution? Thanks.
Can any one of you help me to solve the question below? Please... Question: Find non-negative integers solutions that satisfy the following conditions: Given: p,k,h,a,b,c are integers. The conditions are: (1) a+b+c=k*h-h-h*h+1 (2) (p-k+h)*(p-h-1)*(p-1)-(p-k)*(p-2)*(p)=a*(p-1)+b*(p-h-1)+c*(p-k+h) (3) h>=1 (4) h
Hello everyone, I have written a procedure that makes some calculations for me, which I am calling repeatedly using a simple for loop. Basically what I am doing is using the for loop to change one of the several input parameters to the procedure and then use the result. Here is a quick example: > transmission0:=Matrix(1200,2): reflection0:=Matrix(1200,2): > for m from 1 to 1200 do > freq:=0.0416666666*m: > rcwa(31,0.0,0.2998/freq,6.0e-3,1.0,2234.950223+2237.186291*I,2.042123126+0.1633593958e-1*I,2234.950223+2237.186291*I,1.0,0.8333,18.0e-6,356.0e-6,18.0e-6): > transmission0[m,1]:=freq: >transmission0[m,2]:=te[M+1]:
Hello, everyone! I have a very nice, very sparse linear system (only containing 1s and -1s, with at most 2 entries per column). Thus, I immediately thought to take advantage the SparseIterative (or SparseDirect) methods associated with LinearAlgebra,LinearSolve, but alas, it isn't quite working. This is what I loosely do: gen_linear_system := proc(... some parameters ...) ... ls_m := Matrix(len, total_var, datatype='integer[1]', storage='sparse'); ... (fill matrix with appropriate 1s and -1s) return ls_m; end proc; solve_linear_system := proc(system_matrix::Matrix)
Consider the following three problems: 1) given a list [a,b,c,d,e], return the list [a=1,b=2,c=3,d=4,e=5] 2) given a nested list [a, [b, [c, [d, [e]]]]] return the list [a,b,c,d,e] 3) given an integer in base 10, compute it's base b representation First I will show you what not to do:
L := [a,b,c,d,e];
M := [];
for i from 1 to nops(L) do
  M := [op(M), L[i]=i];
end do;
Building up lists (and sets) incrementally is quadratic time, because each iteration of the loop allocates linear storage to hold the new list. The standard solution is a loop with a temporary variable, assigning to a table:
In response to a question about collecting symbolic powers of polynomials, I suggested a few lines of code that solved the particular problem. Following is a procedure that enhances the technique to mimic, to some degree, the abilities of Maple's collect procedure, which handles integral powers. This enhanced version can take a list of indeterminates. It also permits use of an optional third argument, func, that is applied to the collected coefficients of a power.
i have a program to write and i dont know how to do it. if anybody could hwlp me cheers. Q implement a computer program which fora given positive integer n, a given square matrix A of order n and given vector b which n components, decides whether A is a band matrix with p=2=q and in the positive case solves the system of equations Ax=b by simplification of Gauss Elimination for a band matrices with p=2=q
Please could somebody explain the process Maple uses to factor integers so quickly? Thanks Matthew
I've had considerable difficulty in integrating products of trig functions with Maple. It usually expands the trig functions into forms that just are a mess to deal with. So, I usually handle this by splitting an expression into two parts: a constant term that doesn't depend upon the integration variable and a dependent term. In the past, I've usually done this by hand but have now created a procedure to do this automatically.
Here's an example procedure that I need help with in order to figure out how it produces certain cases of it's output. First, in the case when the argument n is negative does the procedure call itself again in the denominator of the fraction and return the value of the last line of the procedure (inside the inner call to itself)? I also assumed that the special identifier procname was not in unevaluation quotes in order to allow evaluation. Next, I also don't understand how the output for cases when the exponent n is even is produced. What's really confusing is the use of the anonymous mapping (x -> x.x), and also the meaning of the entire expression after the word then. Is that a multiplication of the two expressions in parentheses ? i.e. (x -> x.x)(procname(X, n/2) > Pow := proc(X, n::integer) if n <> x.x)(procname(X, n/2)) else X.procname(X, n-1) end if end:
First 19 20 21 22 23 Page 21 of 23