def find_derivatives(self):
        print("looking for: δn/δx")
        query = solvers_utils.get_wf_derivative(self.n_function, 1)

        wolfram_query = solvers_utils.get_problem_url(query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.n_partial = solvers_utils.find_wf_res(self.driver, result_section,
                                                   0)
        print("δn/δx =  ", self.n_partial)

        print("looking for: δm/δy")
        query = solvers_utils.get_wf_derivative(self.m_function,
                                                1,
                                                variable='y')

        wolfram_query = solvers_utils.get_problem_url(query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.m_partial = solvers_utils.find_wf_res(self.driver, result_section,
                                                   0)

        print("δm/δy =  ", self.m_partial)
Beispiel #2
0
    def solve_laplace_by_user(self):
        if self.parse_class:
            self.parse_class.apply_property()

            print("what do you want to do?")

            ans = input(
                f"solve the new laplace expression: {self.parse_class.get_new_laplace()} [y/n]: "
            )

            if ans == 'y':
                wolfram_url = get_problem_url(
                    self.parse_class.get_wolfram_query())

                print("Looking for result...")

                self.driver.get(wolfram_url)
                result_section = solvers_utils.get_result_section(self.driver)
                self.new_laplace_sol = solvers_utils.find_wf_res(
                    self.driver, result_section, 1)

                print(f"Found: {self.new_laplace_sol}")
        else:
            print(
                "it look likes we couldn't found a property for this expression..."
            )
Beispiel #3
0
    def simplify_function(self):
        print("simplify function...")

        wolfram_query = solvers_utils.get_problem_url(self.compact_function)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.simplified_compact_function = solvers_utils.find_wf_res(
            self.driver, result_section, 1)
    def compute_norm(self):
        print("looking for || r'(t) ||")
        query = f'Norm[{self.d_param_function}]'

        wolfram_query = solvers_utils.get_problem_url(query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.norm_d_param_function = solvers_utils.find_wf_res(
            self.driver, result_section, 1)
        print("|| r'(t) || =  ", self.norm_d_param_function)
    def compute_dot_product(self):
        print("looking for F(r(t)) * r'(t)")
        query = f'Dot[{self.d_param_function}, {self.replaced_function}]'

        wolfram_query = solvers_utils.get_problem_url(query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.dot_product = solvers_utils.find_wf_res(self.driver,
                                                     result_section, 1)
        print("F(r(t)) * r'(t) =  ", self.dot_product)
    def compute_derivative(self):
        print("looking for r'(t)")
        query = solvers_utils.get_wf_derivative(self.param_function,
                                                1,
                                                variable='t')

        wolfram_query = solvers_utils.get_problem_url(query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.d_param_function = solvers_utils.find_wf_res(
            self.driver, result_section, 0)
        print("r'(t) =  ", self.d_param_function)
Beispiel #7
0
    def compute_convolution_integral(self):

        wolfram_url = get_problem_url(
            self.convolution_integral.replace('τ', 'x'))

        print("Looking for result...")

        self.driver.get(wolfram_url)
        result_section = solvers_utils.get_result_section(self.driver)
        self.convolution_result = solvers_utils.find_wf_res(
            self.driver, result_section, 0)

        print(f"Found: {self.convolution_result}")
Beispiel #8
0
    def find_y(self):

        print(f"apply inverse laplace transform to Y(s): {self.ys}")
        query = f"InverseLaplaceTransform[{self.ys}, s, t]"
        print(f"ILpt: {query}")

        self.driver.get(solvers_utils.get_problem_url(query))

        print("Looking for the inverse laplace transform...")

        result_section = solvers_utils.get_result_section(self.driver)
        self.y = solvers_utils.find_wf_res(self.driver, result_section, 1)

        print(f"y = {self.y}")
    def compute_integral(self):
        integral_expression = f"{self.dot_product} "

        print("computing integral expression:  ", integral_expression)

        self.integral_query = \
            f"integrate[{integral_expression}, {{t,{self.integral_range}}}]"

        wolfram_query = solvers_utils.get_problem_url(self.integral_query)
        self.driver.get(wolfram_query)

        result_section = solvers_utils.get_result_section(self.driver)
        self.integral_result = solvers_utils.find_wf_res(
            self.driver, result_section, 0)
        print("result =  ", self.integral_result)
Beispiel #10
0
    def solving_the_equation(self):

        print("find the solution for Y(s) (x in the expression):")
        extra_term = f" + {self.extra_term}" if self.extra_term else ""
        equa = f"Solve[{self.laplace_equa} = {self.ft_laplace_transform}{extra_term}, x]"
        print(f"equa: {equa}")

        self.driver.get(solvers_utils.get_problem_url(equa))

        print("Looking for the solution...")

        result_section = solvers_utils.get_result_section(self.driver)
        self.ys = solvers_utils.find_wf_res(self.driver, result_section, 1)

        print(f"Y(s) = {self.ys}")
Beispiel #11
0
    def get_wroskian(self):
        print("find the wroskian of the sol set")

        solset_string = ",".join(self.solset)
        self.driver.get(solvers_utils.get_problem_url(f"wronskian({{{solset_string}}},x)"))

        print("Looking for the wroskian...", end='\n')
        
        result_section = solvers_utils.get_result_section(self.driver)
        self.wroskian = solvers_utils.find_wf_res(
            self.driver, 
            result_section, 
            1
        )
        
        print(f"Wroskian found:  {self.wroskian}", end='\n')
    def find_derivatives(self):
        for i, component in enumerate(self.components):
            variable = self.default_variables[i]
            print(f"looking for: integral with respect to {variable}")

            query = solvers_utils.get_wf_integral(component, variable=variable)

            wolfram_query = solvers_utils.get_problem_url(query)
            self.driver.get(wolfram_query)

            result_section = solvers_utils.get_result_section(self.driver)
            partial_integral = solvers_utils.find_wf_res(
                self.driver, result_section, 0)

            print(f"result of {variable}:  ", partial_integral)
            self.partial_integrals.append(partial_integral)
Beispiel #13
0
    def find_laplace_for_ft(self):

        print(f"apply laplace transform to f(t): {self.ft}")
        self.ft = self.ft.replace("u", "θ")

        self.driver.get(
            solvers_utils.get_problem_url(
                f"LaplaceTransform[{self.ft}, t, s]"))

        print("Looking for laplace transform...")

        result_section = solvers_utils.get_result_section(self.driver)
        self.ft_laplace_transform = solvers_utils.find_wf_res(
            self.driver, result_section, 1)

        print(f"Lpt found: {self.ft_laplace_transform}")

        self.extra_term = str(input("add extra term: "))
Beispiel #14
0
    def find_solutions(self):
        print("find 'u' solutions")

        wf_integrals = []

        for uderi in self.u_derivatives:
            wf_integrals.append(f"integrate[{uderi}]")
        
        for i, wf_integral in enumerate(wf_integrals, start = 1):
            self.driver.get(solvers_utils.get_problem_url(wf_integral))
            result_section = solvers_utils.get_result_section(self.driver)
            res = solvers_utils.find_wf_res(
                self.driver, 
                result_section, 
                0, 
                sleep_time = 6
            )
            input(f"u{i} found: {res},  Press Enter to Continue:")
            self.u_solutions.append(res)
Beispiel #15
0
    def find_u_derivatives(self):
        print("find 'u' derivatives")

        w_det_querys = []

        for u_number in range(1, len(self.solset) + 1):
            w_det_querys.append(solvers_utils.get_wfdet_of_param_variation(
                self.solset, self.fx, u_number
            ))
        
        for i, w_det in enumerate(w_det_querys, start = 1):
            self.driver.get(solvers_utils.get_problem_url(w_det))
            result_section = solvers_utils.get_result_section(self.driver)
            res = solvers_utils.find_wf_res(
                self.driver, 
                result_section, 
                1, 
                sleep_time = 6
            )
            res_extra = f"({res})/({self.wroskian})"
            input(f"u{i}' found: {res_extra},  Press Enter to Continue:")
            self.u_derivatives.append(res_extra)