Axel Vogt

5936 Reputation

20 Badges

20 years, 251 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

for example

-3*Sum(cos(m*Pi/(2*M+1))^2/(-1+cos(m*Pi/(2*M+1))^2),m = 1 .. M);
map(convert,%,cos); eval(%,M=7): value(%); combine(%,trig); simplify(%);

gives 91

smells like using Chebyshev polynomials or similar

something like that?
  theAssumptions:= 0 <= p;
  S:=[solve((p+1)^2-p^2, p)];
  map( '_t -> eval(theAssumptions, p = _t)', S);
  map( is, %);
So with 'select' you would find it.
Here is one way to demonstrate the handling only:

  b := Array(0..500, 0..500);

  f := proc( p )
  if type(p,even) then
    return (p!/(p/2)!)^2/2^p:
  else
  #  print(0)
  end if
  end proc;

  for p from 0 to 500 do
    b[p,0] := f(p)
  end do;
  p:='p': # clean up the loop variable

Note that your expression after using 'simplify' can be seen as
(p!/(p/2)!)^2/2^p and using 'convert(%,GAMMA)' would show you
that there is no need to care for even or odd.

Otherwise you can code it as

  b := Array(0..500, 0..500);

  for p from 0 to 500 by 2 do
    b[p,0] := (p!/(p/2)!)^2/2^p;
  end do;
  p:='p':

PS: just noted that Joe Riel was faster ...

And what is it good for? I mean: what does it calculate? A kind of discretization for a stock model or a contract on stocks?

Still not quite clear, but E and T may be fit the data of your
sheet S and T - in this case you do not need absolutes, since
your data are all positive for sure.

After simplifying by hand your model writes as s0 - a*t + r/2 *
Int(abs(T(v))/(1+k*abs(E(v)))+1/(1+k*E(v))*T(v),v = 0 .. t)
or even a bit more simple, if abs can be dropped. Do it.

You want to estimate s0, a and k for the data of each *column*,
but depending on t up to that column (=time), yes?

First clean data to fit rows: if there are too many N/A it
will make no sense. Dito for N/A at the beginning or the end
(except you are willing to accept seriuos extrapolation errors).
Same for columns - clean them or pre-describe some value.

Then you can fit each row, say by a spline of degree = 3 (since
you do have only 13 data it makes possibly not much sense to
use higher degree, may be degree=2 would do).

If you do that fitting and have used convert/rational you will
see, that Maple writes a quotient of polynomials of degree 3
and that in this case your integral can be solved symbolically.

And I guess that is where Maple may hang up. But if you do it
for once symbolically and feed the coefficients from the fit
then it should do (after evalf for the Int).

Seems it is deadly to use piecewise functions here ...

However I admit that I lost patients to step through all this.
sqrt(a+i*b); evalc(%); simplify(%,size);
Have not checked for dependencies (so hope it is right), but

data:=[r = 1/2, c = 1/2, p = 1, q = 1, k = 1];
sol := solve({eq1, eq2, eq3}, {Xz1, Xz2, Xz3}):
S:=eval(sol[2], data):

P1 := p*q*Ez1*Xz1-c*Ez1; P2 := p*q*Ez2*Xz2-c*Ez2; P3 := p*q*Ez3*Xz3-c*Ez3;
[P1,P2,P3]: eval(%,S): eval(%,data):
P1,P2,P3:= op(%):

FOC1 := diff(P1, Ez1): FOC2 := diff(P2, Ez2): FOC3 := diff(P3, Ez3):

Then for d=32/100 I get .16607074491409 and for d=128/100 the
solution is .18056648527631 and 0.125 for d towards 0.


PS: Mike, saving an mw as wms does not give an mws ...

Edited: and in that case E = 5/16 + (d-sqrt((d+1/8)^2+5/256))

may be you can upload your problem (in *.mws, not *.wm format) and more can be said

1. I notice that you write everything in lower case. Fine. But do not do that for Pi :-)

2. For you 1st plot try to look up 'plot3d': you have 2 parameters. The help should guide you.

3. If you write ' x(y)' then Maple considers it as function of x. Try to write what you intend in a
way, which Maple is able to understand.

HTH

additionally you have to take care, that the results are Real values (using Re or Im, see the help), since for complex values the plotting would not make sense, as an example try plot(sqrt(x), x= -2 ..1)

  x^3+x^2+1;         # the equation
  S:=[solve(%,x)]:   # the solutions
  nops(S);           # there are 3 solutions
  map(Re,S):         # does what you want 
  simplify(%, size); # simplify it

i am not in hacking and set this in a Standard sheet - by default it allowed executables down the root, where my working directory sits - thus deleted that and said 'No writable files allowed'.

now just entered a plot command saying export - it exports, even the picture, as gif (despite dis-allowing) and IIRC a standrad attack is through gifs which load through network

so I would not really feel 'secure'

the other point is: using the *.wm may contain 'invisible' code, beyond the auto-exec ... (stumbled into that answering a question here and opened the according sheet ...)

more or less my feeling is: if Maple is following the way to build applications (an idea that I like) it will be confronted with that problem, inescapable

it is just that is not highly likely here to meet a bad mind (which is a kind of whistling in the dark)

anyway, for me it is not a serious problem (even if dislike it ...), more or less one has to be carefull (see my idiocy above ... which should unfortunately prevent me from reading unknown poster's files, i.e. giving answers)

.

You have 44 equations in 41 variables and Maple would tell you, that in
your case it is inconsistent.

Denote M you matrix matcosdir and v = Fexternas+Rvinculo.

Then you use LinearAlgebra[LinearSolve] to solve the linear equations 
M . x = - v, your 'Normales' then is that x (if there is some, there
may be none and there may be lower-dimensional spaces as solution and
there may be exactly 1).

  with(LinearAlgebra);
  LinearSolve(M,-v);

    Error, (in LinearAlgebra:-LA_Main:-LinearSolve) inconsistent system

Actually you can check it (theoretical):

  interface(rtablesize=50);      # displays larger matrices
  ReducedRowEchelonForm(<M|-v>): # cf. help + Math books (help is vague)
  map(fnormal,%,3):              # you only have 3 Digits
  simplify(%,zero): identify(%);

or 

  GaussianElimination(M);

Your matrix then is zero in the last lines, while your v is not:
it is like solving 0*x=1 for x.


PS: your sheet is another example of the incredible uglyness of
the 'standard' worksheets, it does not even allow to save in a
reasonable format as *.wms ... what a shame for Maple.

This is why I usually refuse too look at *.mw (which unfortunately is
used by beginners).

The function should be neither too flat not too steep, since
you divide by f'(x[n]) and actually a code would check that.

Beyond that the theory says: do not start at inflection points.
But practical ...

So an answer would be: there is no guarantee that it works
and if not ... try another method ...

"Numerical Recipies" shows some, Google may give you
links for some downloads of that book.

PS: you should not use fdiff here, try D(f).

First 72 73 74 75 76 77 78 Last Page 74 of 93