MaplePrimes Questions

The command Typesetting:-Settings(prime=x,typesetprime=true):  makes diff(y(x),x) gives the latex as y'(x) which is what I wanted.

But I'd like to also be able to turn this off.  The reason is that in my program, I could have different variables in different places, and need to be able to turn this off/on as the program runs.

I know I can change the setting, by calling the above command again, with different variable. But I was looking for a way to turn it off as well. 

Similar to Typesetting:-Suppress  

Is there a way to do that? Actually the best solution would be, is to have the effect of Typesetting:-Settings(prime=x,typesetprime=true): be local to the proc. So if this command is used inside a proc, when leaving the proc, its effect will be automatically removed, as if this command was never issued.

Only when it is issued in global context, it will remain in effect until one does a restart.   Right now, the effect of Typesetting:-Settings(prime=x,typesetprime=true): is global. Even when called from inside a proc.  But this might be hard to implement. Therefore, being just able to turn it off is good for now.

Here is an example

restart;
foo:=proc(expr,x,y)
   Typesetting:-Settings(prime=x,typesetprime=true):
   print(Physics:-Latex(expr));

   #How to turn off the effect of above Typesetting command now?
   #so the following command works as the default setting?

   print(Physics:-Latex(expr));
end proc;


expr:=diff(y(x),x)=3:
foo(expr,x,y);

 

Hi

I am trying to implement a recursive algorithm for matrix inverses, its a seventh-order method

for n to 7 do
    new := (1/16*old) . (120*I + ((A . old) . (735*I + ((A . old) . (-861.*I + ((A . old) . (651*I + ((A . old) . (93*I + (A . (old(-15*I + (A . old)))))))))))));
    old := new;
    print(n);
end do

However I get a error informing me that this is a recursive statment. Which it is, but maple thinks this is a bad thing.

So it is clear that I am doing somthing wrong, Can anyone help me by explaining what I am doing wrong?

Mvh

Eric Ragnarsson

 

Hi,

I have questions about linestyle in maple, how to change solid and Dash whatever  to line with cross or line with plus 

Please see a plot attached.

Look forward to hearing from you as soon as possible.

Regards,

Mathastr

plots.pdf

I am new to Maple. I attempted to write a procedure that takes another procedure as input. It is not working correctly. As you can see from the output of a call to procedure A that something went wrong.
How do I do this correctly?
 

H := proc (n::integer)::real; local s, i; s := 0; for i by 2 to n do if i <= n-1 then s := s+1./((i*(i+1))) else s := s+1./i end if end do; return s end proc

A := proc (n::integer, T::procedure)::real; local d1, d2, s; d1 = T(n+1)-T(n); d2 = T(n+2)-T(n); s := T(n+1)-d1*d2/(d2-d1); return s end proc

proc (n::integer, T::procedure)::real; local d1, d2, s; d1 = T(n+1)-T(n); d2 = T(n+2)-T(n); s := T(n+1)-d1*d2/(d2-d1); return s end proc

(1)

H(11)

.7365440115

(2)

A(10, H)

.7365440115-d1*d2/(d2-d1)

(3)

``


 

Download st.mw

Maple Apps-Venn Diagrams does not work.  In box on the right there is an error message.

How do I calculate the first 5 values of the bisection method using the starting values of 4 and 5 of the function f(x) = (5 - x) * (e^x)-5

 

a := 4;
b := 5;
nStep := 5;
                               4
                               5
                               5
 

To obtain the columns of matrix as a list, this is what I currently do

A:=Matrix([[1,2,1,3,2],[3,4,9,0,7],[2,3,5,1,8],[2,2,8,-3,5]]);

Now

[seq(A[..,i],i=1..4)];

Also this does it

map(i->A[..,i],[$1..4]);

Is there a "shorter" way to do it?  For example, A[..,[$1..4]] does not do it ofcourse, it just gives the matrix itself back.

 

 

To solve this, I got this far but am not sure where to go next?

 

f2 := x^2 - 3;
f2d := diff(f2, x);
                              2    
                             x  - 3
                              2 x

set value for x0, number precision

x0 := 3;
eps := 0.1*10^(-5);
                               3
                            0.000001
 

I do not understand what ColumnSpace is doing in Maple, as I can't get it to match my hand solution and the book. It must be using different definition which is not the book standard.

In the textbook, it says to find column space of matrix A, is to find the Echelon form, then lookup the pivot columns. Then pick the corresponding columns from the original A. These are the column space.

I'll show the book example, and Maple code to try to get same answer.

Here is an example from the book

Notice the columns space are the first, second and fourth columns of A. Since these correspond to the pivot columns of the Echelon form.

In Maple, the Echelon is found using LinearAlgebra:-GaussianElimination(A,'method'='FractionFree'); which gives the same pivot columns as the book. So far so good (the numbers are not the same, but this is normal, as Echelon form is not unique. Only reduced Echelon form is unique), but as long as the pviot columns are correct, that is the important part. 

But when I do LinearAlgebra:-ColumnSpace(A); I get completely different result. The only thing I could see in help, is that it says The Vectors are returned in canonical form with leading entries 1.

