;
restart; with(plots); _local(O);
P := b*x*cos(phi)+a*y*sin(phi)-a . b = 0;
P := b x cos(phi) + a y sin(phi) - a . b = 0
Q := a*x*sin(phi)-b*y*cos(phi)-c^2*sin(phi)*cos(phi) = 0;
2
Q := a x sin(phi) - b y cos(phi) - c sin(phi) cos(phi) = 0
M := op(solve([P, Q], [x, y])); M := [subs(M, x), subs(M, y)];
X := `&-+`(P/sqrt(b^2*cos(phi)^2+a^2*sin(phi)^2)); Y := `&-+`(Q/sqrt(b^2*cos(phi)^2+a^2*sin(phi)^2));
#L'équation générale des coniques ayant pour axes MN et MT est, par rapport aux nouveaux axes de coordonnées
X^2/A+Y^2/B-1 = (0*et)*par*rapport*aux*anciens;
P^2/(A*(b^2*cos(phi)^2+a^2*sin(phi)^2))+Q^2/(B*(b^2*cos(phi)^2+a^2*sin(phi)^2))-1 = 0;
2
/b x cos(phi) + a y sin(phi) - a . b \
&-+|----------------------------------- = 0|
| (1/2) |
|/ 2 2 2 2\ |
\\a sin(phi) + cos(phi) b / /
---------------------------------------------
A
2
/ 2 \
|a x sin(phi) - b y cos(phi) - c sin(phi) cos(phi) |
&-+|-------------------------------------------------- = 0|
| (1/2) |
| / 2 2 2 2\ |
\ \a sin(phi) + cos(phi) b / /
+ ------------------------------------------------------------
B
- 1 = 0
#1.-Ecrivons que la conique (1) est tangente en O à Oy : il faut pour cela annuler le coefficient de y et le terme indépendant.
#Nous obtenons 2 équations en A et B, d'où nous tirons : A=a² et B=c²cos(phi)²
a := 10; b := 7; c := sqrt(a^2-b^2); phi := 4*Pi*(1/5);
Ell := implicitplot(x^2/a^2+y^2/b^2-1 = 0, x = -11 .. 11, y = -8 .. 8, color = grey);
O := [0, 0]; M := [a*cos(phi), b*sin(phi)];
vec := plot([O, M], color = black, thickness = 1);
P := implicitplot(P, x = -20 .. 20, y = -20 .. 20, color = aquamarine);
Q := implicitplot(Q, x = -20 .. 20, y = -20 .. 20);
F1 := [(a+b)*cos(phi), (a+b)*sin(phi)]; F2 := [2*M[1]-F1[1], 2*M[2]-F1[2]];
F1F2 := plot([F1, F2], color = green, thickness = 3);
ELL := implicitplot((b*x*cos(phi)+a*y*sin(phi)-a . b)^2/(a^2*(b^2*cos(phi)^2+a^2*sin(phi)^2))+(a*x*sin(phi)-b*y*cos(phi)-c^2*sin(phi)*cos(phi))^2/(c^2*cos(phi)^2*(b^2*cos(phi)^2+a^2*sin(phi)^2))-1 = 0, x = -20 .. 20, y = -20 .. 20, color = blue, thickness = 3);
Hyp := implicitplot((b*x*cos(phi)+a*y*sin(phi)-a . b)^2/(b^2*(b^2*cos(phi)^2+a^2*sin(phi)^2))+(a*x*sin(phi)-b*y*cos(phi)-c^2*sin(phi)*cos(phi))^2/(-c^2*sin(phi)^2*(b^2*cos(phi)^2+a^2*sin(phi)^2))-1 = 0, x = -20 .. 20, y = -20 .. 20, color = black);
dF1 := plottools[disk](F1, .3, color = red);
dF2 := plottools[disk](F2, .3, color = red);
cir1 := implicitplot(x^2+y^2 = (a+b)^2, x = -20 .. 20, y = -18 .. 18, color = pink);
cir2 := implicitplot(x^2+y^2 = (a-b)^2, x = -10 .. 10, y = -4 .. 4, color = coral);
asym1 := implicitplot((b*x*cos(phi)+a*y*sin(phi)-a . b)/b+(a*x*sin(phi)-b*y*cos(phi)-c^2*sin(phi)*cos(phi))/(c*sin(phi)) = 0, x = -20 .. 20, y = -18 .. 18, color = black, linestyle = DOT);
asym2 := implicitplot((b*x*cos(phi)+a*y*sin(phi)-a . b)/b-(a*x*sin(phi)-b*y*cos(phi)-c^2*sin(phi)*cos(phi))/(c*sin(phi)) = 0, x = -20 .. 20, y = -18 .. 18, color = black, linestyle = DOT);
tp := textplot([[M[1], M[2]+.8, "M"], [F1[1]-.8, F1[2], "F1"], [F2[1]+.8, F2[2]+.3, "F2"], [5, 15, "axe P"], [8, -10, "axe Q"]]);
display([Ell, vec, P, Q, F1F2, cir1, cir2, ELL, Hyp, dF1, dF2, asym1, asym2, tp], scaling = constrained, axes = normal, axis = [gridlines = [1, color = blue]], xtickmarks = 0, ytickmarks = 0, view = [-20 .. 20, -20 .. 20], size = [500, 500]);
#Eléments fixes : Ell, cir1, cir2, O
#Parties mobiles : ELL, Hyp, P,Q, M,F1, F2,
# FIGURE MOBILE
n := 100; dt := 2*Pi/n; Phi := 0;
P := b*x*cos(phi+dt)+a*y*sin(phi+dt)-a . b = 0;
Q := a*x*sin(phi+dt)-b*y*cos(phi+dt)-c^2*sin(phi+dt)*cos(phi+dt) = 0;
M := [cos(phi+dt)*(sin(phi+dt)^2*a*c^2+Typesetting[delayDotProduct](a . b, b, true))/(a^2*sin(phi+dt)^2+cos(phi+dt)^2*b^2), sin(phi+dt)*(-cos(phi+dt)^2*b*c^2+Typesetting[delayDotProduct](a . b, a, true))/(a^2*sin(phi+dt)^2+cos(phi+dt)^2*b^2)];
ELL := (b*x*cos(phi+dt)+a*y*sin(phi+dt)-a . b)^2/(a^2*(a^2*sin(phi+dt)^2+cos(phi+dt)^2*b^2))+(a*x*sin(phi+dt)-b*y*cos(phi+dt)-c^2*sin(phi+dt)*cos(phi+dt))^2/(c^2*cos(phi+dt)^2*(cos(phi+dt)^2*b^2+a^2))-1 = 0;
NULL;
display([Ell, cir1, cir2], scaling = constrained);

