Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# -*- coding: utf-8 -*-
"""Robust_cost.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/19tBkhMYg1vmHQ7ISeUhT9-qZzyWPus5M
**Plotting German Macclure Robust cost function Vs residues**
"""
import numpy as np
import matplotlib.pyplot as plt
r = np.linspace(-5, 5, 50)
barc2=1
mu=2*25/1
i=1
m=[]
while mu>1:
m.append(mu)
mu=mu/1.4
i=i+1
m=np.array(m)
print(m)
#German McClure robust surrogate function
def rho(mu, r):
return (mu*barc2**2 * r**2) / (mu*barc2**2 + r**2)
for l in range(len(m)):
plt.plot(r, rho((m[l]),r))
# Add labels and legend
plt.xlabel('r')
plt.ylabel(r'$\rho_{\mu}(r)$')
plt.legend()
# Show plot
plt.show()