parisolab / mathmod

Mathematical modelling software
https://www.facebook.com/parisolab/
Other
105 stars 19 forks source link

Add script "Spherical_Harmonics" #224

Open parisolab opened 1 year ago

parisolab commented 1 year ago

Screen Shot 2022-11-03 at 10 23 18 PM

zhangfq-chemistry commented 1 year ago

Oh, Thanks! Please add Associated Legendre function.

zhangfq-chemistry commented 1 year ago

Would you like to add two sliders which can be drag to modify the data of u/v?

parisolab commented 1 year ago

Do you mean a slider to increase/decrease the u/v grid resolution (see attached picture)? To fine tune even more the u/v grid resolution for each component you can also use "Grid" instruction.

Screen Shot 2022-11-08 at 11 46 33 AM

zhangfq-chemistry commented 1 year ago

No Sir! I want this one: https://www.geogebra.org/m/hnh2UutJ

parisolab commented 1 year ago

You have to define a constant and connect it to a slider with the "Add" button in "Sliders->"parameters List" PS: you can Add/remove sliders and edit their properties from the "Sliders" Tabulation

    {
        "Param3D": {
            "Description": ["Spherical harmonics by Abderrahman Taha 03/11/2022"],
            "Name": ["Spherical_Harmonics"],
            "Component": ["SH_1","SH_2","SH_3","SH_4","SH_5","SH_6"],
"Const": ["N=30"],
            "Funct": ["H1=abs(1)","H2=(7/4)*abs(cos(u))","H3=abs(3*cos(u)^2-1)","H4=3*abs(cos(u)*sin(u)*sin(v))","H5=abs(5*cos(u)^3-3*cos(u))","H6=abs((5*cos(u)^2-1)*cos(v)*sin(u))"],
            "Fx": ["H1(u,v,t)*sin(u)*cos(v)","H2(u,v,t)*sin(u)*cos(v)+3","H3(u,v,t)*sin(u)*cos(v)+6","H4(u,v,t)*sin(u)*cos(v)","H5(u,v,t)*sin(u)*cos(v)+3","H6(u,v,t)*sin(u)*cos(v)+6"],
            "Fy": ["H1(u,v,t)*sin(u)*sin(v)","H2(u,v,t)*sin(u)*sin(v)","H3(u,v,t)*sin(u)*sin(v)","H4(u,v,t)*sin(u)*sin(v)","H5(u,v,t)*sin(u)*sin(v)","H6(u,v,t)*sin(u)*sin(v)"],
            "Fz": ["H1(u,v,t)*cos(u)","H2(u,v,t)*cos(u)","H3(u,v,t)*cos(u)","H4(u,v,t)*cos(u)-4","H5(u,v,t)*cos(u)-4","H6(u,v,t)*cos(u)-4"],
            "Umax": ["pi","pi","N*pi/30","pi","pi","pi"],
            "Umin": ["0","0","0","0","0","0"],
            "Vmax": ["2*N*pi/30","2*pi","2*pi","2*pi","2*pi","2*pi"],
            "Vmin": ["0","0","0","0","0","0"]
        },
    "Sliders": {
        "Max": ["30"],
        "Min": ["0"],
        "Name": ["N" ],
        "Position": ["30" ],
        "Step": ["1" ]
    }
    }