Axel Vogt

5936 Reputation

20 Badges

20 years, 251 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

sqrt(a^2 - 4*x) < b; solve(%,x) assuming (0 < b);
subs(b=a,%);

                            2     2      2
                           a     a      b
                     {x < ----, ---- - ---- < x}
                           4     4      4

                                        2
                                       a
                          {0 < x, x < ----}
                                       4

There are several ways - but not through exporting graphics (this would
give something static).

In your case I suggest: you ask Maple to give you the code that you can
use in VBA (with mild modification), so you have functions in Excel to
be called in a spread sheet for plotting.

  restart; Digits:=16;
  # your stuff goes here
  sol:=solve( ... )

  assign(sol); # you can use that only once after solve

  S1:=unapply(s1(x), x);
  CodeGeneration[VisualBasic](S1);

for 1)

What have you done so far and what would you write down using paper and pencil?

This is like entering arctan(1,x) and if you want a different presentation you want a conversion to something else, for example by calling  convert(%, ln)

In your case you may try convert(expr,elementary) or convert(expr,arctrig)

For me the following works (classical interface):

Mark input + output with the mouse, copy to clipboard, paste here.

Then select 'Formatted' in the Format drop down list (may be marking the desired range)
exp too large as written down, it gives underflow
exp(-2.00000*10^5*t)= 1e-306;
isolate(%,t);
                        /               5  \       -306
                     exp\-2.000000000 10  t/ = 1 10    
                             t = 0.003522955192
try the following reformulation
p(t); convert(%, rational); convert(%, exp); expand(%); combine(%, exp); 
plot(%, t = 0. .. .1);

not a direct answer - and I was too lazy to vizualise your region - but I would decompose it ... and from old days "Stoke's Theorem" comes into my mind

Try to find LinearAlgebra[Dimension] or LinearAlgebra[RowDimension] in the help pages

old versions may have resolved bugs  ...
 
 restart: interface(version);
 stats[random,binomiald[400,1/2]](4);

   Classic Worksheet Interface, Maple 9.50, Windows, Dec 8 2004 Build ID 174210
                          198, 195, 196, 199

 restart: interface(version);
 stats[random,binomiald[400,1/2]](4);

   Classic Worksheet Interface, Maple 12.02, Windows, Dec 10 2008 Build ID 377066
                          197, 191, 180, 208

It may be better to use upper case Matrix, not the lower case matrix (please check the help for Matrix)

For your actual question: look up the command 'map', which especially would apply a function elementwise to a Matrix

P:=15000:
> S:=proc(n) option remember;
> local r;
> if n < 11 then 
>   -S(n-1)*(-11*P+10*S(n-1))/P;
> elif n < 20 then # ignore small constant 
>   -S(n-1)*S(n-1)/1500;
> else
>   r:= evalf(S(n-1));
>   -1/1500*r*r;
> end if;
> end proc:
> S(1):=1:

That is exact for small n and gives a small error beyond, since
10*Q(10)/P ~ -.2280046013e18 has much more decimal places

nTst:=16;
> S(nTst): evalf(%);
> Q(nTst): evalf(%);
> Q(nTst) - S(nTst): evalf[1000](%): evalf(%);

Now solve recurrence for ignoring '11'

> f(n)=-f(n-1)*f(n-1)/q;
> rsolve({%}, f(k));
> simplify(%) assuming (k::posint, 0 < q, f10 < 0);
> #simplify(%, symbolic);
> #eval(%, k=0);
> #eval(%%, k=1);
> #eval(%%%, k=2);

                                k      k
                              (2 )  (-2  + 1)
                         -f(0)     q

Then the following equals S and is fast, error see above,
f(0) stands for S(10)

> T:=proc(n) option remember;
> local r, f0,q;
> q:=10/P;
> if n < 11 then 
>   -T(n-1)*(-11+T(n-1)/1500);
> else
>   f0:= T(10);
>   r:= f0*q;
>   -r^(2^(n - 10))/q;
> end if;
> end proc:
> T(1):=1:

A test:

> nTst:=19;
> Sn:=S(nTst): evalf(%);
> -(S(nTst-2)/1500)^(2^(2)) * 1500: evalf(%);
> Sn+(S(10)/1500)^(2^(nTst-10)) * 1500;: evalf(%);
> Tn:=T(nTst): 
> Sn - Tn; #evalf(%);

                                  0

Hope I have not an index-shifting error in it (test it, all n).

Modify using evalf for lager n.

In case of trouble upload your sheet, after copying above to it.

Hm ... that says you use something like g:=1.234

I have to admit that the help pages are not of help for me for using it with g as parameter (hard to find).

And after playing I think you have complex, non-real values involved (and do not see whether that will work)

But as already said: I rarely use that part of Maple, certainly others will have a clear view on it

 

Edited: yes, it is complex.

  {eqn, init}; 
  #eval(%, g=1.23):
  map(convert, %, D): #map(convert,%,signum): 
  S:=map(convert,%,rational);

Then in t=0 you have complex values:

  eval(S, t=0); eval(%,S); #convert(%,abs): expand(%): 
  evalf(%);

    (D@@2)(x)(0) = -.8573132180e-1-4346.155856*I,
    (D@@2)(z)(0) = .3713431519+18825.26921*I-40.*g

Search for dsolve, at the bottom you will find the link to dsolve/system (or type it in with the leading '?'), it shows some examples.

May be you need some restrictions for your parameters

This indicates, that the system does not know what the command means:

highlight it and press F1 (or F2 in the standard) for the worksheet help, plots[display] would be better

(and I ignore that you have other things in your code ....)

I did the following in a VBA project with Excel 2000 and Maple 12, for
which one has to add a reference to WMIMPLEX.xla in the project (that
addin is at C:\Programme\Microsoft Office\Office\Makro on my PC and it
comes with Maple, it is password protected - so you need to look into
the example cited above for calling Maple from VB).

Sub tst_differentiating()
Dim str As String
Dim dummy

dummy = (Maple("Digits:=16"))

Debug.Print "-----------------------"
dummy = (Maple("diff(-cos(x), x)"))
Debug.Print dummy
Debug.Print TypeName(dummy)

Debug.Print "-----------------------"
Debug.Print (Maple("f:= x -> cos(x)"))
Debug.Print (Maple("D(f)"))
Debug.Print (Maple("a:=1.0"))
Debug.Print (Maple("D(f)(a)"))

Debug.Print "-----------------------"
dummy = (Maple("D(f)(Z)"))
str = Replace(dummy, "Z", "1.0")
Debug.Print str
Debug.Print Evaluate(str)

Debug.Print (Maple("sin(a)")), Sin(1#)

End Sub


That Excel makro gives the following output at the debug window:

-----------------------
sin(x)
String
-----------------------
f := x -> cos(x)
x -> -sin(x)
a := 1.0
-.8414709848078965
-----------------------
-sin(1.0)
-0,841470984807897 
.8414709848078965            0,841470984807897 

 

First 65 66 67 68 69 70 71 Last Page 67 of 93