MaplePrimes Questions

Hi Please I need help with making the output of my fslolve appear in a way that I can easily copy to an excel.

I am doing analysis for 3 countries and each time I produce a result I copy manually to excel and use 'text to column' and the 'transpose' excel options to arrange the results in order. I do this for almost 20 time because I want to see how hows in parameter affect the variables. is there a way I can convert this to a 32 by 3 matrix so that I can copy all at the same time instead of copying each variable at a time. here is my solve command

UK_SOL_FIRST:= fsolve(eval({eq||(1..32)}, Params_UK_FIRST), InitValue_UK_FIRST);
ES_SOL_FIRST:= fsolve(eval({eq||(1..32)}, Params_ES_FIRST), InitValue_ES_FIRST);
DK_SOL_FIRST:= fsolve(eval({eq||(1..32)}, Params_DK_FIRST), InitValue_DK_FIRST);

The Results

UK_SOL_FIRST:={A_ss = 14.36104896, C_ss = 1.445842138, I_ss = 0.3136706500,

K_ss = 12.54682600, K_v_ss = 125.4682600,

LT_ss = 0.01061009037, L_ss = 4.014721807, N_ss = 0.9307582996,

P_a_ss = 0.9336893751, P_ss = 0.8625403648,

Surp = 0.9890479879, U_b_ss = 0.1781599919,

U_ss = 0.1046105158, V_ss = 0.05052687912, W_max = 1.476989982,

W_min = 0.4879419937, W_ss = 1.826907218,

W_tilde = 3.478049987, Y_ss = 2.428417935, aa_ss = 21.67403493,

chhi = 0.4523413798, f_c_ss = 0.04880034560,

m_ss = 0.03536881539, p_d_ss = 0.9907986980,

x_T = 0.7023268636, y_d_ss = 10.57030302, y_f_ss = 1.174478111,

y_x_ss = 10.57030300, z_ss = 21.14060602,

Profit_ss = 4.094720376, phi_prod = 0.9753885739,

theta_ss = 0.4830000000}

ES_SOL_FIRST:={A_ss = 10.91702785, C_ss = 2.038687975, I_ss = 0.3058575000,

K_ss = 12.23430000, LT_ss = 0.1309315222, L_ss = 2.857497927,

N_ss = 0.8398656215, P_a_ss = 0.9680877046,

P_ss = 0.8638978804, Surp = 2.541617932, U_b_ss = 0.9095925505,

U_ss = 0.1819708847, V_ss = 0.03119500880, W_max = 3.252738093,

W_min = 0.7111201606, W_ss = 3.605202340,

W_tilde = 3.665280790, Y_ss = 2.367929032, aa_ss = 15.67939783,

betta = 0.9909865708, chhi = 0.2898275349,

f_c_ss = 0.6743530978, m_ss = 0.02183650616,

p_d_ss = 0.9939322922, x_T = 0.005556307841,

y_d_ss = 7.853422751, y_f_ss = 1.195945300,

y_x_ss = 7.978400682, z_ss = 15.83182343,

Profit_ss = 3.084421270, phi_prod = 1.009721394,

theta_ss = 0.1714285714}


DK_SOL_FIRST:={A_ss = 16.18893837, C_ss = 1.359886068, I_ss = 0.2487000000,

K_ss = 9.948000000, LT_ss = 0.02282780783, L_ss = 5.834365727,

N_ss = 0.9399351536, P_a_ss = 0.7054445707,

P_ss = 0.8796237740, Surp = 0.6511024854,

U_b_ss = 0.4572819488, U_ss = 0.08450316042,

V_ss = 0.03491187713, W_max = 1.293898615,

W_min = 0.6427961298, W_ss = 2.363825013,

W_tilde = 2.758200925, Y_ss = 1.755529412, aa_ss = 34.56310241,

betta = 0.9851712031, chhi = 0.4499333284,

f_c_ss = 0.1898151486, m_ss = 0.02443831399,

p_d_ss = 1.032636460, x_T = 0.1506134910, y_d_ss = 11.17773688,

y_f_ss = 0.9144278497, y_x_ss = 13.74561008,

z_ss = 24.92334696, Profit_ss = 4.926248216,

phi_prod = 0.7210969276, theta_ss = 0.4131428571}

Polynomial.mw

Hi all,

I want to rewrite the equation which is attached for you in order to have it in term of Nu. I want to write it such as below:

()*Nu^7+ ()*Nu^6+... +()*Nu+1=0

In the above equation the parameters in the parenthesis are function of k1&k2

