longrob

Mr. Robert Long

1409 Reputation

18 Badges

15 years, 184 days
Leeds, United Kingdom

Social Networks and Content at Maplesoft.com

Business Consultant Data Scientist Statistician

MaplePrimes Activity


These are answers submitted by longrob

I'm aware of some people using windows 7 and maple 11. Are you on 32 or 64 bit windows7 ? Are you an MS325 student ?
restart: z:=NULL:L:=[1,2,4,6,7]:b:=nops(L): for cnt from 0 to ceil(b/2) do if cnt=floor(b/2)and type(b,even) then break; end if: z:=z,L[1+cnt]: if cnt=floor(b/2)then break; end if: z:=z,L[b-cnt]: end do: z;
Thank you both ! And without further ado, odeplot is relegated to the 2nd division of useful tools ! Doug, that's really fantastic. It's not what I originally was looking for. It's significantly better ! I'll really have to do some fishing around with DEplot now. I should have paid more attention when you told me to favour it over odeplot a couple of weeks ago ! I know there's a 3D version of DEplot so that's bound to have some interesting possibilities too with these and similar systems (I'm going to start look at Lorenz's system and many others soon) . :) Just one question for now, the animations work great, but I get several of these messages after the plots are rendered: Invalid DAG option structure detected. Ignoring. Any idea what that's about ?
If I were you I'd start by just writing an algorithm in psuedo code. One idea is to just use a "normal" sort such as a bubble sort or whatever. Once you have the sorted list, then use a loop with 2 counters one stepping forward, the other stepping backwards, both towards the middle, and creating your new list in interleaved sequence....may not be the most efficient way, but should be easy !
here's my code: restart: pp_1:=proc(EQ,ic,T,N) # EQ should be a set {} of 2 DEs, ic a list [] of ics local eq,ic1,p,tt: ic1:=x(0)=ic[1],y(0)=ic[2]: eq:=EQ[1],EQ[2]: p:=dsolve({eq,ic1},{x(t),y(t)},type=numeric): plots:-odeplot(p,[x(t),y(t)],t=0..T,numpoints=N); end proc: eq:=diff(x(t),t)=-x(t)*(1-x(t)^2-y(t)^2)^2-y(t),diff(y(t),t)=-y(t)*(1-x(t)^2-y(t)^2)^2+x(t): p1:=pp_1({eq},[0.68,0.68],20,200): p2:=pp_1({eq},[-0.68,-0.68],20,200): p3:=pp_1({eq},[1.5,1.5],10,200): p4:=pp_1({eq},[-1.5,1.5],10,200): p5:=pp_1({eq},[1.5,-1.5],10,200): p6:=pp_1({eq},[-1.5,-1.5],10,1200): P:=plots:-display({p1,p2,p3,p4,p5,p6}): eq:=diff(x(t),t)=x(t)*(1-x(t)^2-y(t)^2)-y(t),diff(y(t),t)=y(t)*(1-x(t)^2-y(t)^2)+x(t): p1:=pp_1({eq},[0.01,0.01],20,200): p2:=pp_1({eq},[-0.01,-0.01],20,200): p3:=pp_1({eq},[1.5,1.5],5,200): p4:=pp_1({eq},[-1.5,1.5],5,200): p5:=pp_1({eq},[1.5,-1.5],5,200): p6:=pp_1({eq},[-1.5,-1.5],5,200): Q:=plots:-display({p1,p2,p3,p4,p5,p6}): plots:-display(P);plots:-display(Q); As you can see, the two plots look quite similar, but in fact they show completely different behaviour, with the first showing a stable spiral at the origin and a half-stable limit cycle, and the second an unstable spiral at the origin with a stable limit cycle. I should like to have arrows on the plots to indicate the direction of phase flow.
?alias "Parameters and local variables are not affected by aliases."
My code above was indented when I posted it, and the indents are still there when I edit it; only they disappear when displayed after posting. What's up with that ?
This should implement your algorithm: restart; w:= 4: w1_lst:=NULL: for k from 1 to 10 do for h from 1 to 20 do for a from 4 to 15 do w1:= a + h: #h, not hk w1_lst:=w1_lst,w1: if w1< w then w:=w1: else w:= w: #redundant end if: end do: end do: end do; w1_lst; But your algorithm is wrong in at least two regards: first you used h as a loop counter but hk inside the loop. Second, the "else" statement is redundant, so maybe you wanted to do something different or maybe you just don't need it.
The MGF is > M:=t->(exp(t*b)-exp(t*a))/(t*(b-a)): so > M1:=limit(diff(M(t),t),t=0): > M2:=limit(diff(M(t),t$2),t=0): and so > V:=factor(simplify(M2-M1^2)): and > SD:= simplify(sqrt(V)) assuming b>a; -(1/6)*sqrt(3)*(-b+a) which is the same as (b-a)/sqrt(12) but I can't figure out how to make Maple display it that way ;) Hope it helps. Or maybe you want to derive the MGF ?
I'm not exactly sure what you want to do, but you can combine graphs like this: plots[display]({p1,p2,p3});
Does this work for you ? eval(temp,r=a);
[BTW, SCR submitted......] So, I was wondering how to make Maple rearrange ss1 into the format of ss2. I've replaced omega[0] with omega_0 to avoid the bug. ss1:=-F[0]*(-sin(omega*t)*omega_0^2+sqrt(omega^2*(1+omega^2))*cos(omega*t-arctan(omega^2, omega)))/(omega^2+omega_0^4-2*omega_0^2*omega^2+omega^4); ss2:=-cos(omega*t-arctan(-omega_0^2+omega^2, omega))*F[0]/sqrt(omega^2+omega_0^4-2*omega_0^2*omega^2+omega^4);
Hi Robert, thank you very much. So this problem is with using the subscript [0] ? Have you encountered this before ? Is it generally a good idea to avoid using subscripts like this ? It seems quite normal for me (when working by hand). It's a bit worrying. I'll submit an SCR now.
I guess this must be a trivial mistake, but I can't seem to see the forest for the trees now ! I'm expecting this restart: deq1:=diff(x(t),t$2)+lambda*diff(x(t),t)+omega[0]^2*x(t)=F[0]*sin(omega*t): deq1:=eval(%,{lambda=1}): sol1:=dsolve(deq1,x(t)): assign(sol1): ss1:=op(3,x(t)): convert(ss1,phaseamp,t): ss1:=simplify(%); .......to produce the same result as this: x(t):='x(t)': deq2:=diff(x(t),t$2)+lambda*diff(x(t),t)+omega[0]^2*x(t)=F[0]*sin(omega*t): sol2:=dsolve(deq2,x(t)): assign(sol2): ss2:=op(3,x(t)): ss2:=convert(ss2,phaseamp,t): ss2:=simplify(%): ss2:=eval(ss2,lambda=1); .....but it doesn't. ss2 is the result I expect/want and I wondered if ss1 was just a different representation. So to check, I tried this: simplify(ss2-ss1); which produced an odd error which tells me I've made some simple error but I can't seem to find it.
That's a great help !
First 6 7 8 9 Page 8 of 9