FAIRmat-NFDI / AreaA-data_modeling_and_schemas

The ELN custom schemas from synthesis experiments
https://fairmat-nfdi.github.io/AreaA-Documentation/
10 stars 6 forks source link

IKZ Crystal growth material database #79

Open budschi opened 8 months ago

budschi commented 8 months ago

in this issue, we list the tasks to develop the IKZ Crystal growth material database with @WolframMiller The custom yaml schema can be found here

After our discussion on Nov. 21st we decided to create an NOMAD app for this use case (see MOF or Solar Cell App in central NOMAD). Here are the next steps:

budschi commented 8 months ago

I had a short discussion on this use case with @JFRudzinski. We will exchange soon on how to populate NOMAD's results section. Thanks to pointing us to the SymPy package which can be used to create that generic function described above:

import sympy as sp
import matplotlib.pyplot as plt
import numpy as np

def plot_expression(expression_str, x_range=(-10, 10), num_points=100):
    # Define the symbol
    x = sp.symbols('x')

    # Convert the expression string to a SymPy expression
    expression = sp.sympify(expression_str)

    # Convert the SymPy expression to a NumPy function
    expression_np = sp.lambdify(x, expression, 'numpy')

    # Generate x values
    x_vals = np.linspace(x_range[0], x_range[1], num_points)

    # Evaluate the expression at each x value
    y_vals = expression_np(x_vals)

    # Plot the expression
    plt.plot(x_vals, y_vals, label=f'{expression_str}')
    plt.title(f'Plot of the expression {expression_str}')
    plt.xlabel('x')
    plt.ylabel(f'{expression_str}')
    plt.legend()
    plt.grid(True)
    plt.show()

# Example usage:
expression_string = "x**3"
plot_expression(expression_string)