Let say, I have two plots

P1:= plot(........):
P2:= plot(........):

We can display in one plot as

plots[display](P1,P2);

 

My question is, is there any way to combine these two plots into one and then display.

For example:  

P:= combine(P1, P2);

plots[display](P);

 

The reason for asking this question:

I am plotting multiple curves in a loop depending on some conditions but I can't display them in one plot. They are all appearing on different plots.

 

 

Hi, I'm new to Maple and I have to produce a recursive procedure with the nomenclature Puis:=proc(X,n::integer) which calculates X^n with:

for n<0   ->   1/(X^(-n))

for n=0  ->   1

for n being an even integer   ->   X^(n/2) * X^(n/2)

for n being an odd integer   ->   X*X^(n-1)

The procedure I produced is:

Puis:=proc(X,n::integer)
option remember;
if n<0 then Puis(X,-n);
elif n=0 then 1;
elif rem(n,2,x)=0 then Puis(X,n);
else X*Puis(X,n-1);
end if;
end proc;

 

i don't have any eror up to this point, but when I try to evaluate, only Puis(4,0) works

Puis(4,-1);
Error, (in content) too many levels of recursion
Puis(4,0);
                               1
Puis(4,3);
Error, (in content) too many levels of recursion
Puis(4,4);
Error, (in content) too many levels of recursion

 

I was wondering what was wrong with my procedure, I changed the 1/(X^(-n)) with X^n and X^(n/2)*X^(n/2) for X^n because it is equivalent. I think I should put some sort of initial value to limit the recursion, but with that kind of function i really don't know how. I also tried with the X^(n/2)*X^(n/2) for the even numbers, but it says Puis expects its 2nd argument, n, to be of type integer, but received 1/2.

 

Hello everyone!

This is a procedure which I have writern. I know I write false, X=x because in maple, x is a table.although I did write x::Vector. Can you help me? Sorry, my English is not very good! :( 

JACOBI.mw

 

I''m looking to complete the following, and then use the 2nd to find what n for which Fn is divisible by f(3),  not sure where to start..any help much appreciated..

 

proc(f::procedure,s::posint,r::posint,c::posint)
description
"Indicate divisibility of f(n) by s for n <= cr.",
"Write 'D' for divisible, else 'n'; r rows and c cols.";
local i, j, str, char;

for i from 0 to r-1 do
str := "";
for j from 1 to c do
if (f(c*i+j) mod s) = 0 then
str := cat(str,"D")
else
str := cat(str,"n")
end if
end do;
print(str)
end do
end proc; # s_div_f

and

proc(s::posint,r::posint,c::posint)
description
"Indicate divisibility of Fib(n) by m for n <= cr.",
"Write 'D' for divisible, else 'n'; r rows and c cols.";
---MORE STUFF HERE---
end proc; # s_div_fib

 

I am using the solve command and the independent variables are in the form x=x. How can I output the solution as a list [set of solutions,independent variables]? The command select(z->symbol=symbol,S), where S is my set of solutions, does not work.

Hello everybody,

 

I would like to know if there's a possibility to change the style of the errorbars in errorplot. I would espacially like to add short lines at both ends of each errorbar, orthogonal to those, similiar to the looks of errorbars in GNUplot.

 

I appreciate your help. Many thanks in advance!

Piecewise function in Maple are continuous function. Now, how I able to write the commands for following discontinuous piecewise function?

 

and when find out f(0) the result is undefined?

InputMatrix3aa := Matrix(3, 3, {(1, 1) = xx, (1, 2) = 283.6, (1, 3) = 285.4, (2, 1) = 283.6, (2, 2) = 285.4, (2, 3) = 0, (3, 1) = 285.4, (3, 2) = 0, (3, 3) = 0});
InputMatrix3 := Matrix(3, 3, {(1, 1) = 283.6, (1, 2) = 285.4, (1, 3) = 283.0, (2, 1) = 285.4, (2, 2) = 283.0, (2, 3) = 0, (3, 1) = 283.0, (3, 2) = 0, (3, 3) = 0});
InputMatrix3b := Matrix(3, 3, {(1, 1) = 285.4, (1, 2) = 283.0, (1, 3) = 287.6, (2, 1) = 283.0, (2, 2) = 287.6, (2, 3) = 0, (3, 1) = 287.6, (3, 2) = 0, (3, 3) = 0});
InputMatrix3c := Matrix(3, 3, {(1, 1) = 283.0, (1, 2) = 287.6, (1, 3) = 296.6, (2, 1) = 287.6, (2, 2) = 296.6, (2, 3) = 0, (3, 1) = 296.6, (3, 2) = 0, (3, 3) = 0});
InputMatrix3d := Matrix(3, 3, {(1, 1) = 287.6, (1, 2) = 296.6, (1, 3) = 286.2, (2, 1) = 296.6, (2, 2) = 286.2, (2, 3) = 0, (3, 1) = 286.2, (3, 2) = 0, (3, 3) = 0});

Old_Asso_eigenvector0 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3aa), InputMatrix3aa)):
Old_Asso_eigenvector1 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3), InputMatrix3)):
Old_Asso_eigenvector2 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3b), InputMatrix3b)):
Old_Asso_eigenvector3 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3c), InputMatrix3c)):
Old_Asso_eigenvector4 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3d), InputMatrix3d)):

