Question Help with implementation from TAlex.MathCore library with the derivation Function?

Joined
Mar 8, 2020
Messages
7
Programming Experience
5-10
Hi everyone. I have a little difficulties to implement the derivation Function from the TAlex.MathCore on NuGet library, which is a main part of my self-developed ManyWorld-Theory- QuantumPhysics-Project i am working on a personal interest.
My problem is in the From1-File.
Can anyone help?
Here is the project hosted on my private Google Drive:

I hope anyone can help:
ShadownightProgramming
 
Joined
Mar 8, 2020
Messages
7
Programming Experience
5-10
Here is the code of Interest:
Schroedinger-equation:
public double getSchroedingerGleichung(Teilsys1 teils1, double impulsofTeilchenT, Vector3D.Vector ortofTeilchenT, decimal time)
        {
            int years = (int)TAlex.MathCore.UnitConversion.UnitConverter.Convert(time, TAlex.MathCore.UnitConversion.Quantities.Time.Week, TAlex.MathCore.UnitConversion.Quantities.Time.Year);
            double[] finalunits = new double[years];

            //Add Years to the Array finalunits
            for (int i = 0; i <= years; i++)
            {
                finalunits[i] = i;
            }
            //Piece of interest
            Microsoft.FSharp.Core.FSharpFunc<double[],double> f = ;
            double Energie = (double)TAlex.MathCore.Complex.One * ℏ();
            double Impuls = (double)TAlex.MathCore.Complex.Negate(TAlex.MathCore.Complex.One) * ℏ() * MathNet.Numerics.DifferentiateModule.partialDerivative(1, 1, finalunits, f);
            Vector3D.Vector Ort = new Vector3D.Vector(0,0,0);

            return Hamiltonfunktion(teils1, Impuls, Ort);
        }

Teilsys 1 Code for a better understanding: Highlighted is another unknown implementation error cause i dont know how to implement the Killing form:
 public struct Teilsys1
        {
            public double age;
            public Boolean gravitation;
            public double g;
            public Boolean hassunsystem;
            public Boolean isempty;
            public Boolean islifelike;
            public const double c = 299.792458;
            //Age and Space of an Universe
            public const double Hubbleconst = 67.4;

            public Boolean islifepossible;
            bool continueOnCapturedContext;
            public TAlex.MathCore.LinearAlgebra.CMatrix getLieAlgebralementTriplet(int Dimension, TAlex.MathCore.LinearAlgebra.CMatrix t1, TAlex.MathCore.LinearAlgebra.CMatrix t2)
            {
                TAlex.MathCore.LinearAlgebra.CMatrix matr = new TAlex.MathCore.LinearAlgebra.CMatrix(new double[3, 3]);
                int cola = t1.ColumnCount, rowa = t1.RowCount;
                int colb = t2.ColumnCount, rowb = t2.RowCount;
                int permut = 0;
                matr = -matr;
                for (int d = 1; d <= Dimension; d++)
                {
                    // i loops till rowa
                    for (int i = 0; i < rowa; i++)
                    {
                        // k loops till rowb
                        for (int k = 0; k < rowb; k++)
                        {
                            // j loops till cola
                            for (int j = 0; j < cola; j++)
                            {
                                // l loops till colb
                                for (int l = 0; l < colb; l++)
                                {
                                    //matr[i + l + 1, j + k + 1] = A[i, j] * B[k, l];

                                    permut = TAlex.MathCore.LinearAlgebra.CMatrix.SignPermut(matr);
                                };
                            }
                        }
                    }
                    matr = TAlex.MathCore.LinearAlgebra.CMatrix.Multiply(matr, permut);
                }
                return matr;
            }
            public TAlex.MathCore.LinearAlgebra.CMatrix getKillingForm(int startrow, int endRow, int startCol,int endCol,TAlex.MathCore.LinearAlgebra.CMatrix c1, TAlex.MathCore.LinearAlgebra.CMatrix c2)
            {
                if (TAlex.MathCore.LinearAlgebra.CMatrix.Trace(c1.Adjoint).IsZero)
                {
                    TAlex.MathCore.LinearAlgebra.CMatrix subm;
                    TAlex.MathCore.LinearAlgebra.CMatrix liemann = getLieAlgebralementTriplet(8, c1, c2);
                    subm = liemann.Submatrix(startrow,endRow,startCol,endCol);
                }   if()

                 
            }
         

            public double getdensityparameter(double c)   //Vacuumenergydensity = Energydensity of dark mass
            {
                return ((8 * Math.PI * G) / Math.Pow(c, 2)) / (3 * Math.Pow(Hubbleconst, 2));
            }
            public double getcriticalmassdensity()
            {
                return (3 * Math.Pow(Hubbleconst, 2) / (8 * Math.PI * G));
            }
            public double getvacuumdensityUniverse(double Force, double SizeofUniverse) // == Expansion of an Universe
            {
                if ((Force / SizeofUniverse) < 1 / 3)
                    return -(Force / SizeofUniverse) / Math.Pow(Math.PI, 2);
                else
                    return 1;
            }
            public double getageofUniversev1()
            {
                return 1.0 / Hubbleconst;
            }

            public double getsizeofUniverse(double age)
            {
                return c * age;
            }
            public enum Universeshape { sperical, flat, hyperbolic }
            public string universetype;
       
            public async Task<Boolean> haslifelikedependenciesplanets(Boolean gravitation, Boolean air, Boolean darkmass, Boolean Food, Boolean Carbonoxide, Boolean coalorsilicium)
            {
                continueOnCapturedContext = false;

                if (gravitation == true && air == true && darkmass == true && Food == true && Carbonoxide == true && coalorsilicium == true && age != 0 && hassunsystem == true && isempty == false)
                {
                    if (getdensityparameter(c) != 0)
                        if (getcriticalmassdensity() == 8.5 * Math.Pow(10, -27))
                        {
                            universetype = Universeshape.flat.ToString();                      

                            continueOnCapturedContext = true;
                            islifepossible = await haslifelikedependenciesplanets(gravitation, air, darkmass, Food, Carbonoxide, coalorsilicium).ConfigureAwait(continueOnCapturedContext = true);
                            return islifepossible;
                        }
                        else if (getcriticalmassdensity() < 1)
                        {
                            universetype = Universeshape.hyperbolic.ToString();
                            islifepossible = false;
                            return islifepossible;
                        }

                        else if (getcriticalmassdensity() > 1)
                        {
                            universetype = Universeshape.sperical.ToString();
                            islifepossible = false;
                            return islifepossible;
                        }
                }
                return false;
            }
     
    }