I do not underand what that means or how to convert Maple answer to make it match the expeted result since the result is completely different and I do not see the mapping needed.

restart;
A:=Matrix([[1,2,1,3,2],[3,4,9,0,7],[2,3,5,1,8],[2,2,8,-3,5]]);
LinearAlgebra:-GaussianElimination(A,'method'='FractionFree');
LinearAlgebra:-ColumnSpace(A);


I also tried this on Wolfram Alpha, and got same answer as the book

 

 

Maple 2020.1

reference: Differential Equations and linear algebra, 4th ed., Edwards, Penney and Calvis. Pearson. 2017. page 247.

Hi,

I do not understand why this simple procedure evaluates so differently depending on the type of its second parameter?

A typo somewhere or a bug?


 

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

KL := (a, b) -> (1/4)*(2*ln(a+b)*a^2+4*ln(a+b)*b*a+2*ln(a+b)*b^2-2*ln(b)*b^2-a^2-2*a*b)/a

proc (a, b) options operator, arrow; (1/4)*(2*ln(a+b)*a^2+4*ln(a+b)*b*a+2*ln(a+b)*b^2-2*ln(b)*b^2-a^2-2*a*b)/a end proc

(2)

evalf(KL(1e-10, 1/2))

-.2

(3)

evalf(KL(1e-10, 0.5))

-0.2500000000e-10

(4)

evalf(KL(1e-10, convert(0.5, rational)))

-.2

(5)

limit(KL(a, 1/2), a=0, left);
limit(KL(a, 1/2), a=0, right)

-(1/2)*ln(2)

 

-(1/2)*ln(2)

(6)

limit(KL(a, 0.5), a=0, left);
limit(KL(a, 0.5), a=0, right)

Float(-infinity)

 

Float(infinity)

(7)

 


 

Download I_am_lost.mw

(2x+a^2-3a)=a(x-1) with all the real values of a

I have a system of six ODEs. i solve them numerically using dolve,numeric command. the problem is setting step size for example stepsize=1e-5 or minstep=500 lead to a result of order 1e-2; But without using this option, results are of order integer numbers. could any one help? tnx in advance

EDITED
 

Download ode_problem.mw

Hello,

I'm trying to fit experimental data to a model in which a variable is the result of an equation.

In a procedure I solved the equation and found lambda22 for each of the data lambda11 I have. It depends on a a parameter I need to identify to fit the data to the model.

But then when I use DataFit from DirectSearch package, I get this error :

Is it impossible to specify more than one independant variable ? Or is it a problem coming from the procedure ?

Thanks in advance,

Manon

data.xlsx

restart;

data:=ExcelTools:-Import("D:/data.xlsx") : # importer les donnees
with(LinearAlgebra): 
lambdaX:=Column(data,1): 
PK1X:=Column(data,2):


tensF:=Matrix([[lambda11,0,0],[0,lambda22,0],[0,0,lambda22]]):
tensFbar:=Matrix([[(lambda11/lambda22)^(2/3),0,0],[0,1/sqrt((lambda11/lambda22)^(2/3)),0],[0,0,1/sqrt((lambda11/lambda22)^(2/3))]]):
tensBbar:=Multiply(tensFbar,Transpose(tensFbar)):

kappa:=100:
tensPK:=Multiply(Transpose(MatrixInverse(tensF)),(2/Determinant(tensF))*a*(tensBbar-(1/3)*Trace(tensBbar)*Matrix(3,shape=identity))+kappa*(Determinant(tensF)-1)*Matrix(3,shape=identity)):
PK1:=tensPK[1,1]:
eq:=0=tensPK[2,2]:


lambda22sol:=proc(aValue) 
   global __old_a;
   local res, i, eq1, sol1, lambda22Est;
   if not [aValue]::list(numeric) then
      return 'procname'(args);
   end if;
   lambda22Est:=Vector(1..RowDimension(lambdaX)):
   eq1:=Array(1..RowDimension(lambdaX)):
   if __old_a<>aValue then
      __old_a:= aValue;
     for i from 1 to RowDimension(lambdaX) do
     	eq1[i]:=eval(eq,[a=aValue,lambda11=lambdaX[i]]):
		sol1:=solve(eq1[i], lambda22);
		lambda22Est[i]:=sol1[1]:
	end do:
	res:=lambda22Est;
   end if;
end proc:

matrix1:=<lambdaX|lambda22sol(0.9)|PK1X>;
DS1:=CodeTools:-Usage(
        DirectSearch:-DataFit(PK1,matrix1,[lambda11,lambda22]));
res2:=eval(PK1,DS1[2]):

 

Hi,

Using Maple 2020 I can't seem to get a trigonometric equation (fairly simple at that) to solve properly.

solve_err.mw

Here's a capture :

 

Expected answer is 1/(25*sqrt(3))

Adding +2*Pi on the RHS to match the sign doesn't work either.

Hi everybody, I have a set from fsolve command. As shown in below image

When I want to obtain only numbers, I write cozum[1] but maple gives me c-4=1.591497964.. As you understand I want only numbers. How can I do this? 

First 370 371 372 373 374 375 376 Last Page 372 of 2308