<jupyter_start><jupyter_text>DEMSLV10  Illustrates linear complementarity problem<jupyter_code>import numpy as np
import matplotlib.pyplot as plt


from compecon.demos import demo

plt.style.use('seaborn')
def basicsubplot(i, title, yvals,solution):
    ax = demo.subplot(1,3,i,title,'','',[-0.05,1.05],[-2,2])
    ax.plot([0,1],[0,0],'k-',linewidth=1.5)
    ax.plot([0,0],[-2,2],'k:',linewidth=2.5)
    ax.plot([1,1],[-2,2],'k:',linewidth=2.5)
    ax.plot([0, 1],yvals)
    demo.bullet(solution[0], solution[1],'r.',18)
    plt.xticks([0,1],['a','b'])
    plt.yticks([-2,0,2],['','0',''])<jupyter_output><empty_output><jupyter_text>Possible Solutions to Complementarity Problem, $f$ Strictly Decreasing<jupyter_code>figs = []
figs.append(plt.figure(figsize=[9,4]))
basicsubplot(1,'f(a) > f(b) > 0', [1.5, 0.5], [1.0,0.5])
basicsubplot(2,'f(a) > 0 > f(b)', [0.5, -0.5], [0.5,0.0])
basicsubplot(3,'0 > f(a) > f(b)', [-0.5, -1.5],[0.0,-0.5])
plt.show()<jupyter_output><empty_output><jupyter_text>Possible Solutions to Complementarity Problem, $f$ Strictly Increasing<jupyter_code>figs.append(plt.figure(figsize=[9,4]))
basicsubplot(1,'f(a) < f(b) < 0', [-1.5, -0.5], [0.0,-1.5])
basicsubplot(2,'f(a) < 0 < f(b)', [-0.5, 0.5], [0.5,0.0])
demo.bullet(0.0,-0.5,'r.',18)
demo.bullet(1.0,0.5,'r.',18)
basicsubplot(3,'0 < f(a) < f(b)', [0.5, 1.5],[1.0,1.5])
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2697841726618705, 'fraction_numerical': 0.08489208633093526, 'mean_word_length': 5.719806763285024, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '70239', 'license': 'MIT', 'n_tokens_mistral': 698, 'n_tokens_neox': 668, 'n_words': 85, 'path': 'notebooks/slv/10 Illustrates linear complementarity problem.ipynb', 'repo_name': 'snowdj/CompEcon-python', 'size': '1390'}