Sequences in Orlicz spaces

Binder - link to interactive notebooks session.

import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm  # for progress bar

import numerical_function_spaces.orlicz_spaces as osm
def Orlicz_function(u):
    # return np.where(u <= 1, u ** 2, np.where(u <= 2, 2 * u - 1, u ** 3 * 3 / 8))
    # or
    Phi = np.zeros(len(u))
    for i in range(len(u)):
        if u[i] <= 1:
            Phi[i] = u[i] ** 2
        elif u[i] <= 2:
            Phi[i] = 2 * u[i] - 1
        else:
            Phi[i] = 3 / 8 * u[i] ** 3
    return Phi
osm.plot_Phi(Orlicz_function, u_max=3, du=0.1)
_images/0218b0871380fad3efcfaf6c858e706cdfcc0171c1e743fdd646d2961c2022b4.png

Define sequence of characteristic functions

\[\begin{equation*} x_n(t) = \chi_{\left[0,c_n\right)}(t) \end{equation*}\]

for \(c_n = \frac{n}{n_{max}}\cdot{t_{max}}\)

def x_n(n, n_max, t_max):
    x = np.array([[1], [n / n_max * t_max]])
    return x
# execution took around 1 minutes
t_max = 2
n_max = 100
x_n_range = range(1, n_max, 1)  # used in calculations 

norms_1 = []
norms_2 = []
norms_inf = []

for n in tqdm(x_n_range, disable=False):  # set disable=False for progress bar
    x = x_n(n, n_max, t_max)
    norms_1.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=1))
    norms_2.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=2))
    norms_inf.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=np.inf))
100%|██████████| 99/99 [01:06<00:00,  1.49it/s]
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], '.-.', label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/8900310731a91b75d37664778003a7720c42ca0e8196748caa32be6284ab7515.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.", label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
plt.legend();
_images/966a64b54d674f4dab7a84eec25920b150d8e09aa87c55400b34142cc4c26e9d.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--",
        label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.",
        label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1);
ax.legend();
_images/30251a491a9f2d20d066b673bd3d1c69d3e2d5bf71e549438ef233a215f32f16.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/5b2a8f08e0f8f8dc0b0b1c8474c21f0ba8e9807669a7dcbb5e8e322e5a6938e8.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k_1^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], ".-.", label='$k_1^{**}(x_n)$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--", label='$k_2^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.", label='$k_2^{**}(x_n)$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k_{{\\infty}}^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.",
        label='$k_{{\\infty}}^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/cf2ea9da611d53b6c965133f575a5bbe623a6640347a5a38ab8693265d3d95ee.png

On the first plot we may see something interesting for \(x_{50} = \chi_{[0,1)}(t)\)

x = x_n(50, n_max=100, t_max=2)
print(x)
[[1.]
 [1.]]
osm.p_Amemiya_norm_with_stars(Orlicz_function, x=x, p_norm=1)
(np.float64(1.9999999999999998),
 np.float64(0.9998683723630417),
 np.float64(1.9998172564912515))
osm.plot_kappa(Orlicz_function, x=x, p_norm=1, k_min=0.5, k_max=2.5)
_images/45b86cf9874e08302cc537d9741c788d001f48d69b5272304b719b8cbee37ce0.png
osm.plot_alpha(Orlicz_function, x=x, p_norm=1, du=0.01, u_max=10,
               dk=0.01, k_min=0.5, k_max=2.5)
_images/35531db4d3740ccbecf4bec883b8d686e360cb701002ebd263725da89cfb80c1.png

Define another Orlicz function

def Orlicz_function(u):
    Phi = np.zeros(len(u))
    for i in range(len(u)):
        n = -1
        while True:
            if u[i] > n and u[i] <= n + 1:  # below two conjugated functions?
                Phi[i] = (n + 1) * u[i] - (n + 1) * n / 2
                # Phi[i] = n * u[i] - (n) * (n + 1) / 2
                break
            n = n + 1
    return Phi
osm.plot_Phi(Orlicz_function, u_max=5, du=0.1)
_images/c3f9f613fb2bb766a83bfa289d7f5dd3cb51a76635864c514411c24df295c69d.png

and the same \(x_n\) sequence

# execution took around 1 minutes
t_max = 2
n_max = 100
x_n_range = range(1, n_max, 1)  # used in calculations 

norms_1 = []
norms_2 = []
norms_inf = []

for n in tqdm(x_n_range, disable=False):  # set disable=False for progress bar
    x = x_n(n, n_max, t_max)
    norms_1.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=1))
    norms_2.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=2))
    norms_inf.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=np.inf))
100%|██████████| 99/99 [01:19<00:00,  1.24it/s]
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], '.-.', label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/291f42ce0a761d1111f16c0f17dcd4b51f94047d8152d6cbd4b1d9fa6b5aa5e6.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.", label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
plt.legend();
_images/5496191761c0d046e13c98938e56c04dc95d62f9deb2fae921eff515f7caf432.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--",
        label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.",
        label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1);
