#================== # AUTO Demo of trc #================== # this is a demo for the transcritical bifurcation # using the normal form: x'=x*(x-mu); # Load the files trc.f90 and c.trc into the AUTO trc = load('trc') # Run and store the result in the Python variable 'res0' res0 = run(trc) # the results are: # BR =1 (branch), single branch for now. # PT =1..19 (points) of type EP (end points) # and the values of mu, x and the L2-NORM of x. ################# # Run backwards in terms of the parameter 'mu', # and append to results to 'res1' res0 = res0 + run(trc,DS='-') # now we can see that we have a branch point - BP # at mu~=0 # Relabel solutions res0 = relabel(res0) # Save to b.res0, s.res0, and d.res0 save(res0,'res0') # Plot bifurcation diagram (partial - only on the origin) p = plot(res0) # change the y coordinate: p.config(bifurcation_y=['x']) p.config(stability=1) # Set the new start label to the first BP label # in b.res1 and s.res1 # the point but different load for each branch # ISW=1 defualt branch bp0 = load(res0('BP1'), ISW=1) #ISW=-1 switch branch bp1 = load(res0('BP1'), ISW=-1) # recomput (i.e., delete the previous as we are not appending) the zero branch from the bifurcation point # both forward and backward, save in the variable res1 res1 = run(bp0) res1 = res1 + run(bp0,DS='-') # Continue from this label in the other branch, # save in the variable res1 res2 = run(bp1) res2 = res2 + run(bp1,DS='-') # create variable res, so in the plot, # both branches will appear. res = res1 +res2 res = relabel(res) # save to b.trc, s.trc, and d.trc save(res,'trc') # Plot the bifurcation diagram (both branches) p = plot(res) p.config(bifurcation_y=['x']) p.config(stability=1) #clean the directory clean() wait()