Post Reply 
[HP41] Lambda Modular function; question
01-07-2023, 05:38 PM
Post: #3
RE: [HP41] Lambda Modular function; question
Thanks. For comparison in python.

Code:
import math as math
from mpmath import *
import matplotlib.pyplot as plt
import numpy as np
#
mp.dps = 25
mp.pretty = True
#
# Knowledge
# https://mpmath.org/doc/current/functions/elliptic.html
# https://mpmath.org/doc/current/functions/hypergeometric.html
# green curve = https://en.wikipedia.org/wiki/Modular_lambda_function#/media/File:Lambda_function.svg
# https://en.wikipedia.org/wiki/Modular_lambda_function
#
def func_fromk(p_in): 
# because p_in must be a number and not an array from np..
    return kfrom(tau=p_in*j)
#
N = 50
Wide = 3.
X = np.arange(0.,Wide,Wide/N)
Y1 = np.zeros(N)
Y2 = np.zeros(N)
#
# Y1 equal this? https://www.desmos.com/calculator/00bdl5omnf?lang=de
#
for i in range(N):
    Y1[i]=(1-((np.abs(func_fromk((Wide/N)*i)))**2))*((np.exp(1))**(1/(np.exp(1))))
    Y2[i]=(np.abs(func_fromk((Wide/N)*i)))**2
#
plt.plot(X,Y1,'r-')
plt.plot(X,Y2,'g-')
#
plt.xlabel('X')
plt.ylabel('.. of X*j (green) and (1-(..of (X*j)))*(e**(1/e)))')
plt.title('lambda of ..')
plt.grid()

# https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py
Steps=0.2
Xticks = np.arange(0, Wide, Steps)
plt.xticks(Xticks)
Yticks = np.arange(0, 1.8, Steps)
plt.yticks(Yticks)
plt.show()

HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [HP41] Lambda Modular function; question - floppy - 01-07-2023 05:38 PM



User(s) browsing this thread: 1 Guest(s)