Behaviour of an expression

  • Thread starter Akibarika
  • Start date
I have an expression with piecewise functions. the code looks like:

Code:
function a()
  %some constants here

    f = 0:0.001:20;
    r1 = 0.05;
    p = something-f.*(something/something);
    for i=1:100
        r1= R(p);
    end
    for i=1:100
        r1 = R(P);
        y1(k,:) = r1;
    end
    y1=sort(y1)
    plot(f,y1,'k.','MarkerSize',1)
    xlabel('f')
    ylabel('r1');
    set(gca,'xlim',[0 20]);

    %piecewise functions here
    function r = R(P)
        r = NaN(size(P));
        r(P<=0) = sqrt((somthing)*(1-P(P<=0)/something).^-2);
        r(P>0) = sqrt((somthing)-(somthing)*(1-P(P>0)/somthing).^-5);
     end

end
My friend said the behaviour will be like the logistic map. but after printing, I found it just looks like a curve.

Did I make any mistakes in the code? Please help me

Kind Regards
 

Want to reply to this thread?

"Behaviour of an expression" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top