Muhammad Usman

240 Reputation

5 Badges

12 years, 44 days
Beijing, China

MaplePrimes Activity


These are replies submitted by Muhammad Usman

@tomleslie thanks for your response. I need the dat file because I want to use that files to plot the contour in tecplot for better resolution. 

@tomleslie thank you for your response. I have extend your idea but not attained satisfactory results. Please see the highlighted (red) in the attached file

Buitin.mw

@acer thanks for your response

@Carl Love I want to convert the following relation

[Vector(5, {(1) = 1, (2) = 2, (3) = 3, (4) = 4, (5) = 5}), Vector(5, {(1) = 1, (2) = 1/2, (3) = 1/3, (4) = 1/4, (5) = 1/5}), Vector(4, {(1) = -1/2, (2) = -1/6, (3) = -1/12, (4) = -1/20}), Vector(3, {(1) = 1/3, (2) = 1/12, (3) = 1/30}), Vector(2, {(1) = -1/4, (2) = -1/20}), Vector(1, {(1) = 1/5})]

into the matrix form as,

[[[1,1, , , , ],[ , ,-1/(2), , , ],[2,1/(2), ,1/(3), , ],[ , ,-1/(6), ,-1/(4), ],[3,1/(3), ,1/(12),,1/(5)],[ , ,-1/(12), ,-1/(20), ],[4,1/(4), ,1/(30), , ],[ , ,-1/(20), , , ],[5,1/(5), , , , ]]]

Then how can I convert it into the following table using printf/other command

Thanks in advance.

 

@Carl Love Thanks. Let me check it!

@tomleslie thank you for your answer. Yes, I need the results as you obtained in the vector form. But, it is more efficient if you use the following logic to make the table

printf("_______________________________________________________________________________\\n");  
for i from 0 by 1 while i<=2 N do:  
if irem(i,2)=0 then
printf("%2.1f%16.7f%16.7f\\n",i,x[i/(2)],y[i/(2)]);
else  
printf("%2.1f%16.7f%16.7f\\n",i,,); fi;od; printf("_______________________________________________________________________________\\n")
I tried to make the table but find some errors. Kindly have a look. Thanks

@Preben Alsholm thanks for highlighting the mistake. I am sending you modify version. But facing same problem. Please have a look and give me some positive response.

Compare_coeff.mw

@Kitonum Thanks its very useful. 

@tomleslie thanks for your answer. The piecewise function are not shown as you mentioned before Eq. (1) and (2). The appropriate form of piecewise function that I need presented in the file. Kindly help me to fix the problem. Thanks

pwFunc.mw

@acer Sorry its missing. L is the maximum value of abs(diff(f, y)) for all a ≤ x ≤ b, -∞ < y < ∞ for any function f(x,y) or

abs(diff(f, y))<=L for all a ≤ x ≤ b, -∞ < y < ∞

M is the maximum value of abs(diff(y, x, x, x)) for all a ≤ x ≤ b, -∞ < y < ∞ for any function of y(x) or

abs(diff(y, x, x, x))<=M for all a ≤ x ≤ b, -∞ < y < ∞

For example for f:=y-x^(2)+1; 0 ≤ x ≤ 2, -∞ < y < ∞ and y:=(x+1)^2-.5*exp(x); 0 ≤ x ≤ 2, -∞ < y < ∞

the values of L = 1 and M = 0.5exp(2)

@acer thanks for your reply. I have one more question. In the beginning of the following file I declared Digits:=10. But some of values like Y[1,1,1], Y[1,2,1], Y[1,2,2]... have 9 digits after the point decimal (.) like 1.213233616, 1.213873330, 1.214086568 respectively. I need the 10 digits after point decimal (.) which command I have to use instead of Digits?

Refine_Extrapolation.mw

@Kitonum thanks for your answer. I tried to make the above table (Table 5.17 without character y[1,1],y[2,1],y[3,1] etc.) in the following file can you fix it? Because it is more convenient for me. 

