Recent content by Avan

  1. A

    How can I find the analytical solution for the system?

    The result that I got is : exp( (cos(omega*t) * (-N0/omega)) / x(t) = (N0 / k) * ( integral (exp( (cos(omega*t)) * (-N0/omega) ) ) ) dt So I do not know how to find the integral when typically there is no specific solution for the integral of the Exponential function.
  2. A

    How can I find the analytical solution for the system?

    Homework Statement dx(t)/dt = N0*sin(omega*t) * x(t) - ( N0*x^2 / k ) Omega,N0 and k are positive . Homework EquationsThe Attempt at a Solution I tried to solve it using the Bernoulli equations but I could not get the last result.
  3. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    Many thanks for your replay. About the analytical solution,Could I use the Bernoulli method to solve it? Secondly, If I want to deal with this system even if there is a singularity in some points, How could I continue running my code please? Regards
  4. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    Sorry, Because I have two variables ,, Could you Explain to me more or help me to do that please? You said as t and p change so should I check at both change together or change one and fixing the other.
  5. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    Many thanks but Unfortunately, Your suggestion does not work and I previously tried it. If I integrate for t = [0 : 0.01 : 10] I don't have any problem but the problem begins at t=1.057848e+01 ,, and as you know taking the time until 10 is very limited so I need to plot my system to study it's...
  6. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    What I am trying to do is :: I have the Logistic system ,, I am trying to add an oscillatory term to it and changing the angular frequency and the growth rate just to see the effect of this on my system. The above code is to solve the system numerically and use the results for more calculations...
  7. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    Thank you. I know about the numerical solution and even I tried to change a tolerances and the ode solver and changing my parameters' values but I still get the warning message! I put my question here because sometimes it is useful to get experience from other people. I tried to do the...
  8. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    [MATLAB] The cod is: function RunLogOscilNumeric3 k =10; p0 =0.001; t = [0:0.01:10000 ]; omega = 1; N0 = 1; options =[ 'AbsTol',1e-3,'RelTol',1e-6] % options =odeset(...
  9. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    2- After I added your suggestion to my code to avoid a singularity when I am integration from 0.01 to 4, I got different plot as follow : function RunlogOscilnumerfishfixedn0omega omega=1; N0=1; k = 10; A = 1; p0 = 0.1; tspan=(0:0.01:4); [t,p] =...
  10. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    Many thanks for your help. The second suggestion is working but I am getting something different. I will explain what I mean as follow, So what do you think why there is a different please? 1- For my original code when I tried to plot (T,I) where T is from 0.01 to 3 and without a singularity...
  11. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    Do you mean using like this block with my code? v = ( (N0.^2).*((sin(omega.*t)).^4).*((P(t)-(P(t).^2./k)).^2 )); a = ones(401,1); if a(abs(v)<0.0001) == 0 The problem is finding I4 .
  12. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    Now, I have two MATLAB file as follow: The first one is : function dpdt = logisticOscilnumerical(t,p,omega,k,N0) dpdt = N0*sin(omega*t)*p*(1-p/k); end The second one is : function y = probdenfun(t,p,A,N0,omega,k) v = ( (N0.^2).*((sin(omega.*t)).^4).*((p-p.^2./k).^2 )) if (v < 0.0001) y = 0...
  13. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    I am sorry for that and many thanks for your help. What I mean by it does not work that I still received a warning message about singularity at 3.14 after including if statement. But if it is work with you so could you show me how you used it please?
  14. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    Now it is correct please? function y = probdenfun(t,p,A,N0,omega,k) v = ( (N0.^2).*((sin(omega.*t)).^4).*((p-p.^2./k).^2 )) if (v < 1e-17) y = 0 else y = ( ( A.*( ( N0.* (sin(omega.*t)).^2 .*(1-(2.*p./k))+(omega.*cos(omega.*t) ) ).^2 ) ./(...