Axel Vogt

5821 Reputation

20 Badges

20 years, 357 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

Played with it ... 

In your upload you say 'this is CDF of a distribution' and finally
regarded that ... grrr ...

First set E=1 (as this can be handled through x) and kick off the
leading constant Pi*csc(Pi*a) = Pi/sin(Pi*(c-m)), call that R.

Then diff(R, x) = (cosh(2*X)-sinh(2*X))*polynom(X) / Pi for your
data (where x = X^2), using convert(%,StandardFunctions) as acer
suggests.

This should give a recipe: your pdf is exponential * polynomial.
since exp(-2*X) = (cosh(2*X)-sinh(2*X)) and you should try that
as a starting point, as integrating gives a simple form.

So: may be you can find the pdf distribution, then it is simple.

IIRC a set is not sorted, so multiply with something sorted may differ in different runs ...

Instead of lists you can use rtable or Vector or Array

may be this is what you want ... www.mapleprimes.com/files/102_alberto_10Jul2008.mws
I cleaned up your lines and replaced all semicolon by a double point to avoid printing
Your last Y3 can be simplified considerably:

  length(Y3);
                                161079  
  X3:=simplify(Y3,size): length(%); 
                                 7821
Now determine indeterminates, make it a procedure and optimize it, finally try to
generate 'shorter' statements:

  theIndets:=convert(indets(X3),list); 
         theIndets := [Hx, Zx, Zxx, qx, qxx, GRAVIT, Hxxxx, Qxxx, Qxxxx, Zxxx]
  p1:=codegen[makeproc](X3, theIndets):
  p2:=codegen[optimize](p1, tryhard):
  codegen[prep2trans](p2):
  p3:=codegen[split](%);

By this the computational costs are also decreased:

  codegen[cost](Y3); 
  codegen[cost](X3); 
  codegen[cost](p2);
  codegen[cost](p3); 

  5355 additions + 18384 multiplications + 1350 divisions + 9909 functions
   313 additions + 998 multiplications + 135 functions + divisions
  63 storage + 63 assignments + 254 multiplications + 117 additions + 3 functions + divisions
  66 storage + 66 assignments + 254 multiplications + 117 additions + 3 functions + divisions

Then you are ready to generate Fortran code. Unfortunately Maple thinks
that the lines are too long - however it produces them as comment lines
and thus you should be able to finish manually (the message is a bit mis-
leading since we already tried it):

  Fortran(p3);

  Warning, the function names {CS} are not recognized in the target language
  Warning, character limit for Fortran77 statements exceeded; please filter
    input through codegen[split] first.
  






i am almost sure that those answering (if having time and interest) do not even need points or awards but mostly may prefer something like "thank you, that helped me", if it is honest

  restart; Digits:=20;
  k/Pi^4; subs(k=104,%); a:=evalf(%); b:=1/a;

  identify(a, extension=[seq(Pi^(j),j=-4..4)]);

                                 104
                                 ---
                                   4
                                 Pi

  identify(b, extension=[seq(Pi^(j),j=-4..4)]);

                                   4
                                 Pi
                                 ---
                                 104

Convert to listlist or array (the last suggested through the help pages) works for me.

But it forgets the floating point nature: 2.0 becomes an integer 2

Have not stepped through the problem in detail, but you do not need
to approximate the error function on your own (it makes the function
non-analytic) and there is no need to use Simpson (playing with your
approach I see a 'discontinuity' at ~ 1.6 for your task, but do not
want to look closer).

After converting to rationals you want the following:

Int(169858969913624935089195720356683/26813033068808184917956157510272*
  (1-erf(5/12*(12/5-u)/u))/u*exp(-1/9*(u-1/2)^2+25/144*(12/5-u)^2/u^2),
     u = 125/942 .. 175/314);

Using simplify(%); expand(%); combine(%,exp); normal(%); evalf(%);
gives the value in the title (astonishingly not 64 digits ...)

hm ...

You said you want the images ...

... but if you want the complete 'sheet' why do you want to run
it from outside and not some sheet itself?

