Axel Vogt

5936 Reputation

20 Badges

20 years, 252 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

Just a quick try: isnt that a differential equation for g : = f @ e ?

Can't help myself, I find it funny anyway :-)

I struggled with it and think your maximum is 4*arctan(3) ~ 4.9... for h = L/2 = 1/400 and g = 0+
That would explain, why the optimizer 'fail': it is at the boundary. And h = L/2 gives numerical
troubles for y = 0 and x ---> 0 (i.e. for g ---> 0).

Edited: up to the factor B[r]/(4*Pi), which is not needed for the maximum

never will understand that ... though it is convenient for reading

mathematically it is equivalent to use t(n) instead of the indexed version,
whatever the notations are like (Maple's) t[n]

and using the 'function' notation seems not to disturb Maple

It seems you have some design in mind for a system, ask partial questions
and reject answers by refering to something never mentioned. More or less.

You may wish to consider rethinking that ...


More or less it sounds as if you want a kind of trading sheet or similar
and it simply may be, that Maple as interface is not the right tool. It
is not actually ripe for building applications (though you might try to
go towards Maplets).

A quite common way is to separate things and when I did such trading stuff
for a bank the common choice was Excel (else you need serious coding).

It allows for handling while 'in the background' several other stuff can
run, one has something like 'event driven', you can switch to 'data driven'
by code.

Though Excel is poor in some parts it is superior in others. Like that.
If you use it as an interface (and VBA for code).

The system was roughly a data source (delivered from a separate server(s),
no need to care for that), an inhouse access via DDE (to feed the Excel),
a timer in Excel VBA for updating data (which one can always shut down by
a 'button' or else), VBA code for processing data - and the good internal
ability of Excel to interact with the user (which it once was designed for).

But Maple primarily is a CAS. With some numerics. And very incomplete for
what you may have in mind:

It would make sense to devote computations to Maple, ok. But fetching data
already becomes questionable (what if the connection brakes down? data are
not valid? ...). Even the userinterface is hairy.

As soon as you step in you will notice, that you have 'sequentialize' your
demands. By own coding. Excel has a very ripe scheduler which does that.
It is one of the central, essential and proprietary parts.

Of course you do not need Excel for that and a serious application would
be better and that of course is done (in layered systems).

But not based on a CAS - currently not the right tool for an application.

a) Your e does not have a numerical value, if you mean the exponential function then just use it.
Moreover if you can not plot, then evaluate the function in some of the points to see what may be
the reason.

b) Maple simplifies to its known constants, of course. But you can fake:
 

sin(0):= 'sin'(0);

sin(0);
                                sin(0)

evalf(sin(0));
                                  0.

sin(0.0);
                                  0.

At least your eta is a function of 2 variables, so you have to say what you mean to us and Maple:
unary just means 'function of 1 variable'

eta:= (x,y) -> (D[1](u)(x,y))^2 + ((D[2](v)(x,y))^2)^n is what you want for eta, but may be you even
mean 'differentiating twice' with your powers of 2 ...

It has not so much to do with Maple ...

 restart: Digits:=14:

f:= x -> x^2-5:
NR:= proc(f,z,M)
local a,A:
  A:= 0;
  a := z:
  for A to M do:
    a := evalf(a) - (f(a)/D(f)(a))
  end do:
return("done.");
end proc:
 
# worm up: a first call enforces to load all one needs
NR(f,1,1): 

# now let it run
myM:=5;
start:=time[real]():
NR(f,1,myM);
finish:=time[real]():
`seconds` = finish-start;

                               myM := 5
                               "done."
                           seconds = 0.094

myM:=1600;
start:=time[real]():
NR(f,1,myM);
finish:=time[real]():
`seconds` = finish-start;

                             myM := 1600
                               "done."
                           seconds = 1.031


This is involves more Maple by computing f/f' first

 restart: Digits:=14:

f:= x -> x^2-5:
g:= f/D(f);
NR:= proc(f,z,M)
  local a,A:
  a := z:
  for A to M do:
    a := evalf(a) - g(a)
  end do:
return("done.");
end proc:
 
# worm up: a first call enforces to load all one needs
NR(f,1,1): 

# now let it run
myM:=1600;
start:=time[real]():
NR(f,1,myM);
finish:=time[real]():
`seconds` = finish-start;

                             myM := 1600
                               "done."
                           seconds = 0.094

