Annonymouse

160 Reputation

6 Badges

11 years, 83 days

MaplePrimes Activity


These are questions asked by Annonymouse


Thanks everyone for helping me over the years. I've just handed in my PhD- and I really considered Maple Primes like a supervisor.

Currently I am relearning Financial maths - as depending on grants I may leave academia :(

Today I am learning utility functions and risk aversion and thought to make a graphso i could visualise them

 Here is a graph of the log of the utility of x - with two utility functions - constant absolute risk aversion (lower surface) - and constant relative risk aversion (disjoint surface above); for both functions  g (and in the attached worksheet R) is a parameter of these functions; annoyingly for these versions of these functions to be plotted on the same axis - they are so different in scale that it is hard to see anything interesting.

However one of the key features of utility functions is that we consider them to be unaffected by scalling- i.e. that if U_2(x)=c*U_1(x) for all x then U_2(x) and U_1(x) are considered to be the same function.

This means that scalling can be done in a much more useful way than what I have done. Instead of plotting f(x;R)=x^(1-R)/(1-R) on the interval I (x=1..100), i'd like to plot g(x;R)=f(x;R)/max(f(x;R),I)  on the interval I.

I worked out that on a 2d graph this can be done using maximise. But I'd like to plot g(x;R) in 3d as both x and R vary and i cant think of how to do that! 

Cara_functions.mw

I am interested in taking a complex number and repeatedly raising it to a power and graphing the result to see if it looks cool (i think it will) to do this i wrote this program

iterativepower := proc (base, index, n)

local out, i;
out := vector(n+1, 1);

out[1] := base;

for i to n do out[i+1] := out[i]^index end do;

out;

end proc;


this can be run with:

iterativepower(2, 2, 5)


This doesn't return a vector, it returns the word out. Why is that, and how do i fix it?


How can you get maple to evaluate i^i?

when i type in
I^I

i just get

I^I

and similarly when i raise numbers to complex powers i get results like 2^(2I+6)

 

These are the timings for various algorithms, using different starting points deriving surfaces of dimension 5, 4, 3, 2, 1

times3:=[[], [.140], [1.344, .891], [1.578, 1.312, 1.375, 1.437, 1.922, 2.625, 6.406], [2.188, 2.312, 1.687, 2.110, 2.047, 1.578, 8.953, 1.891, 1.875, 9.344, 2.203, 55.969, 2.266, 2.531, 81.078, 2.172, 50.641, 2.500, 3.141, 61.656, 3.406, 3.375]]

times1:=[[.718], [.766, 4.703], [.750, .797, 7.594, 3.938], [6.594, 7.718, 11.969, 8.485, 11.391, 130.583, 548.284, 974.435], [7.281, 8.515, 65.569, 7.016, 8.312, 9.500, 8.562, 9.766, 10.641, 12.609, 13.281, 17.453, 18.640, 1763.860, 2659.990, 7812.89, 8189.139]]

So far i can get a boxplot of either:
Statistics:-BoxPlot(`~`[`~`[log10]](times3));
Statistics:-BoxPlot(`~`[`~`[log10]](times1));

but what I'd like is a boxplot like this but i can't work out how to do this.
 

I am working on a simple program (4 lines excluding header/footer and debug command) that calculates a Lie-derivatives of a function G, supplied by the user, with the rule:
 

derivative of x[i]=F[i]  (an input supplied by the user),
derivative of y[i]=y[i+1].


this calculation revolves around a dot product, and I can't seem to work out what has gone wrong. My impression is that is because nops of a Vector gives you  1 more than the length of the Vector, so the Vector handed to DotProduct is wrong- but i can't see why it doesn't work in the case of G2 and F2 but does for G and F.

lieDer2_problems_mwe.mw

2 3 4 5 6 7 8 Last Page 4 of 15