casperyc

957 Reputation

10 Badges

15 years, 311 days
University of Kent
Dr

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are questions asked by casperyc

I read this, but there was nothing on how to write a help associated with it.

Does anyone know where I can find it?

 

Many thanks,

 

casperyc

 

``

restart:

 

C=2;

C = 2

(1)

w[2]*s[1]+w[1]*s[2];

s[1]*w[2]+s[2]*w[1]

(2)

C=3;

C = 3

(3)

(w[3]*s[2]+w[2]*s[3])*s[1];

(s[2]*w[3]+s[3]*w[2])*s[1]

(4)

C=4;

C = 4

(5)

((w[4]*s[3]+w[3]*s[4])*s[2]+w[2]*s[3]*s[4] )*s[1];

((s[3]*w[4]+s[4]*w[3])*s[2]+w[2]*s[3]*s[4])*s[1]

(6)

C=5;

C = 5

(7)

(((w[5]*s[4]+w[4]*s[5])*s[3]+w[3]*s[4]*s[5] )*s[2]+w[2]*s[3]*s[4]*s[5] )*s[1];

(((s[4]*w[5]+s[5]*w[4])*s[3]+w[3]*s[4]*s[5])*s[2]+w[2]*s[3]*s[4]*s[5])*s[1]

(8)

C=6;

C = 6

(9)

((((w[6]*s[5]+s[6]*w[5])*s[4]+w[4]*s[5]*s[6])*s[3]+w[3]*s[4]*s[5]*s[6])*s[2]+w[2]*s[3]*s[4]*s[5]*s[6])*s[1];

((((s[5]*w[6]+s[6]*w[5])*s[4]+s[5]*s[6]*w[4])*s[3]+s[4]*s[5]*s[6]*w[3])*s[2]+s[3]*s[4]*s[5]*s[6]*w[2])*s[1]

(10)

 

``


Download pattern.mw

 

This probably isnt too difficult to write a procedure to generate the expression, given C=2,3,4,5,...

But I may be thinking too much and stuck...

 

Also, I am thinking that if it is possible to use something like a "fibonacci sequence", in the famouse example here, which uses the in a procedure. Probably, we dont need to use this.

 

Thanks,

 

casper

 

Hi,

 

I am having trouble solving the PDE. Can anyone shine some light?


``

sys:=-(1/2)*(diff(f(phi, s[1], s[2], w[1]), s[1]))*(s[1]-s[2])*s[1]/(s[2]*w[1])+(1/2)*(diff(f(phi, s[1], s[2], w[1]), s[2]))*(s[1]-s[2])*s[2]/((-1+w[1])*s[1])+diff(f(phi, s[1], s[2], w[1]), w[1]) = 0;

-(1/2)*(diff(f(phi, s[1], s[2], w[1]), s[1]))*(s[1]-s[2])*s[1]/(s[2]*w[1])+(1/2)*(diff(f(phi, s[1], s[2], w[1]), s[2]))*(s[1]-s[2])*s[2]/((-1+w[1])*s[1])+diff(f(phi, s[1], s[2], w[1]), w[1]) = 0

(1)

pdsolve(sys);

 

``


Download 1234.mw

Say the values of i^2 are being calculated from within a procedure,

 

mytest:=proc(n)

local ans;

    ans:=0;

    for i from 1 to n do

   ans:=ans+i^2;

   end do;

   return ans;

end proc;

 

Could I have a (time series) plot of i^2, while the values are being calculated?

The above is a toy example. What I want to archieve is to track a particular intermidiate values while the procedure is running.

 

Thanks,

 

casper

Hi,

I read this thread, but it didnt really help.

test.mw (i noticed an error in the expression pj, now fixed!)

See this file above.

The function needs to be maximized is "loglik", with constraints,

f0>0, sigma>0 and mu is FREE. Only three variables.

 

Using some calculus and by changing variables, I was able to use Gauss–Hermite quadrature, and do some approximation, to get the values:

f0=105.9535

mu=-2.1587

sigma=3.5156

 

I am wondering if Maple can do this straight away. By that, I mean, without doing much further,  how could I get the values? (most efficiently and quickly)

 

Thanks,

 

casper

 

http://www.mapleprimes.com/questions/122813-Is-It-Possible-To-Optimize-This-Kind-Of-Integral

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