#AA2 := MatrixMatrixMultiply(Old_Asso_eigenvector3[2], MatrixInverse(Old_Asso_eigenvector2[2]));
#AA3 := MatrixMatrixMultiply(Old_Asso_eigenvector4[2], MatrixInverse(Old_Asso_eigenvector3[2]));

AA2 := MatrixMatrixMultiply(Old_Asso_eigenvector2[2], MatrixInverse(Old_Asso_eigenvector1[2]));
AA3 := MatrixMatrixMultiply(Old_Asso_eigenvector3[2], MatrixInverse(Old_Asso_eigenvector2[2]));

sol11 := solve([Re(AA2[1][1]) = sin(m*2+phi), Re(AA3[1][1]) = sin(m*3+phi)], [m,phi]);
if nops(sol11) > 1 then
sol11 := sol11[1];
end if:
sin(rhs(sol11[1])+rhs(sol11[2]));

sol12 := solve([Re(AA2[1][2]) = sin(m*2+phi), Re(AA3[1][2]) = sin(m*3+phi)], [m,phi]);
if nops(sol12) > 1 then
sol12 := sol12[1];
end if:
sin(rhs(sol12[1])+rhs(sol12[2]));

sol13 := solve([Re(AA2[1][3]) = sin(m*2+phi), Re(AA3[1][3]) = sin(m*3+phi)], [m,phi]);
if nops(sol13) > 1 then
sol13 := sol13[1];
end if:
sin(rhs(sol13[1])+rhs(sol13[2]));

#*************************************
sol21 := solve([Re(AA2[2][1]) = sin(m*2+phi), Re(AA3[2][1]) = sin(m*3+phi)], [m,phi]);
if nops(sol21) > 1 then
sol21 := sol21[1];
end if:
sin(rhs(sol21[1])+rhs(sol21[2]));

sol22 := solve([Re(AA2[2][2]) = sin(m*2+phi), Re(AA3[2][2]) = sin(m*3+phi)], [m,phi]);
if nops(sol22) > 1 then
sol22 := sol22[1];
end if:
sin(rhs(sol22[1])+rhs(sol22[2]));

sol23 := solve([Re(AA2[2][3]) = sin(m*2+phi), Re(AA3[2][3]) = sin(m*3+phi)], [m,phi]);
if nops(sol23) > 1 then
sol23 := sol23[1];
end if:
sin(rhs(sol23[1])+rhs(sol23[2]));

#**************************************
sol31 := solve([Re(AA2[3][1]) = sin(m*2+phi), Re(AA3[3][1]) = sin(m*3+phi)], [m,phi]);
if nops(sol31) > 1 then
sol31 := sol31[1];
end if:
sin(rhs(sol31[1])+rhs(sol31[2]));

sol32 := solve([Re(AA2[3][2]) = sin(m*2+phi), Re(AA3[3][2]) = sin(m*3+phi)], [m,phi]);
if nops(sol32) > 1 then
sol32 := sol32[1];
end if:
sin(rhs(sol32[1])+rhs(sol32[2]));

sol33 := solve([Re(AA2[3][3]) = sin(m*2+phi), Re(AA3[3][3]) = sin(m*3+phi)], [m,phi]);
if nops(sol33) > 1 then
sol33 := sol33[1];
end if:
sin(rhs(sol33[1])+rhs(sol33[2]));

#****************************************************

AAA1 := Matrix([[sin(rhs(sol11[1])+rhs(sol11[2])),sin(rhs(sol12[1])+rhs(sol12[2])),sin(rhs(sol13[1])+rhs(sol13[2]))],[sin(rhs(sol21[1])+rhs(sol21[2])),sin(rhs(sol22[1])+rhs(sol22[2])),sin(rhs(sol23[1])+rhs(sol23[2]))],[sin(rhs(sol31[1])+rhs(sol31[2])),sin(rhs(sol32[1])+rhs(sol32[2])),sin(rhs(sol33[1])+rhs(sol33[2]))]]);

