Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are answers submitted by Robert Israel

Access Error

 
You have attempted to access a page that requires you to be logged on.
 
Please logon before accessing that page.
 

The most important thing to learn is how to ask questions...

A work-around is to use the transformation method.

Suppose the PDF of your distribution is nonzero on the interval [a,b], F is the CDF,  and S is a sample from the Uniform(0,1) distribution.  Then a sample of the same size from your distribution is

> map(t -> fsolve(F(x)=t,x=a..b), S);

Of course in your case the equation F(x)=t can be solved exactly, but that's rather special.

 

Some context might help, or else more specific questions.  What Boltzman equation?  Derive it from what?  You don't seem to be talking about the Boltzmann equation of statistical mechanics, but I can't be sure.

You can also do this:

> f:= proc(x::integer, y::integer):: posint; x+y end proc;

  kernelopts(assertlevel = 2):

Then e.g.

> f(2,-3);

Error, (in f) assertion failed: f expects its return value to be of type posint, but computed -1

 

For example:

This is not a correlation matrix, but it might get you started..  The Matrix will be C.

>  P:= proc(t)
      global C;
      C := << 1 | t>, <t | 1>>;
   end proc;    

 

1) insert a "Mathematical Expression" component into the worksheet.  This is going to show your Matrix.
Right-click on it, choose Component, Component Properties...
Note the name: let's say MathContainer0.   You can adjust the width and height: 150 by 100 might be enough in this case.

Click OK.

2) insert a Slider into the worksheet.  Right-click, choose Component Properties..
Note the name, let's say Slider0..  Set Value at Lowest Position to -100, check "Update Continuously while Dragging".
Click Edit...

Above the line "end use;", enter

Do ( %MathContainer0 = P(0.01 * %Slider0));

Click OK, and again OK.  Now moving the Slider will change the Matrix you see in the MathContainer.  The current Matrix is available as the value of C.

 

 

Do you mean a maplet like this?

> with(Maplets[Elements]):
  G:= proc() 
      uses Maplets[Tools];
      Set('Res'=parse(Get('TFa')) &^(-1) mod parse(Get('TFp')))
    end proc;
  m := Maplet([["a: ", TextField['TFa'](30)],
               ["p: ", TextField['TFp'](30)],
               ["Result is ",TextField['Res'](30)],
               [Button("Go",Action(Evaluate('function'='G()'))),
                Button("Done",Shutdown(['Res']))]]):
  parse(op(Maplets[Display](m)));

You can find tables of the zeros at <http://www.dtc.umn.edu/~odlyzko/zeta_tables/>

After fixing a missing parenthesis, you have three equations, so you need to solve for three variables, not just one.

You could, for example, solve for POc, L1 and PTJ1.

> solve({eq1,eq2,eq3},{L1,POc,PTJ1});

{L1 = 1/3*(3*uF1*miu*L-3*uF1*miu*LTJ-h^2*PTJ2+h^2*PT)/uF1/miu, POc = (3*b^3*uF1*miu*L-3*b^3*uF1*miu*LTJ+b^3*h^2*PT+3*h^3*uF1*miu*LTJ)/h^2/b^3, PTJ1 = (3*uF1*h*miu*LTJ+b^3*PTJ2)/b^3}

Do you want to find the intersections, or do you want to plot them?

A great circle is determined by two points on the sphere (not equal or antipodal).

The simplest way to represent the great circle is using cartesian coordinates: it is the intersection with the sphere of the plane whose normal is the cross product of your two points.  The intersection of the two planes will be the line in the direction of the cross product of the two normals.  Thus the intersections of the great circle through a and b with the great circle through c and d are (in the notation of the VectorCalculus package)  R*n/sqrt(n.n) and -R*n/sqrt(n.n) where n = (a &x b) &x (c &x d) and R is the radius of the sphere.

Maple can't solve the equations symbolically for a and b.   This is not surprising, as I doubt that closed-form solutions exist.  However, fsolve should be able to find some numerical solutions if numerical values are given to s[1], s[2], s[3].

For example,

> eqs:= {(Psi(1,b)-Psi(1,a+b)) / (Psi(0,b)-Psi(0,a+b))^2 = s[2]/s[1]^2, 
          (Psi(2,b)-Psi(2,a+b)) / (Psi(0,b) - Psi(0,a+b))^3 = s[3]/s[1]^3};
> fsolve(eval(eqs, {s = [1,2,3]}));

    {a = 18.34161350, b = -5.672496873}

In general, the solutions seem to be highly nonunique (unless there's some other assumption you haven't told us).

It's easy enough to do.  Perhaps something like this?

> stemplot:= proc(L)
       uses plots;
       display([listplot(L, style=point, symbol=circle),
                plot([seq([[i,L[i]],[i,0]],i=1..nops(L))],colour=black)])
   end proc;

> stemplot([3,1,4,1,5,9,2,6,5]);

Your spacecurves are wrong.  You have, for example,

plots[spacecurve]([[sqrt(y^2*(tan(s)^2-1)+2*y*tan(s)+1), y, y*tan(s)], y = -6 .. 6], s = 0 .. t)

which makes no sense.  Perhaps you mean

seq(plots[spacecurve]([sqrt(y^2*(tan(s)^2-1)+2*y*tan(s)+1), y, y*tan(s)], s = 0 .. t), y =-6..6)

etc?

You also misspelled implicitplot3d. 

In addition, you might want to use the view option, as your curves will go off to infinity as s approaches Pi/2.

 

As far as I am aware, the PostScript language does not support transparency.  In PostScript, anything drawn obscures whatever drawn before in the same place.  So there is no way for Maple to provide this feature in PostScript.

Unfortunately the help pages aren't clear about which devices support which options.

 

For the second problem, try using the Extended typesetting level:

Tools, Options, Display, set "Typesetting level" to Extended, then "Apply to Session" to change it for just this session, or "Apply Globally" to change it permanently.  Then

> sigma[2] := (sqrt(T^2+1))/(4*K*(1+sqrt(T^2+1)));

The first one is a bit more difficult, because Maple automatically "simplifies" 4*(a+b)  to 4*a + 4*b.  You can try

> sigma[1] := expand(sqrt(T^2+1))/(4*``(K+sqrt(T^2+1)));

 

You might try quickplot3d in my Maple Advisor Database

<http://www.math.ubc.ca/~israel/advisor>

Instead of readdata, which produces a list of lists, you could use fscanf to produce a Matrix directly, which can be passed to quickplot3d.  Thus:

> A:= fscanf(myfile, "%{;h}fm");
   quickplot3d(A, style=point, colour=black, coords=spherical);

 

First 82 83 84 85 86 87 88 Last Page 84 of 138