Hi

This worksheet by Jason Schattman, I cant work out how he gets vector r, the expected value (in bold). I did ask him. Anybody shed any light?

I thought EV was calculated by averaging each stocks yearly returns. EV for Q[1] is (0.08-0.2+.05)/3 (<> 0.05)

Obviously i'm going to get a different r to him, but out of interest what maple commands do i need to convert Q into r using my method for EV?

portfoliooptimizati.mw

I want to draw circle passing thought three points **S, A, B** on the sphere by using **tikz-3dplot-circleofsphere**, its document at here https://github.com/matthias-wolff/tikz-3dplot-circleofsphere/blob/master/tikz-3dplot-circleofsphere.pdf The command to draw is

**\tdplotCsDrawCircle[style]{r}{alpha}{beta}{epsilon}**

With *Maple*, I can find the coordinates of center and radius of circle. I tried

restart;
with(geom3d):
a := 3:
b := 4:
h := 5:
point(A, 0, 0, 0):
point(B, a, 0, 0):
point(C, a, b, 0):
point(DD, 0, b, 0):
point(S, 0, 0, h):
sphere(s, [A, B, C, S], 'centername' = m); detail(s); plane(p, [S, A, B], [x, y, z]); coordinates(projection(H, m, p));
R := distance(H, S)

But, I can't to find the angles alpha, beta, epsilon to draw this circle. How can I find the angles alpha, beta, epsilon?

Hi

I am woking on a pharmo model for a freind, and it includes a variable called depot that needs to jump up by 150 every 24 hours.

currently I have written it as:

clearly thats wrong though, as the +150 s don't make it jump up by 150 because of the small step size.

(at t=0, it adds 150*a small step size, at 24 it looks like it adds 150* a vastly smaller step size, what I want would be much closer to a series of pulses each decaying to almost 0 and then getting boosted to just over 150)

My intuition is that i need to use the dirac delta function but in such a way that its integral adds 150 instantaneoulsy every 24 hours. I have no idea how to do that!

Lindas_signal_transduction_model_2.mw

[Edit:

I've just realised that this ode has an obvious solution, so you can trivially make a function that adds 150 every 24 hours and exponentially decays in between. However there are other models that hopefully i'll being doing similar work on, that don't have nice solutions]

Hello

When i export an animation as a gif the dimensions are (by default it seems) 400x400 pixels (w x h).

But my slide show requires a dimension of 1920 x 1080 pixels.

How to I tell maple to export a gif of predefined dimensions?

I can manually adjust the dimensions of the animation by grabbing a corner and pulling it right and down and then export it, but its hit and miss.

Here is an example animation written by Kitonum

**restart;**

with(DEtools):

rho := 0.1:

w0 := 2:

sys := a->[diff(x(t),t) = y(t),diff(y(t),t) = -2*rho*y(t) - w0^2*(x(t)+a)];

P:=a->DEplot(sys(a), [x(t),y(t)], t = 0 .. 20-2*a, x=-2..2, y=-1.9..1.7, [[x(0) = cos(a)-a, y(0) = sin(a)]], scene = [x(t),y(t)], linecolor=blue, numpoints=1000):

plots:-animate(plots:-display,['P'(a), size=[600,300]], a=-0.7..1.4, frames=90);