Polpulation balance 3D plot

Dear all,

I tried unsuccessfully to plot  (in 3D) in this solution using:
imax=10, mu=5, sigma=1.5
Could any one give me an help ?

Here is the maple code

imax:=10;

mu:=5; sigma:=1.5;

y[0] := x -> exp(-(x-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi));   
  des:= [seq(diff(y[i](t), t) = y[i-1](t)*(sum(2^(j-i+1)*
    beta[i-1, j]*y[j](t), j = 1 .. i-1))+(1/2)*i*beta[i-1, i-1]
    *y[i-1](t)^2-y[i](t)*(sum(2^(j-i)*beta[i, j]*y[j](t),
    j = 1 .. i-1))-y[i](t)*(sum(beta[i, j]*y[j](t),
    j = 1 .. imax)), i = 1 .. imax)];


Could any one give me an help ?

 

Best regards !

alec's picture

Initial conditions

Do you have some initial conditions?

Such as values y[1](0), y[2](0),...

What is beta?

Alec

Initial condition

Dear Alec

Initial conditions are here

imax:=10;
mu:=5; sigma:=1.5;

for x=1:imax

y[0](x) := x -> exp(-(x-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi));  

end

Beta is a function 

beta(l+m)=(l+m)^3

SEBGO

alec's picture

It's not initial conditions for the differential equations

It's not initial conditions for the differential equations.

Alec

Initial condition

this is the initial conditions

ics := {Seq(y(j)[0] = exp(-(j-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi)), j = 1 .. imax)}

Sebgo

Dear all, I tried

Dear all,

I tried unsuccessfully to plot  (in 3D) in this solution using:
imax=10, mu=5, sigma=1.5
I failed to write the initial conditions

Here is the maple code

Initial conditions

imax:=10;
mu:=5; sigma:=1.5;

y[0] := x -> exp(-(x-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi));   

differential equation


  des:= [seq(diff(y[i](t), t) = y[i-1](t)*(sum(2^(j-i+1)*
    beta[i-1, j]*y[j](t), j = 1 .. i-1))+(1/2)*i*beta[i-1, i-1]
    *y[i-1](t)^2-y[i](t)*(sum(2^(j-i)*beta[i, j]*y[j](t),
    j = 1 .. i-1))-y[i](t)*(sum(beta[i, j]*y[j](t),
    j = 1 .. imax)), i = 1 .. imax)];


Could any one give me an help ?

epostma's picture

plots:-odeplot

Hi Sebgo,

What you'll want to do is first make sure you get dsolve to find a numerical solution for you. In order to achieve that,  you'll need to pass it the differential equations and initial conditions. Note also that there was a small mistake in the initial conditions that you posted: you had

ics := {Seq(y(j)[0] = exp(-(j-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi)), j = 1 .. imax)}

where you probably want

ics := {seq(y[j](0) = exp(-(j-mu)^2/(2*sigma^2))/(sigma*sqrt(2*Pi)), j = 1 .. imax)}:

(note the seq being lowercase and the brackets for y[j](0)). If you have des defined as in your original posting and ics as in the line above this one, and furthermore, beta[i,j] has a numerical value for all sensible i and j, then you can call

dsnproc := dsolve([des[], ics[]], numeric):
odeplots := seq(plots:-odeplot(dsnproc, [t, y[i](t)], color='COLOR'('HUE', i * (1/2 + 1/2*sqrt(5)))), i=1..10):
plots:-display(odeplots);

Hope this helps,

Erik.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}