code to set the Impuls Vector:
 public void setImplusvector3D(double x, double y, double z)
        {
            this.Impulsvect.X = x;
            this.Impulsvect.Y = y;
            this.Impulsvect.Z = z;
        }

set the place of a Atom:
public void setvector3D(double x, double y, double z)
        {
            this.ortsvektor.X = x;
            this.ortsvektor.Y = y;
            this.ortsvektor.Z = z;
        }
 
Last edited:

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,762
Location
Chesapeake, VA
Programming Experience
10+
From what I can see, all your issues are due to you have not defined any of the functions, or written code for the if statement. Since we can't read your mind, nor have you taken time to explain what the function is supposed to do, or what the if statement is trying to accomplish, then it is very hard to help you.

Furthermore, the if you've written over 5000+ line of code, but you are stumped by how to write a function or if statement, something is really wrong. Was the wave function previously collapsing into "I-know-how-to-write-code" state, but now the wave function is collapsing down to "I-don't-know-how-to-write-code"? Must be Schroedinger's Code Monkey...
 
Joined
Mar 8, 2020
Messages
7
Programming Experience
5-10
I don't get any further into having to call an f#-function in the c# program, I can't figure it out how to do that. For a better understanding i will post the c# original function which i want to convert into an f# one to derivate it which is what i want to archieve in the "Schroedinger-equation: "-Section cause the derivation function only takes f# functions as an input for formulas.
 
Joined
Mar 8, 2020
Messages
7
Programming Experience
5-10
Sure I solved it like that because according to the Wikipedia-entry the KillingFormis defined like this:
Killing Form.JPG

The Code is like the following:
The Killing Form (Highlighted Problem is now solved like this!) :):
public TAlex.MathCore.LinearAlgebra.CMatrix getKillingForm(int startrow, int endRow, int startCol,int endCol,TAlex.MathCore.LinearAlgebra.CMatrix c1, TAlex.MathCore.LinearAlgebra.CMatrix c2)
            {
                if (TAlex.MathCore.LinearAlgebra.CMatrix.Trace(c1.Adjoint).IsZero)
                {
                    TAlex.MathCore.LinearAlgebra.CMatrix subm, subminv;
                    TAlex.MathCore.LinearAlgebra.CMatrix liemann = getLieAlgebralementTriplet(8, c1, c2);
                    subm = liemann.Submatrix(startrow,endRow,startCol,endCol);
                    subminv = liemann.Submatrix(endRow, startrow, endCol, startCol);

                    if (TAlex.MathCore.LinearAlgebra.CMatrix.Trace(subm.Adjoint * subm.Adjoint) == TAlex.MathCore.LinearAlgebra.CMatrix.Trace(subminv.Adjoint * subminv.Adjoint))
                        return subm;
                }
                return c1;                 
            }
 
Joined
Mar 8, 2020
Messages
7
Programming Experience
5-10
I can't figure it out how to do that. For a better understanding i will post the c# original function which i want to convert into an f# one to derivate it which is what i want to archieve in the "Schroedinger-equation: "-Section cause the derivation function only takes f# functions as an input for formulas. Does anyone know how to implement the derivate-function?
 
Top Bottom