itsme

769 Reputation

14 Badges

17 years, 50 days

MaplePrimes Activity


These are questions asked by itsme

This is a stripped down example of something I've been doing. Basically I'm building matrices which I then, using unapply, convert into functions of some variables of t.
.... but found that simplify seems to often not work as i'd wish.
 

restart:
mm:=Matrix([[cos(sqrt(g__1^2)*t), (-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2))], [(-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2)) ,cos(sqrt(g__1^2)*t)]]);

#great - simplifies as i'd expect:
simplify(mm) assuming g__1::positive;

Do the same thing but when matrix is a function of t
mmFun:=unapply(mm, t);

#the function works - gives what i'd expect
mmFun(3); mmFun(t);

#but now the simplification does not work - why the g__1 in the argument of cos does not get properly simplified?
simplify(mmFun(t)) assuming g__1::positive;

Any ideas if this is a bug? I'm using maple 2015.2 on linux 64-bit.

here is the worksheet: simplify_issue.mw

thanks

EDIT:

as a side note once can sometimes overcome this with mapping simplify  as in :

map(simplify, resultMatrix ) assuming g__1::positive;

but this is not optimal, and sometimes does not work when i first multiply the matrix by say a vector.

 

 

 

This question is probably for maple devs...

I was wondering if it would be possible to outline what algorithm is used to generate replications (realizations) for various processes by the Finance:-SamplePath command (and friends). For example in the code like this:

with(Finance):

X := WienerProcess();
A := SamplePath(X(t), t = 0 .. 1, timesteps = 100, replications = 20);

Is it the Euler-Maruyama method?

Alternatively maybe you can show the portion of the code that is responsible for the integration of the SDE that the Wiener process defines.

I can't find any details related to this information in the help, and it would be very helpful to know this (and more importantly have it in the help section).

Thanks!


I'm trying to add a label to a plot and need the derivative to be represented as a dot. My typesetting rules are set to extended, and it works in a worksheet but not in the plot. See attached image. The code to generate it is:

#the output is shown with a dot over phi
diff(phi(t),t);

#derivative in label not shown as a dot
plot(sin( t), t=0..10, labels=["t", typeset(diff(phi(t),t))], labeldirections=[horizontal, vertical]);

any ideas?

thanks

EDIT:

this seems to work... ( i will leave this question here as it might come in handy to someone else).

plot(sin( t), t=0..10, labels=["t", Typesetting:-Typeset(diff(phi(t),t))], labeldirections=[horizontal, vertical]);

Is it a bug that using the first variant does not work? any ideas from the experts?



Hi:

I would like to slightly modify the "Explore" command -- I find it extremely useful, but the layout often doesn't work well for me (my typical use case is say 12 plots with ~10 parameters that vary). The problem is that the default alignment the columns of the table that contains a matrix of plots is "Center" and my plots don't fit on the screen properly (no matter how I play with sizes, placement, etc) and I would like it to be "Left" aligned --- aligning things manually (via right click) after the explore command is executed is possible, but painful, given that I often change my code.

... bottom line is that I would like to be able to re-define the "Explore" command.

I tried doing so by first calling:
showstat(Explore);

... then removing all the numbers, renaming the proc to sat MyExplore, declaring it (i.e. so maple understands it) and for now using that instead of the old Explore in my program (with no actual code changes for now). The problem is that I get the following error:

Error, (in DocumentTools:-Layout:-Table) number of Column arguments, 3, exceeds total column span, 1, computed from Rows' Cells

I think, somehow maybe showstat is not showing the full thing? or maybe it is part of a more complicated module? or maybe by removing the numbers the formatting got screwed up (i was careful here)?

So my question:

How would I define my own function "MyExplore" that (for now) contains exactly the same code and functionality as the built-in "Explore"?

thanks!

Consider a plot generaged by:

export_plot_options:=font=[TIMES, roman, 30], axis=[thickness=4, location=low], size=[850,850]:
points := [seq([seq(exp(-(x^2+y^2)*(1/100)), x = -10.0 .. 10.0)], y = -10.0 .. 10.0)]:
plots:-listdensityplot(points, export_plot_options);

How can one get rid of white space between the axes and the actual data??

thanks

4 5 6 7 8 9 10 Page 6 of 12