Integral problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Integral problems

이태훈
Hi 
I want to intragate the equation dx/dt=-xD + ux (x=biomass D=dillution rate u=growthrate ),and u is replaced by umax*I/(I+km).
But every time I try, I get an error. I tried the “int" and the quad but nothing works. 
The image of the code and the error are attached. 
Please tell me what is wrong. It would mean a lot to me.
(p.s I use octave 4.4.1 app and I don’t have any packages installed due to program setting issues)
Best regards.
Tase hoon Lee


Reply | Threaded
Open this post in threaded view
|

Re: Integral problems

mmuetzel
Am 15. April 2020 um 12:32 Uhr schrieb "이태훈":
> Hi 
> I want to intragate the equation dx/dt=-xD + ux (x=biomass D=dillution rate u=growthrate ),and u is replaced by umax*I/(I+km).
>
> But every time I try, I get an error. I tried the “int" and the quad but nothing works. 
> The image of the code and the error are attached. 
> Please tell me what is wrong. It would mean a lot to me.
> (p.s I use octave 4.4.1 app and I don’t have any packages installed due to program setting issues)

Maybe you want to read section 11 of the manual (Functions and Script) on how to define a function in Octave.
In general, it would be more helpful to attach a file with the code you are executing (or paste it in the mail as text) instead of screenshots.

HTH,
Markus



Reply | Threaded
Open this post in threaded view
|

Re: Integral problems

mmuetzel
Am 15. April 2020 um 13:27 Uhr schrieb "이태훈":

> > 2020. 4. 15. 오후 1:07, Markus Mützel <[hidden email]> 작성:
> >
> > Am 15. April 2020 um 12:32 Uhr schrieb "이태훈":
> >> Hi
> >> I want to intragate the equation dx/dt=-xD + ux (x=biomass D=dillution rate u=growthrate ),and u is replaced by umax*I/(I+km).
> >>
> >> But every time I try, I get an error. I tried the “int" and the quad but nothing works.
> >> The image of the code and the error are attached.
> >> Please tell me what is wrong. It would mean a lot to me.
> >> (p.s I use octave 4.4.1 app and I don’t have any packages installed due to program setting issues)
> >
> > Maybe you want to read section 11 of the manual (Functions and Script) on how to define a function in Octave.
> > In general, it would be more helpful to attach a file with the code you are executing (or paste it in the mail as text) instead of screenshots.
> >
> > HTH,
> > Markus
> >
> Dear .Markus
> Thank you for the reply.
> I actually read it but didn’t help.
> Here are the codes.
> A= (-x.*(D)).+((umax.*((I0.*2.717^(-ka.*x*z))./((I0.*(2.717^(-ka.*x*z))).+km))).*x);
>    D  =1.1;
> �� r  = 0.0984;
> �� ka =3;
> �� z  =10
> �� umax=0.08
> �� km =3
> �� I0 =1
>    a  = 0;
>    b  = 10;
>    
>    func = @A;
>    a    = 0;
>    b    = 3.14;
>    
>    %Number of points
>    N = 10;
>  
>    % Position of the points
>    
>    dx = (b.-a)./(N);
>    x  = [0.5:N .- 0.5].*dx;
>    
>    
>    %Evaluation Function
>    y = A(x);
>    
>    % Numerical Integration
>    I = sum(y).*dx
>    
>    plot(x,y);
>
> If you find any mistakes or better ideas please tell me.
> Best regards
> Tae hoon lee

It looks like you would like "A" to be a function that you want to evaluate at "x". But "A" is not defined as a function.
Please, see the manual on how to define functions in Octave.

In the code snippet you have pasted, there are a few characters that are not printable on my side. Maybe those are also messing up the lexer...

Please also keep the mailing list in CC and use bottom posting if possible.

Markus