I have one more question. In the beginning of the following file I declared Digits:=10. But some of values like Y[1,1,1], Y[1,2,1], Y[1,2,2]... have 9 digits after the point (.) like 1.213233616, 1.213873330, 1.214086568 respectively. I need the 10 digits after point (.) which command I have to use instead of Digits?

Refine_Extrapolation.mw

@tomleslie , In addition, I want to recall a vector B in file Q3 at highlighted portion whereas B matrix is present in file Q4. Which is the command to recall or import a B matrix in file Q3 at highlighted portion from another file Q4.

I shall be very grateful for your support.

Q3.mwQ4.mw

@tomleslie thanks. I fix my problem by doing some change in your above shared file (genMAt2). Now I want to know the solution of one more querry. 

In file Q2 we have a Vector b with some entries which are actually the values of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2] in such a following way

(Vector(8, {(1) = chi[1, 1, 1], (2) = chi[1, 1, 2], (3) = chi[1, 2, 1], (4) = chi[1, 2, 2], (5) = chi[2, 1, 1], (6) = chi[2, 1, 2], (7) = chi[2, 2, 1], (8) = chi[2, 2, 2]})) = (Matrix(8, 1, {(1, 1) = 0, (2, 1) = 0, (3, 1) = 0, (4, 1) = 0, (5, 1) = 1.000000000, (6, 1) = 1.000000000, (7, 1) = 1.000000000, (8, 1) = .3678794412}))

Matrix B given in file Q2 have entires which are the linear combination of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2]. I want to evaluate matrix B at the values of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2] which are obtained in vector b.

Q2.mw

@tomleslie Thanks for your answer. The above reply of my post is not appropriate. In my previous question using some polynomials you generated a square matrix using collocation points but here I need to collocate a vector to generate a square matrix. Let me try to explain what I want to do. Consider the following code for any values of M1, M2 and M3

restart; with(LinearAlgebra); M1 := 3; M2 := 3; M3 := 3;
rho[1] := 1; rho[2] := 1; rho[3] := 1; alpha[1] := 0; alpha[2] := 0; alpha[3] := 0;
X := Vector(M1, proc (n) options operator, arrow; x^(n-1) end proc);
Y := Vector(M2, proc (n) options operator, arrow; y^(n-1) end proc);
Z := Vector(M3, proc (n) options operator, arrow; t^(n-1) end proc);
KroneckerProduct(X, Y); XYZ := KroneckerProduct(%, Z);
IntX := Vector(M1, proc (n) options operator, arrow; x^(n-alpha[1]*rho[1])*Beta(1-alpha[1], n/rho[1])/rho[1] end proc);
IntY := Vector(M2, proc (n) options operator, arrow; y^(n-alpha[2]*rho[2])*Beta(1-alpha[2], n/rho[2])/rho[2] end proc);
IntZ := Vector(M3, proc (n) options operator, arrow; t^(n-alpha[3]*rho[3])*Beta(1-alpha[3], n/rho[3])/rho[3] end proc); KroneckerProduct(X, Y);
IntXYZ1 := convert(KroneckerProduct(%, IntZ), Vector);KroneckerProduct(IntX, IntY);
IntXYZ2 := convert(KroneckerProduct(%, Z), Vector);

Here,  I want to collocate Vector IntXYZ1 and IntXYZ2 as highlighted by red color and generate squares matrices corresponds to IntXYZ1 and IntXYZ2, in such a way that the first M1M2 + 2(M3-1)M2 + 2(M3-1)(M1-2) rows of desired squares matrices are zero and other rows are obtained by collocating the vectors IntXYZ1/IntXYZ2 at x=(i-1)/(M1-1), y=(j-1)/(M2-1), t=(k-1)/(M3-1) for i = 2,3,…,M1-1, j = 2,3,…,M2-1, k = 2,3,…,M3 as given as XX in above for M1=M2=M3=3. 

In your response your wrote a general expression (t^p)*((1/2)^q)*((1/2)^r)/p to generate the other nonzero rows rather than collocating the vectors IntXYZ1/IntXYZ2. Hope you understand what I want to do. I am waiting for your response. Thanks

1 2 3 4 5 6 7 Last Page 3 of 11