ax.legend();
_images/924f1bd2255f3059e7f9db67daa450415b4d7e719a7d30f9f8b05ff5ff66c230.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/65a0203987856321372322709cc147f368b6833a240384ad5861635dfadaf802.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k_1^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], ".-.", label='$k_1^{**}(x_n)$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--", label='$k_2^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.", label='$k_2^{**}(x_n)$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k_{{\\infty}}^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.",
        label='$k_{{\\infty}}^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(f'$x_n(t) = \\chi_{{\\left[0,c_n\\right)}}(t) = \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/b852a441cf35b4abc1a86d6e649413ba07852542f0424a764528501c2413b82d.png

Define another sequence

\[\begin{equation*} x_n(t) = \cos(t) \cdot \chi_{\left[0,c_n\right)}(t)$ \end{equation*}\]

for \(c_n = \frac{n}{n_{max}}\cdot{t_{max}}\)

# execution took around 80 minutes
t_max = 2 * np.pi  # for domain of t
len_t = 1000

norms_1 = []
norms_2 = []
norms_inf = []

n_min, n_max = 1, 100

x = np.zeros(shape=(2, len_t))
x[1, :] = t_max / len_t

for n in tqdm(range(n_min, n_max), disable=False):
    for i in range(len_t):
        arg = t_max / len_t * i
        if arg < t_max * n / n_max:
            x[0, i] = np.cos(arg)

    norms_1.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=1))
    norms_2.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=2))
    norms_inf.append(osm.p_Amemiya_norm_with_stars(Orlicz_function, x, p_norm=np.inf))
100%|██████████| 99/99 [1:16:48<00:00, 46.55s/it]
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], '.-.', label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(
    f'$x_n(t) = \\cos(t) \\cdot \\chi_{{\\left[0,c_n\\right)}}(t) = \cos(t) \\cdot \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/90ac2c8332222e0d2ee677240ec81e45944edcd1b359b5bf0c54fd803bff8b1c.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.", label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(
    f'$x_n(t) = \cos(t) \\cdot \\chi_{{\\left[0,c_n\\right)}}(t) = \cos(t) \\cdot \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
plt.legend();
_images/b8507777d8359cf504069be9278239729fd091074e3a20de1808184f20ad713b.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--",
        label='$k^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.",
        label='$k^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(
    f'$x_n(t) = \cos(t) \\cdot \\chi_{{\\left[0,c_n\\right)}}(t) = \cos(t) \\cdot \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1);
ax.legend();
_images/0faf9a80ad0eb6f69034d9031336ad96b4d258326e9eeb73b915825b9ceb57ea.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[0] for norms_1 in norms_1], ".-", label='$||x_n||_{p=1}$')
ax.plot(x_n_range, [norms_2[0] for norms_2 in norms_2], ".-", label='$||x_n||_{p=2}$')
ax.plot(x_n_range, [norms_inf[0] for norms_inf in norms_inf], ".-", label='$||x_n||_{p=\infty}$')
ax.set_xlabel("$n$", x=1)
plt.title(
    f'$x_n(t) = \cos(t) \\cdot \\chi_{{\\left[0,c_n\\right)}}(t) = \cos(t) \\cdot \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/6926f0e2ce09b2323df15a4562cde0e9eff007c8e8de3f98fee0dde81add1c67.png
fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(x_n_range, [norms_1[1] for norms_1 in norms_1], ".--", label='$k_1^*(x_n)$')
ax.plot(x_n_range, [norms_1[2] for norms_1 in norms_1], ".-.", label='$k_1^{**}(x_n)$')
ax.plot(x_n_range, [norms_2[1] for norms_2 in norms_2], ".--", label='$k_2^*(x_n)$')
ax.plot(x_n_range, [norms_2[2] for norms_2 in norms_2], ".-.", label='$k_2^{**}(x_n)$')
ax.plot(x_n_range, [norms_inf[1] for norms_inf in norms_inf], ".--", label='$k_{{\\infty}}^*(x_n)$')
ax.plot(x_n_range, [norms_inf[2] for norms_inf in norms_inf], ".-.",
        label='$k_{{\\infty}}^{**}(x_n)$')
ax.set_xlabel("$n$", x=1)
plt.title(
    f'$x_n(t) = \cos(t) \\cdot \\chi_{{\\left[0,c_n\\right)}}(t) = \cos(t) \\cdot \\chi_{{[0,\\frac{{n}}{{{n_max}}}\cdot{t_max})}}(t)$')
ax1 = ax.secondary_xaxis('top', functions=(lambda i: i * t_max / n_max, lambda i: i))  # po co ta druga lambda funkcja?
ax1.set_xlabel('$c_n$', x=1)
ax.legend();
_images/a42cda5d339a9cf9fa5be6b0fd08297af13cd3ffe983b8b4a57eb05a5eb8358f.png