MA := MatrixMatrixMultiply(Transpose(InputMatrix3aa), InputMatrix3aa) - lambda*IdentityMatrix(3):
eignvalues1 := evalf(solve(Determinant(MA), lambda)):
MA1 := MatrixMatrixMultiply(Transpose(InputMatrix3aa), InputMatrix3aa) - eignvalues1[1]*IdentityMatrix(3):
MA2 := MatrixMatrixMultiply(Transpose(InputMatrix3aa), InputMatrix3aa) - eignvalues1[2]*IdentityMatrix(3):
MA3 := MatrixMatrixMultiply(Transpose(InputMatrix3aa), InputMatrix3aa) - eignvalues1[3]*IdentityMatrix(3):
eigenvector1 := LinearSolve(MA1,<x,y,z>):
eigenvector2 := LinearSolve(MA2,<x,y,z>):
eigenvector3 := LinearSolve(MA3,<x,y,z>):

MR := MatrixMatrixMultiply(AAA1, Matrix([[Re(eigenvector1[1]),Re(eigenvector2[1]),Re(eigenvector3[1])],[Re(eigenvector1[2]),Re(eigenvector2[2]),Re(eigenvector3[2])],[Re(eigenvector1[3]),Re(eigenvector2[3]),Re(eigenvector3[3])]]));
ML := Re(Old_Asso_eigenvector1[2]);

solve(ML[1][1] = MR[1][1], xx);
with(Optimization):
Minimize(ML[1][1] - MR[1][1], {0 <= xx}, assume = nonnegative);

Error, (in Optimization:-NLPSolve) abs is not differentiable at non-real arguments;

when one of element in matrix s variable below code is very slow

 

MA := MatrixMatrixMultiply(InputMatrix3aa - lambda*IdentityMatrix(3);
eignvalues1 := evalf(solve(Determinant(MA), lambda));
MA1 := MatrixMatrixMultiply(InputMatrix3aa - eignvalues1[1]*IdentityMatrix(3);
MA2 := MatrixMatrixMultiply(InputMatrix3aa - eignvalues1[2]*IdentityMatrix(3);
MA3 := MatrixMatrixMultiply(InputMatrix3aa - eignvalues1[3]*IdentityMatrix(3);
eignvector1 := LinearSolve(MA1,<x,y,z>);

eignvector2 := LinearSolve(MA2,<x,y,z>);

eignvector3 := LinearSolve(MA3,<x,y,z>);

Need to create a fibonacci defintiion using this form..Any help appreciated..thanks in advance

The Fibonacci numbers Fn are defined for all positive integers n as follows:

Fn = ( 1,                 n =1, 2 , )    

      (Fn−1 + Fn−2 , otherwise.)

 Complete the definition of fib so that fib(n) returns Fn for all positive integers n. You must compute Fn using the below definition! A recursive proc is most natural.

fib:=
proc(n::posint)
description "Calculate fib(n), the n'th Fibonacci number.";
option remember; # important for efficiency!
---MORE STUFF HERE---
end proc; # fib

I need to complete the definition of P km using a for loop so that km(n,m) returns n k=1 k m whenever n, m ∈ Z, n > 0, and m ≥ 0.( You must use a for loop in the variable k, with k ranging from 1 to n, to do this question in the manner requested.)

km is defined as 

km:=
proc(n::TYPE1,m::TYPE2)
description "km(n,m) returns the sum of k^m as k ranges from 1 to n.";
---MORE STUFF HERE---
end proc; # km

Not sure where tostart..Any help appreciated...thank you

Tried different ways to apply unapply but failed:

a := .1994;

modfit3 := a*x^1.5;
 
f := unapply(rhs(modfit3), x);
%;
Error, invalid input: rhs received .1994*x^1.5, which is not valid for its 1st argument, expr

What's wrong here?

S

 

Exercise: Find all the elements of order 2 in D30 .

I set the D30 group , but I do not know how to calculate and list elements of order 2 . I thought of calculating the order of all the elements ( With PermOrder () command , perhaps) , and then use the select command to select those with order of 2. But the big problem is to calculate the order of elements.

I know only calculate the order of the group. Could anyone help me ?

First 1195 1196 1197 1198 1199 1200 1201 Last Page 1197 of 2428