Robert Israel

6577 Reputation

21 Badges

18 years, 218 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

If the Matrix is small, this might work.  It might not be useful for a large problem.  Maple does not have facilities for semidefinite programming per se, so these constraints will be handled using its general nonlinear programming facilities.



with(LinearAlgebra):
n:= 4; M:= Matrix(n,n);
for i from 1 to n do
   for j from 1 to i do
     assume(a[i,j],real);
     assume(b[i,j],real);
  end do 
end do:
for i from 1 to n do
  M[i,i]:= a[i,i];
   for j from 1 to i-1 do
     M[i,j]:= a[i,j]+I*b[i,j];
     M[j,i]:= a[i,j]-I*b[i,j];
   end do 
 end do:
cons:= {op(convert(IsDefinite(M, query=positive_semidefinite),
     boolean_function))};

 

More likely the desire to protect advertising revenue.  If you see an image hot-linked from a site,  you don't see the advertisements that you would if you viewed it from that site's web page.  See
e.g. en.wikipedia.org/wiki/Inline_linking

The value of N[1] is an expression containing the global variables u and v.

In the function definition

M1:= (u,v) -> N[1]

the u and v are formal parameters.  These have nothing to do with the global variables of the same name. 

When you call M1(s,t), every occurrence of u and v in the body of the function definition is replaced by s and t respectively.  But the body of the function definition does not actually contain u or v, it is only N[1].  This will have u and v when evaluated, but that evaluation hasn't taken place yet.  So there is nothing to replace, and s and t don't appear in the final result.

This is actually one of the main reasons for using unapply: 

M1 := unapply(N[1], (u,v));

will produce a function definition in which the current value of N[1], not just the name N[1], appears, and the u and v there will be the formal parameters u and v. 

If you really mean a Matrix, the command to find the determinant (please note spelling) is Determinant in the LinearAlgebra package.  If you're using the older matrix structure, it's det in the linalg package.

If you really mean a Matrix, the command to find the determinant (please note spelling) is Determinant in the LinearAlgebra package.  If you're using the older matrix structure, it's det in the linalg package.

Actually it's not being applied to a vector here, or even a Vector.  It's being applied to an expression of the form A + t*B where A and B are lists of the same length and t is a non-numeric scalar expression .  What it does is distribute the t over the list B, so that the result will be added to A to produce a list. 

This should work in Maple 8:

with(plots):
 radiusVector := (phi) -> ([cos(phi),sin(phi),0]):
 ribbonVector := (phi) -> ([-sin(phi)*cos(phi),-sin(phi)*sin(phi),cos(phi)]):
 p := (twist,theTitle,theOrientation) -> plot3d(
 expand(radiusVector(phi) + t*ribbonVector(twist*phi)),phi=0..2*Pi,t=-0.3..0.3,
 title=theTitle,orientation=theOrientation,grid=[100,10],scaling=constrained):
 display(p(1/2,"Ribbon with 1/2 twist: The Mobius strip",[200,70]));

Do you have a Mayan font?  I don't know if Mayan glyphs are included in Unicode.
There are only a few of them in the palettes, e.g. .
 

You could of course write procedures to produce the Mayan symbols in a plot.

Do you have a Mayan font?  I don't know if Mayan glyphs are included in Unicode.
There are only a few of them in the palettes, e.g. .
 

You could of course write procedures to produce the Mayan symbols in a plot.

You might note that your piecewise expression can be written as f(t, min(t, td)) where

f(t,s) = -.7e-2*t+.3e-1*exp(1.4*s-1.4*t)-.35e-1*exp(1.2*s-1.4*t)-.42e-1*s+4.215-.21*exp(-.2*s)

The solution to f(t,s) = 0 is

t=-30.*exp(-.2000000000*s)+602.1428571+.7142857143*LambertW((-7.*exp(-.2000000000*s)+6.)*exp(9.800000000*s-843.+42.*exp(-.2000000000*s)))-6.*s

Call the right side tsol(s).

t=tsol(s) is the only real solution if s >.7707533992; for -15.80957686 < s < .7707533992 there is also a solution using the -1 branch of LambertW, and for s < -15.80957686 there is no real solution.  I'll assume you're interested in the case s > .7707533992.

 The solution to f(s,s) = 0 in this interval is s = 86.63265291.  For .7707533992 < td < 86.63265291 we have tsol(td) > td, so t = tsol(td) is the solution of your equation.  For td > 86.63265291, tsol(td) < td, so the solution you want is t = 86.63265291.

 

 

You might note that your piecewise expression can be written as f(t, min(t, td)) where

f(t,s) = -.7e-2*t+.3e-1*exp(1.4*s-1.4*t)-.35e-1*exp(1.2*s-1.4*t)-.42e-1*s+4.215-.21*exp(-.2*s)

The solution to f(t,s) = 0 is

t=-30.*exp(-.2000000000*s)+602.1428571+.7142857143*LambertW((-7.*exp(-.2000000000*s)+6.)*exp(9.800000000*s-843.+42.*exp(-.2000000000*s)))-6.*s

Call the right side tsol(s).

t=tsol(s) is the only real solution if s >.7707533992; for -15.80957686 < s < .7707533992 there is also a solution using the -1 branch of LambertW, and for s < -15.80957686 there is no real solution.  I'll assume you're interested in the case s > .7707533992.

 The solution to f(s,s) = 0 in this interval is s = 86.63265291.  For .7707533992 < td < 86.63265291 we have tsol(td) > td, so t = tsol(td) is the solution of your equation.  For td > 86.63265291, tsol(td) < td, so the solution you want is t = 86.63265291.

 

 

That's not what Jacques meant by exact rationals.  Any number with a decimal point in it is a float, not an exact rational.  -7/1000 would be an exact rational, -.007 is not.

Secondly, you gave solve one equation to solve for two variables.  That will almost never work.  You need to give it one variable to solve for.

 

That's not what Jacques meant by exact rationals.  Any number with a decimal point in it is a float, not an exact rational.  -7/1000 would be an exact rational, -.007 is not.

Secondly, you gave solve one equation to solve for two variables.  That will almost never work.  You need to give it one variable to solve for.

 

Well, the code of `type/mathfunc` is quite simple:

`type/mathfunc` := proc(f)
     type(f,'symbol') and member(f,{'Dirac', 'ilog', 'Product', 'Limit', 'limit', 'int'}) 
     or type(f,'name') and type(`evalf/` || f,'procedure') 
     or type(f,'procedure') and member('operator',[op(3,eval(f))])
end proc
 

So, for example, ilog is a mathfunc because it's explicitly listed, ilog10 is one because there's a procedure `evalf/ilog10`, and any function that you might define using -> qualifies by the third clause. 

I have no idea why there should be a procedure `evalf/ilog10` but no `evalf/ilog2`.

Well, the code of `type/mathfunc` is quite simple:

`type/mathfunc` := proc(f)
     type(f,'symbol') and member(f,{'Dirac', 'ilog', 'Product', 'Limit', 'limit', 'int'}) 
     or type(f,'name') and type(`evalf/` || f,'procedure') 
     or type(f,'procedure') and member('operator',[op(3,eval(f))])
end proc
 

So, for example, ilog is a mathfunc because it's explicitly listed, ilog10 is one because there's a procedure `evalf/ilog10`, and any function that you might define using -> qualifies by the third clause. 

I have no idea why there should be a procedure `evalf/ilog10` but no `evalf/ilog2`.

First 145 146 147 148 149 150 151 Last Page 147 of 187