litun

85 Reputation

5 Badges

6 years, 326 days

MaplePrimes Activity


These are replies submitted by litun

@tomleslie Thank you very much. Now the code is working for any input parameters Ne and Ng. Any simple alternative to my code will be really helpful. Could you please suggest me some good sources to learn more maple skills.

@tomleslie Thank you very much. Your code works perfectly for me. To make the system consistent, that is, number of equations equal to number of variables.numelems(Eqns1); numelems(V)I removed one equation from the system (removed the equation above Normeq1). If I understood correctly your changes in the code, Pvals is defined as a matrix with the entries as Vsol and Pne(i) is the sum of entries of i-th row. 

I got the error Error, (in Matrix) Vector index out of range by changing the free parameters Ne=25, Ng=20 (all others parameters remain unchanged). I wonder what went wrong after changing Ne. How can I make the code run for any pair of input parameters Ne (>T) and Ng.

@tomleslie 

  1. The number of equations depends of the value of T. For larger T, I need to solve more number of equations.
  2. This code is a small portion of a big maple code, I have missed term. Now, I have defined Pne().
  3. Without 'assign()' statement, the solutions are not assigned to P[i,j] . Running the code without this gives Error, (in fprintf) number expected for floating point format, I do not know how to assign the numerical values to variables without using assignment operator. 
  4. Any help to improve the 'Vsol' of the LinearSolve() method or any other method to solve the above system will be very much helpful to me.

t.mw

 

I forgot to define the constants Id[i] and Idt[i]. They are defined as 

    Id[i] = 1 for i<=T and  0 , otherwsie

    Idt[T]= 1 else Idt[i] = 0 

I have updated the code.

t.mw

@vv Thank you for the suggestion. The code worked for me after I remove one equation.

@vv Thank you for your quick response and the executable code for the older version. When I run the worksheet solntosystem-1.mw in my system with Maple 12, I got only zero values to all P[i,j]. What might be the problem?

@vv  Thank you for your answer. I have included your suggestion, but I am getting only the variables P[i,j] without any numerical values. I have replaced the solve portion in the initial program with the following code. 

> Eqns1 := {Normalizeq}; 
for i from 0 to Ne do 
for j from 0 to Ng do 
Eqns1 := Eqns1 union {eqn[i,j]};
end do;
end do;
> V := [indets(Eqns1)[]]; 
AB := GenerateMatrix(Eqns1, V, augmented); 
Vsol := LinearSolve(AB); 
V = ~Vsol;

I checked that all equations are included in Eqns1. There might be some problem with the second part of the code, which I am not aware of. I need your help again.

@tomleslie Thank you for the great help. I am getting the results in excelsheet (using Maple 17) although some of the entries are not numbers due to different step lengths.  

@mmcdara The second code is working fine for me.  This is very helpful to me.

@mmcdara I am getting the results with the code. Is it possible to use it inside a for loop to get several outputs for corresponding inputs in a single run of the code?

@Carl Love How to make my worksheet into a procedure and call it inside the for loop?

@vv  I have tried the code without `consts` and had the same error. So I have to use `consts`. But the problem is I have to do it manually,i.e., to copy the new values of the parameters  generated every time to the function `consts`.

My querry is that Can the function `consts` take the values of the parameters automatically from the program and then evaluate the expressions as given by you?

 

@vv Which was causing the error in the code? Is it because of the abscence of the form

or

?

@vv 

Again this problem appears in another expression of Ez inspite of using the simplify command. The maple code is attached below.

 test-1.mw

@vv Now simplify does the work for me

1 2 3 Page 1 of 3