MaplePrimes Questions

 my question is
I am working on for loop and there are multi-line inside it and I only need to show a specific result, not all that occurs inside the loop . is there any commend to do that in maple?

with(Statistics):

LetList := [C, E, F, H, K, P, T, W, X, Y]; LetList[Sample()];
           LetList := [C, E, F, H, K, P, T, W, X, Y]
Error, invalid input: no implementation of Sample matches the arguments in call, 'Sample:-ModuleApply()'

Can any one help me with random sampling from LetList ?

 

Melvin


 

what is the code of the following equation:

 where h, and g are matrices with positive determenets. 

How can we create the following upper triangular matrix?

where k and M are any integers,
 F and L are MxM Matrices  as follows

 

restart;
with(LinearAlgebra):
k:=2:
M:=3:
F:=Matrix(M,M):
for i from 1 to M do 
  for j from 1 to M do
 F[1,1] := 2;
    F[i,j]:=0
  end do
end do:
F;
L:=Matrix(M,M): 
L:=LinearAlgebra[BandMatrix]([
      [seq(-sqrt(2*i-1)/(2*i-1)*sqrt(2*i-3),i=2..M)], [1,seq(0*i,i=1..M-1)],[seq((sqrt(2*i-3))/((2*i-3)*sqrt(2*i-1)),i=2..M)]]);

 

Dear Users!

Hope you would be fine with everything. I want to evaluate the following expression for k = 3, j = 0, r = 1.

I am waiting for your positive reply. Thanks in advance

Hello,

every time I input a formula I get:

Typesetting:-mparsed(x^2 +5 -2,x^2+3; "_noterminate")

I can't get rid of this error: this is very basic, what happened?

TIA, Roberto

 

I think   looks much nicer than

it is indeed the answer to .  Both above are equal but there are less terms on the left.  It's just what Maple does - it doesn't like radicals in the denominator.  For just a little overhead I would prefer a collection of any sqrt value into the denominator than to have to split it up.  Maybe just my preference.  Perhaps an option could be available within the Maple system to allow numeric radicals in the denominator? 

Hello,

I'm wondering which connection formulas maple has access to?

For instance consider the following exmple

restart;

hypergeom([a, b], [c], 1);

`assuming`([convert(%, GAMMA)], [c-a-b > 0])

 

it should be simplified to GAMMA functions, but I do not get maple to do it. Are there packages for this?

 

Same for higher functions pFq for example

hypergeom([1, 1, 2*q-2+L], [2, L+1], 1)

under appropriate assumptions.

Hello,
I want to collect a function into terms without using ?expand() since this expands everything which I dont want.


f:=GAMMA(L+2*q-3-k)/(GAMMA(L-k)*k)*((GAMMA(-2*q+L)*GAMMA(L+2*q-3-k)-GAMMA(L+2*q-3)*GAMMA(L-2*q-1-k)*(L+2*k-1-(4*k+2)*q))/((2*(-1+2*q))*(4*q-3)*GAMMA(L+2*q-3)*GAMMA(L+2*q-3-k)));
collect(f,[k,GAMMA])

then has 1 term which still contains a denominator, but I want them seperate so I can use ?op() for all additive terms.

Is there an option without expanding the entire thing to enforce termwise selection?

Of course I could do it in a second step, but I want to avoid it and think it should be simpler.


Thanks everyone for helping me over the years. I've just handed in my PhD- and I really considered Maple Primes like a supervisor.

Currently I am relearning Financial maths - as depending on grants I may leave academia :(

Today I am learning utility functions and risk aversion and thought to make a graphso i could visualise them

 Here is a graph of the log of the utility of x - with two utility functions - constant absolute risk aversion (lower surface) - and constant relative risk aversion (disjoint surface above); for both functions  g (and in the attached worksheet R) is a parameter of these functions; annoyingly for these versions of these functions to be plotted on the same axis - they are so different in scale that it is hard to see anything interesting.

However one of the key features of utility functions is that we consider them to be unaffected by scalling- i.e. that if U_2(x)=c*U_1(x) for all x then U_2(x) and U_1(x) are considered to be the same function.

This means that scalling can be done in a much more useful way than what I have done. Instead of plotting f(x;R)=x^(1-R)/(1-R) on the interval I (x=1..100), i'd like to plot g(x;R)=f(x;R)/max(f(x;R),I)  on the interval I.

I worked out that on a 2d graph this can be done using maximise. But I'd like to plot g(x;R) in 3d as both x and R vary and i cant think of how to do that! 

Cara_functions.mw

This is my program, I need to solve that differential equation but when i click on the pdsolve I don't get any result, do you know why?

thank you

I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.

This is my function so far:

EEA:=proc(ED,a,b)
    description
    "Extended Euclidean Algorithm"
    "INPUT: an Euclidean Domain ED and two elements from said domain"
    "OUTPUT: r,s,t such that r = gcd(a,b) = s*a + t*b ";
    local r_0, r_1, r_aux, s_0, s_1, s_aux, t_0, t_1, t_aux, q;
    # Domain checks
    # TODO: check that ED is an euclidean domain
    if not ED[Type](a) then error "1st argument must be of type ED" end if;
    if not ED[Type](b) then error "2nd argument must be of type ED" end if;
    
    # Initialization
    r_0 := a; r_1 := b; # gcd series
    s_0 := 1; s_1 := 0; # 1st cofactor series
    t_0 := 0; t_1 := 1; # 2nd cofactor series

    # Loop
    while r_1 <> 0 do;
        print("All is fine before the Quo");
        print(r_0); print(r_1);
        q := ED[Quo](r_0, r_1);
        print("All is fine after the Quo");
        
        r_aux := r_0 - q * r_1;
        r_0 := r_1; r_1 := r_aux;
        
        s_aux := s_0 - q * s_1;
        s_0 := s_1; s_1 := s_aux;

        t_aux := t_0 - q * t_1;
        t_0 := t_1; t_1 := t_aux;
    od;

    # Result
    return r_0, s_0, t_0;
    end proc:

Where ED is a Domain object passed as a parameter to the function.

When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.

Concretely, upon making the call:

with(Domains): GI := Gaussian(Z); a := GI[Input](-87+47*I): b := GI[Input](-90+43*I): r, s, t := EEA(GI, a, b); evalb(a*s+b*t = r)

I get the following output:

              

        "All is fine before the Quo"
                              -87 + 47 _i
                              -90 + 43 _i
                      "All is fine after the Quo"
                      "All is fine before the Quo"
                              -90 + 43 _i
                                3 + 4 _i
    Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)

From this we should infer that calling `Gaussian(Z)[Quo]` on arguments `-90 + 43 _i` and `3 + 4 _i` should produce this error, right?

Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:

    with(Domains): GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);

Produces the output:

                            a := -90 + 43 _i
                b := 3 + 4 _i
               -4 + 20 _i

What is going on? Why does it crash inside the function but not in the workbook?

I have a PDE.

I am trying to code for solving the pde by numerically and analytically.

But the code has an error.

Could you help me?

Best regards.
THE CODE: pde.mw

Hi all, how to replace

I use but not work!

I am generating a lot of random graphs in Maple, and I need to generate the LaTeX code for these graphs. It has been working very well, until now, when I got to weighted graphs. The LaTeX code does not create the weights. I know I can modify the code to add the weights, but my question is two-fold: why aren't the weights automatically generated? is it possible to have the weight automatically generated, how? Nothing in the documentation appears to address these issues.

 

An example of what I attempting to do is in the attached worksheet.

Thanks!

graph.mw

First 753 754 755 756 757 758 759 Last Page 755 of 2428