Note that you do not have a sheet (to be saved), if you use only
the kernel itself ... but you want the userinterface to be shown
from it (I am not aware that one would do so with other systems,
only SAP had something similar called 'batch input').

It would be far more simple to enter the commands directly than
to use the cryptic syntax for OpenMaple ...

May be you can fake some protocol, save that and reload it.

Or do you want to 'hack' the 3rd party solution? There should be
a reason, why the software allows you no deeper access ... Do
you have the source code?

If not you may also contact the software vendor, whether (s)he
offers a way to achieve your needs.

what should that be good for, why you want it that way?

A better method is to use RootOf (and to multiply by 1+k^2), but it gives no 'answer'
even after applying 'allvalues'.

You may want to interprete it as: "the system can not provide a satisfactory answer
automatically in terms of its known functions", so it is quite likely that there is none
(even if there may be a solution [depending on conditions for k]).

Of course t=0 will do, but for others ...

 exp(-t)-cos(t)+sin(t); # k=1
 fsolve(%,t,complex,avoid={t=0.}); 
                 -6.5025973236926 - 6.8491704362806 I

I think the question is a numerical variant for the the other thread
http://www.mapleprimes.com/forum/solve0 by the same poster and there
is no reason (for me) why a 'symbolic solution exists' or why any CAS
should find one.

For the problem here: he is working only with 6 significant Digits,
and must be aware for the consequences (besides possible typos ...).

It is not even clear whether the small constants are to be considered
as zero, a variant to acer's post is:

  Digits:=14;
  MmaTranslator:-FromMma(p); 
  fnormal(%);                       # clean up
  lhs(%)-rhs(%): convert(%,rational);
  subs( t= 200000/76603*s, %);      # to have cos(1*s) and sin(1*s)
  q:=%;

The above cleaned up the input and normed it a bit, we want zeros for
q depending on s and for s=0 we have one (without cleaning up through
fnormal it comes to acer's result, the taks is symmetric w.r.t. the
'y-axes'). Due to periodics another solution is in s + a, a=76603*Pi
for the above presentation.

It may be better to give some information about the actual task which
rised the question(s).
Why there should be a symbolic solution? I see no reason for that.
But it is not difficult to find the numerical ones:

Calling R the initial expression you can combine tau and h into t,
RR:=subs(tau=1,h=1,R), M:=subs(t=I*t,RR) following Alex' way, now

  map(Re,M);
  plot(%, t= - 2.3..2.3):
  plot(1, t= - 2.5 .. 2.5, color=grey):
  plots[display](%%,%);

shows the roots for M=1, they are symmetric w.r.t. vertical axis:

  'eval(M,t=-t)' - 'M': '%'= simplify(%);

                           M|       - M = 0
                            |t = -t

  'evalc( Im(M))': '%'=%;
                           evalc(Im(M)) = 0

and

  fsolve(M=1,t=0.5, fulldigits); eval(RR, t= %/I); evalf(%);
  fsolve(M=1,t=2.1, fulldigits); eval(RR, t= %/I); evalf(%);

finds and confirm the roots for RR - 1, they are given through
0.56880852623983 and 2.2446321162676 (Maple12, 14 Digits).

 

Knowing nothing I googled and ... besides that I got the impression that the ODE is not always solvable in closed form was led to Zwillinger "Handbook of Differential Equations (1997)", who in 44.1.1, p.180 refers to Murphy, G. M. "Ordinary Differential Equations and Their Solution" (1960) at pp. 23 and 25. May be time for OP to visit a library ...

in both Maple 11 and 12 I get exp(mu2(r)) by just pasting the expression, not even a simplify is needed (classical interface)

best would be you upload your sheet

I do it the following way having MS Word (and having always activated non-printable signs):
- copy and paste into a Word document (may be with font=courier for better reading)
- then search for  "^p> "   and replace it by "^p" (all occurencies)
- and then copy and paste to Maple (I only use classical interface)
The above means to replace a paragraph sign ^p followed by a > and a blank is
replaced by the paragraph sign only (which is the hard line break)
First 75 76 77 78 79 80 81 Last Page 77 of 92