Of course it does not make too much sense to have myM = 1600
here (for Newton's method), but I hope it gives you an idea.


[solve(f(x)=0,x)]; evalf(%);

                              1/2    1/2
                            [5   , -5   ]
                 [2.2360679774998, -2.2360679774998]

Besides Maple specifics (which I am only partly aware) this is quite common.

I would use more steps (so it need at least more than 1 sec).

And I would use a 'worming up' for loading needed components.

For Maple please be aware, that 'restart' does not really do what one would
expect from that name, it still holds some information in the system (but you
can overcome most of that issue for timing by the above).

You may wish to upload the question as worksheet (in classical format), your question is a bit too cryptic.

Anyway: the system alraedy replies by pointing you to some handling error: "Warning, inserted missing semicolon at end of statement"

I know forums, where you neither can delete nor modify uploaded sheets.

At first this sounds a bit odd, however it complements rules like not
allowing to earse or modify postings (except through the admin).

So you have to live with your sins :-)

Setting files to 'private' is a fair trade for me, usually.

If you want to be sure of your ownership: put it to your own web space
and reference by linking (drawback: will be lost if you gave it up).

BTW: if they have some good sense the files still are stored, but at
a different area, for rare but possible legal reasons.

Mike,

In coding you always should care for exceptions. Just do it.

log(x)*x; limit(%, x=0, right);
                                  0

I have no feeling why that should have some closed form and I find it a bit
odd that the OP does not tells where the question comes from.

Changing variables it is Sum( b(k), k = 0 .. infinity) with b(k) = 
  1/6*(1+((k+2)/(k+1))^(2/3)-((k+2)/(k+1))^(1/3))*
  (12*(k+3/2)^2-2) / (k+1)/(k+2)/(2*k+3)^2

which for p =0,1,2 is adding

Sum(1/3*((k+2)/(k+1))^(1/3*p)* 
  (6*(k+3/2)^2-1)/(k+1)/(k+2)/(2*k+3)^2,k = 0 .. infinity)

or

Sum(((k+2)/(k+1))^(1/3*p)/(k+1)/(k+2) * t,k = 0 .. infinity);

                       infinity /k + 2\(p/3)
                        -----   |-----|      t
                         \      \k + 1/
                          )     ---------------
                         /      (k + 1) (k + 2)
                        -----
                        k = 0

with t = 1/3*(6*(k+3/2)^2-1)/(2*k+3)^2

For p=0 one even gets a symbolic solution, for p=1 or 2 it converges (?!).

The term ((k+2)/(k+1))^q can be written as hypergeometric 2F1 and after
that as powerseries in 1/(k+1) or 1/(k+2) (take reciprocal with -q).

Now interchang the summation. I gave up, Maple does not give me the results
for that single cases (and I do not see, whether it would finally result
in something meaning full).

So I leave it as it is. And have a beer now. 
Do not give up, it is just not so easy to learn Maple, to find out how the
programming might work (documentation is a bit sparse on that and answers
to questions here for that special topic are rare) and to couple 2 systems.

But more or less it can be done, as far as you can put your code into some
DLL. And I doubt you need Watcom or the Maple 'WRAPPER' for that in a wider
sense.

You can do it either through wrapperless calling with define_external in an
easy way. Or using Open Maple.

If it is that your code expects a function, than using function pointers is
a way and all I showed is how one can do that through Open Maple (in C).

If you have strings or arrays (do not know how it is named on Fortran) then
you will find it out through simple examples.

Also it might be helpfull to have some knowledge for calling C from Fortran
and conversely: see ?OpenMaple, it does not mention Fortran.

If you really want and need it then you can nail it down, just try it until
your frontiers - even if it needs longer time. But that are the situations,
where you learn most, merely by being motivated. And in case of failing you
have done sound work and learned a lot being usefull for yourself beyond it.

But these are just my 2 € Cents ...
Your task and content of the file is to solve sin(3*x) = cos(5*x).
 
I think (having not really checked your result in detail) there are 2 issues:

a) Maple knowing 1/2*(2+-(2+-2^(1/2))^(1/2))^(1/2) is a sinus and arctan of
it is some integer/Pi*16

b) having a solution (as set) to simplify it into a common base using its
somewhat strange way to represent integer base:

  sin(3*x) = cos(5*x);
  RootOf(%,x);
  [allvalues(%)]:
  map(evala,%); #simplify(%, trig); convert(%, cos);
  map('t -> t/Pi*16', %);
  evalf(%);
  identify(%);
  convert(%, set);
  map('t -> t*Pi/16', %);
  simplify(%);

This (with Digits:=14 for evalf) should simplify to your solution  :-(
First 60 61 62 63 64 65 66 Last Page 62 of 93