Miles Mathis' Charge Field
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Calculators and Converters

3 posters

Go down

Calculators and Converters Empty Calculators and Converters

Post by Nevyn Tue May 09, 2017 8:33 pm

I have created a calculator for angular velocity. There are 3 calculators on the page where each one takes two parameters and calculates the third.

http://www.nevyns-lab.com/mathis/math/calculator.php?type=angular_velocity

The best part is that it is all driven from a database. This allows me to easily create new calculators and they will all share a common style.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue May 09, 2017 8:52 pm

I have added a list of calculators page:

http://www.nevyns-lab.com/mathis/math/calculators.php
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by LongtimeAirman Tue May 09, 2017 10:07 pm

.
Angular Velocity Calculator
These calculators can be used to convert between radius, tangential velocity and angular velocity

Good, why it seems like only yesterday I said your science site needed an Angular Velocity converter.

One can build a calculator in no time, given the right code and front-end. Did you use Java? Do I have permission to look? And if so, Where exactly would I look?  It is a bit spartan. I would want a diagram or illustration or two. A library would take a great deal more time.

My only complaint - I don't know if it's intentional or not - this effort only involves calculations to solve for: 1) Radius; 2) 300000000; and 3) Angular velocity (referred to as omega). In all 3 cases, the tangential velocity is 300 000 000. There is no angle velocity involved. Easily made easily fixed.
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue May 09, 2017 11:28 pm

Yes, you did spark me into it. I had forgotten our previous discussion about converters and decided to see what I could do last night. As I thought about it, I realised that I might be able to use the database and make life easier in the future. It worked out pretty well.

No Java, just Javascript. I already had those equations written in Javascript, I also have them in Java but I have not used Java for my site at all. At least, not in running the site. I have used Java to generate content but no Java at runtime. You can look at it by using the developer tools in your browser. The code might be a bit messy because generated code usually is. I do try to make it format correctly but you can't always get it right and sometimes I just get lazy.

I already have thoughts on how to incorporate a graph. The user can specify the min, max and step values and the graph will run values though the equation and visualize it. That should work really well. I'm not sure if I want to put it onto the same page as the calculator or create a whole new page for it.

Another reason I used a database was because I had some tentative thoughts on generating a library from the database. Once I get a few more equations in there I can start to play with that and see where it goes. I did add some columns to my database tables to specify the programming language which allows many different languages to use the same database to generate the code for the equations. I have only put Javascript versions in there so far, but it can be done.

I am currently working on the angle velocity calculator. I made them separate because combining them is a bit of a problem when using a common script to generate every page. It can be done, but it takes more work and I just want to get the basics working first. At this stage, all I need to do to get another page up and running is to break the equation down so that it fits in my database structure. Once it is in the database, the site will find it and generate the page.

The angular velocity calculator is more generic than just thinking about stacked spins and photons, etc. It can be used for any radius and velocity combination. I could create a spin velocity version that sets the velocity to c and the user specifies the spin level number which I use to find the radius of the spin level and it will calculate the angular velocity. That's not a bad idea at all.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 10, 2017 1:05 am

The angle velocity calculator is now available at http://www.nevyns-lab.com/mathis/math/calculator.php?type=angle_velocity

A new spin level calculator is available at http://www.nevyns-lab.com/mathis/math/calculator.php?type=spin_level_velocity

You can find the list of all calculators at http://www.nevyns-lab.com/mathis/math/calculators.php

I have implemented limits on the argument values so that I can stop the radius from going below 0 and I limit the spin levels between 0 and 130. It can also use a step value which will set how much is added to the value if you use the spinner controls (up/down buttons).
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 10, 2017 7:58 am

I have created a new Graphing Calculator section that takes the same equations as the normal calculators and creates a graph per variable in the equation. This allows you to choose which variable you want to vary. I think it works well.

Each calculator has a link to the corresponding graph and each graph links back to its calculator.

You can reach all graphing calculators from http://www.nevyns-lab.com/mathis/math/graphs.php
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu May 11, 2017 8:32 am

Lots of little changes for the Calculators and Graphs.

Updated header that provides links to the parent lists.
General spacing between areas has been improved (i.e. actually looked at).
A reset button has been provided that will change the controls back to their original values.
The graphs now generate data when the page is loaded so they are all showing data from the start.
I have added a way to specify a format for the X and Y labels on a graph. This has been used on the Spin Level Velocity graphs.

The most notable change is the introduction of a code generation system. Each calculator now has a button that will generate the code for that equation. There is also a button at the top of each page that will generate all of the equations in a library. It currently supports Javascript and will need to be changed to support multiple languages, but that is the long term goal. If you want to convert some of these functions to R then I can figure out how to fit that into the system.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Fri May 12, 2017 8:37 am

I started this evening with a half baked code generation system and a full bottle of Makers Mark. You may not realise it, but evidence suggests that these two things are inversely proportional. As the bottle empties, the code gets better! I know, it goes against all expectations but you just can't argue with the results.

The code generated from my equation database is now beautiful, well structured, documented code that includes functions to generate data for graphs. There are multiple ways to get the code. Each calculator or graph contains a button to access the code specific to that calculator. Each page provides a button to get the code for all equations in that page. The list pages also provide a button to access the code for all equations in one complete library.

The next step is to make the calculators use the code generated from the database. They are currently generating their own versions but now I can just import them in. When this is done it will create a self testing system since the generated code will actually be used by the calculators.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Reviewing Angular and Angle graphs

Post by LongtimeAirman Sat May 13, 2017 12:41 am

.
http://www.nevyns-lab.com/mathis/math/graphs.php
Reviewing Angular and Angle Velocity graphs, just the defaults. I made my own plots to try and duplicate yours, indicating where we don't agree. Please double check where we are different.

1. Graph of omega vs radius
ω = √[2r√[v2+r2]-2r2]
Angular Velocity with changing radius
COMMENT. Agreed

2. Graph of omega vs velocity
ω = √[2r√[v2+r2]-2r2]
Angular Velocity with changing velocity
COMMENT. Agreed

3. Graph of velocity vs radius
v = √[(ω4/4r2)+ω2]
Velocity with changing radius  
COMMENT. Unable to recreate your numbers. My list starts at 1.118 then diverges from yours.
1.118, 1.414, 1.803, 2.236, 2.693, 3.162, 3.640, 4.123, 4.610, 5.099.
My formula: = SQRT((R31*R31*R31*R31/4*D31*D31)+R31*R31)
Where R31= 1 (constant 1), and D31= 1 (incremental radius – start  at 1)

4. Graph of velocity vs omega
v = √[(ω4/4r2)+ω2]
Velocity with changing omega
COMMENT. Agreed

5. Graph of radius vs velocity
r = √[ω4/(4v2-4ω2)]
Radius with changing velocity
COMMENT. Agreed. The first two numbers are illegal. Sqrt of a neg #? #NUM! then a #DIV/0!

6. Graph of radius vs omega
r = √[ω4/(4v2-4ω2)]
Radius with changing omega
COMMENT. Agreed. Poor graph. The first number is zero, then a #DIV/0!, then the rest of the numbers are  all #NUM!

7. Graph of angle vs radius
θ = πg√[2r√[v2+r2]-2r2]/πkr
Angle Velocity with changing radius
COMMENT. Only ou first number agrees: -, 0.7148535, 1.5264002, 2.3249634, 3.1176964, 3.9076916, 4.6962222, 5.4838859, 6.2709966, 7.0577337.
My formula: =  PI()*SQRT(2*D31*SQRT(F31*F31+D31*D31)-2*D31*D31)/4*D31
Where D31= 0(rad incremental – start  at 0), and F31= 1  (constant vel = 1 ).

8. Graph of angle vs velocity
θ = πg√[2r√[v2+r2]-2r2]/πkr
Angle Velocity with changing velocity
COMMENT. Agreed.

9. Graph of velocity vs radius
v = θπkr√[θ2πk2+4πg2]/2πg2
Velocity with changing radius
COMMENT.  Unable to recreate your numbers. -, 147, 294, 441, 588, 735, 882, 1,029, 1,176, 1,323  
My formula: =  J31*4*D31*SQRT(J31*J31*4*4+4*PI()*PI())/2*PI()*PI()
Where D31= 0(radius incremental – start  at 0), and J31= 1  (constant angle = 1 ).

10. Graph of velocity vs angle
v = θπkr√[θ2πk2+4πg2]/2πg2
Velocity with changing angle
COMMENT.  Unable to recreate your numbers. -, 147.03, 401.59, 802.13, 1,357.23, 2,069.04, 2,938.24, 3,965.10, 5,149.73, 6,492.18,
My formula: =  K31*4*C31*SQRT(K31*K31*4*4+4*PI()*PI())/2*PI()*PI()
Where K31= 0 (angle incremental – start  at 0), and C31= 1 (constant, radius = 1 ).

11. Graph of radius vs velocity
r = 2πgv/√[θ4πk4+4θ2πk2πg2]
Radius with changing velocity
COMMENT.  Unable to recreate your numbers. -, 0.2108909, 0.4217818, 0.6326727, 0.8435636, 1.2653454, 1.4762363, 1.6871272, 1.8980181,
My formula: =  2*PI()*G31/SQRT(J31*J31*J31*J31*4*4*4*4 + 4*J31*J31*4*4*PI()*PI())
Where G31= 0 (vel incremental – start  at 0), and J31= 1 (constant, angle = 1 ).

12. Graph of radius vs angle
r = 2πgv/√[θ4πk4+4θ2πk2πg2]
Radius with changing angle
COMMENT. Unable to recreate your numbers. #DIV/0!, 0.2108909, 0.0772085, 0.0386550, 0.0228453, 0.0149858, 0.0105527, 0.0078198, 0.0060210, 0.0047759, …
My formula: =  2*PI()*F31/SQRT(K31*K31*K31*K31*4*4*4*4 + 4*K31*K31*4*4*PI()*PI())
Where K31= 0 (angle incremental – start  at 0), and F31= 1 (constant, vel = 1 ).
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Sat May 13, 2017 5:52 am

I have added another language so all equations can be generated in Javascript or Java code. These are created such that the code, when used, looks and acts the same way, as much as that is possible. For example, suppose we were using the angular velocity equation to calculate omega:

Javascript:
Code:
var omega = Equations.AngularVelocity.calcOmega( radius, velocity );

Java:
Code:
double omega = Equations.AngularVelocity.calcOmega( radius, velocity );

It is the exact same code, bar the variable assignment, so you could copy from one language straight into another. This makes porting to a different language much easier. It is not always possible to keep them the same though, so some functions do differ. All of the basic ones match and it is the graphing functions that are different.

I added a licence to the code which just retains copyright, absolves me of any liability and lets anyone use it for what-ever purpose they want. Now I can't get sued when someone loses a space ship or blows up a power station. I should sleep a little easier tonight.

In order to support multiple languages I had to come up with some way to let the user choose which language they wanted to download. I came up with a dropdown button that I think works quite well.

Airman, I've made a start on some of those issues. Mainly around getting the right initial values. I have a much more flexible system to manage that now and I just need to get them all right. There could be problems in my math when the number are integers. It could restrict it to integer math so I will make some changes to ensure that it uses floating point math. I suspect that is why some of our values are different but I'll have a closer look shortly.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Sun May 14, 2017 8:32 pm

I probably should mention that the generated code has not been tested. The actual code for the equations has been used in the calculators but the download code has not been checked beyond visually. I have been more focused on the generation than the generated, but I will test it soon.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Mon May 15, 2017 6:28 pm

I didn't have much time to spend on this last night, but I had a quick look at the Java code and found a few errors. Surprisingly, there were errors in the actual equation code, which is currently in use in all of the calculators and graphs. Javascript is a lot more lenient than Java. Java will not allow any errors in syntax but Javascript will allow minor ones so it worked fine in the browser but not in Java code. It all came down to a missing ';' on the last statement in a few of the functions. Since it was the last statement, it did not create an ambiguous situation for the code parser and it worked fine.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue May 16, 2017 7:42 pm

Made a few changes last night. I got the coding errors ironed out. The Java code compiles now and there were also a couple of bugs in the Javascript code. I think the Javascript code is good, but the validators I found on the net kept complaining about stuff that didn't matter. Like using spaces instead of tabs or having a space after a '*', even though it is part of a comment and not code. There seems to be some push to get everyone coding in the same style. Code style is important, but it is a personal thing, or at best, a team thing when you are working in a project with other developers.

I added four more equations to the system. I added a calculator for acceleration, even though it will be exactly the same as velocity, just with different variable names. These easy equations barely require a calculator but they are there for completeness. I also added momentum, force and work equations. The work equation is interesting as it has four variables and one of them is an angle which created a bit of a mess in the graphs until I worked out the right values to set them to. They go from -2PI to 2Pi but they only really need to go from -PI to PI. The first graph works better with 2PI so I left it at that. The other graphs where you can vary the angle are a bit weird.

Having eight equations created the need for some sort of grouping, so I added a higher level to group equations into subjects. I then had to update the code generators to support subjects, but that was pretty easy. While doing that I did find a few more errors in the code which only showed up in certain situations. Most variables are floating point values and everything worked fine if they all were, but the Spin Level calculators have one variable that is an integer and this caused some issues because I was using the wrong data type for the return value of the graphing functions. That was only a problem in the Java code because Javascript doesn't have data types, at least, not that the developer specifies.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 17, 2017 7:26 pm

LongtimeAirman wrote:
http://www.nevyns-lab.com/mathis/math/graphs.php
Reviewing Angular and Angle Velocity graphs, just the defaults. I made my own plots to try and duplicate yours, indicating where we don't agree. Please double check where we are different.

3. Graph of velocity vs radius
v = √[(ω4/4r2)+ω2]
Velocity with changing radius  
COMMENT. Unable to recreate your numbers. My list starts at 1.118 then diverges from yours.
1.118, 1.414, 1.803, 2.236, 2.693, 3.162, 3.640, 4.123, 4.610, 5.099.
My formula: = SQRT((R31*R31*R31*R31/4*D31*D31)+R31*R31)
Where R31= 1 (constant 1), and D31= 1 (incremental radius – start  at 1)

Your equation is not quite correct. Excel seems to have a strict operator precedence system so you need to use parentheses more than you would think. Change your formula to:

Corrected formula: = SQRT((R31*R31*R31*R31/(4*D31*D31))+R31*R31)

I have put brackets around 4*D31*D31 so that it is calculated before the division. Otherwise it will perform R31*R31*R31*R31/4 first, and then multiply that by D31*D31 which is not what the equation means.

LongtimeAirman wrote:
5. Graph of radius vs velocity
r = √[ω4/(4v2-4ω2)]
Radius with changing velocity
COMMENT. Agreed. The first two numbers are illegal. Sqrt of a neg #? #NUM! then a #DIV/0!

6. Graph of radius vs omega
r = √[ω4/(4v2-4ω2)]
Radius with changing omega
COMMENT. Agreed. Poor graph. The first number is zero, then a #DIV/0!, then the rest of the numbers are  all #NUM!

Fixed the initial values.

LongtimeAirman wrote:
7. Graph of angle vs radius
θ = πg√[2r√[v2+r2]-2r2]/πkr
Angle Velocity with changing radius
COMMENT. Only ou first number agrees: -, 0.7148535, 1.5264002, 2.3249634, 3.1176964, 3.9076916, 4.6962222, 5.4838859, 6.2709966, 7.0577337.
My formula: =  PI()*SQRT(2*D31*SQRT(F31*F31+D31*D31)-2*D31*D31)/4*D31
Where D31= 0(rad incremental – start  at 0), and F31= 1  (constant vel = 1 ).

Same thing here, put parentheses around 4*D31.

Corrected formula: =  PI()*SQRT(2*D31*SQRT(F31*F31+D31*D31)-2*D31*D31)/(4*D31)

LongtimeAirman wrote:
9. Graph of velocity vs radius
v = θπkr√[θ2πk2+4πg2]/2πg2
Velocity with changing radius
COMMENT.  Unable to recreate your numbers. -, 147, 294, 441, 588, 735, 882, 1,029, 1,176, 1,323  
My formula: =  J31*4*D31*SQRT(J31*J31*4*4+4*PI()*PI())/2*PI()*PI()
Where D31= 0(radius incremental – start  at 0), and J31= 1  (constant angle = 1 ).

10. Graph of velocity vs angle
v = θπkr√[θ2πk2+4πg2]/2πg2
Velocity with changing angle
COMMENT.  Unable to recreate your numbers. -, 147.03, 401.59, 802.13, 1,357.23, 2,069.04, 2,938.24, 3,965.10, 5,149.73, 6,492.18,
My formula: =  K31*4*C31*SQRT(K31*K31*4*4+4*PI()*PI())/2*PI()*PI()
Where K31= 0 (angle incremental – start  at 0), and C31= 1 (constant, radius = 1 ).

Put parentheses around 2*PI()*PI().

Corrected formula: =  K31*4*C31*SQRT(K31*K31*4*4+4*PI()*PI())/(2*PI()*PI())

LongtimeAirman wrote:
11. Graph of radius vs velocity
r = 2πgv/√[θ4πk4+4θ2πk2πg2]
Radius with changing velocity
COMMENT.  Unable to recreate your numbers. -, 0.2108909, 0.4217818, 0.6326727, 0.8435636, 1.2653454, 1.4762363, 1.6871272, 1.8980181,
My formula: =  2*PI()*G31/SQRT(J31*J31*J31*J31*4*4*4*4 + 4*J31*J31*4*4*PI()*PI())
Where G31= 0 (vel incremental – start  at 0), and J31= 1 (constant, angle = 1 ).

12. Graph of radius vs angle
r = 2πgv/√[θ4πk4+4θ2πk2πg2]
Radius with changing angle
COMMENT. Unable to recreate your numbers. #DIV/0!, 0.2108909, 0.0772085, 0.0386550, 0.0228453, 0.0149858, 0.0105527, 0.0078198, 0.0060210, 0.0047759, …
My formula: =  2*PI()*F31/SQRT(K31*K31*K31*K31*4*4*4*4 + 4*K31*K31*4*4*PI()*PI())
Where K31= 0 (angle incremental – start  at 0), and F31= 1 (constant, vel = 1 ).

I either have a bug in the code for the equation or the displayed equation is wrong. The code is using 2*PI^2*v but the equation shown is 2*PI*v. I'll have to figure out which one is right.

Also, you can use the '^' operator to raise some value to a power. For example, to raise 2 to the power of 3 you can use the excel equation: 2^3. This works for cells as well as literals.

Not sure if this is a problem for you, but you may need to make use of absolute cell references by using the '$' operator. Whatever the $ is in front of will remain that value when you drag an equation over multiple cells. You can keep the row and/or column absolute so it might be $A1 to keep the A but increment the 1, or $A$1 to keep it referenced to A1, or it could be A$1 to keep the 1 but change the A.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 17, 2017 8:07 pm

I think a few of my equation rearrangements are wrong. I found a site to do the rearranging for me as some of these equations are beyond my math skills to rearrange. I just put one of them through it again and got a different answer. So I must have put in the wrong equation the first time. I will go over them again and make sure they are correct.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty R code to calculate and plot Angular(w) and Angle(a) Velocity Functions

Post by LongtimeAirman Wed May 17, 2017 9:44 pm

.
Nevyn, I updated my excel file with your corrections and obtained your numbers. Thanks. Two graphs: 11. radius vs velocity (changing velocity) and 12. radius vs angle(a) (changing angle) are as yet unconfirmed.

Here is a draft R code that plots all your Angular and Angle graphs. Ensure the variables are properly identified in the active code below. After running the top code, one would then run just the appropriate function to obtain a calculated variable list and basic plot.  

Code:

###########################################
#                              
#   Angular(w) and Angle(a) Velocity Functions
#           in  R code
#
###########################################
#
# In order to use this R code,
# One would need to enter known values in  
# the un-commented code section below. Run
# the corresponding function to obtain the
# desired plot with calculated values.
#
###########################################
# Angular(w) and Angle(a) Functions Defined
###########################################
# w=sqrt(2rsqrt(v^2+r^2)-2r^2)
###########################################
# 1. Function wvsradius. omega(w) vs. radius(r).
# Given: Constant velocity and changing radius.
# Calculate w.
# Define function. Plot(r1,w1). List w1.
#
wvsradius <- function(){
  w1 <- 0:10
  r1 <- 1:10
  v1 <- c(10,10,10,10,10,10,10,10,10,10)
  for(i in r1){
    w1<- sqrt(2*r1*sqrt((v1*v1)+(r1*r1))-2*r1*r1)
  }
  plot(r1,w1,main = "omega(w) vs. radius(r)\nw = sqrt(2rsqrt(v^2+r^2)-2r^2)")
  w1
}
###########################################
# 2. Function wvsvelocity. omega(w) vs. velocity(v).
# Given: Constant radius and changing velocity.
# Calculate w.
# Define wvsvelocity. plot(v2,w2). List w2.
wvsvelocity <- function(){
w2 <- 0:10
r2 <- c(1,1,1,1,1,1,1,1,1,1)
v2 <- 1:10
for(i in v2){
  w2<- sqrt(2*r2*sqrt((v2*v2)+(r2*r2))-2*r2*r2)
}
plot(v2,w2,main = "omega(w) vs. velocity(v)\nw = sqrt(2rsqrt(v^2+r^2)-2r^2)")
w2
}
###########################################
# v = sqrt[(w^4/4r^2)+w^2]
###########################################
# 3. Function vvsradiusw. velocity(v) vs. radius(r).
# Given: Constant omega(w) and changing radius.
# Calculate v.
# Define vvsradiusw. Plot(r3,v3). List v3.
vvsradiusw <- function(){
w3 <- c(10,10,10,10,10,10,10,10,10,10)
r3 <- 1:10
v3 <- 1:10
for(i in r3){
  v3 <- sqrt((w3*w3*w3*w3/(4*r3*r3))+w3*w3)
}
plot(r3,v3,main = "velocity(v) vs. radius(r)\nv = sqrt[(w^4/4r^2)+w^2]")
v3
}
###########################################
# 4. Function vvsomega. velocity(v) vs. omega(w).
# Given: Constant radius(r) and changing omega.
# Calculate v.
# Define vvsomega. Plot(w4,v4). List v4.
# Define function vvsomega. plot(w4,v4). List v4.
vvsomega <- function(){
w4 <- 1:10
r4 <- c(1,1,1,1,1,1,1,1,1,1)
v4 <- c(1,1,1,1,1,1,1,1,1,1)
for(i in w4){
  v4<- sqrt((w4*w4*w4*w4/(4*r4*r4))+w4*w4)
}
plot(w4,v4,main = "velocity(v) vs. omega(w)\nv = sqrt[(w^4/4r^2)+w^2]")
v4
}
###########################################
# r = sqrt[w^4/(4v^2-4w^2)]
###########################################
# 5. Function rvsvelocityw. radius(r) vs. velocity(v).
# Given: Constant omega(w) and changing velocity.
# Calculate r.
# Define function rvsvelocityw. plot(v5,r5). List r5.
rvsvelocityw <- function(){
w5 <- c(1,1,1,1,1,1,1,1,1,1,1)
r5 <- c(1,1,1,1,1,1,1,1,1,1,1)
v5 <- seq(from=100,to=200,by=10)
for(i in v5){
  r5 <- sqrt(w5*w5*w5*w5/(4*v5*v5-4*w5*w5))
}
plot(v5,r5,main = "radius(r) vs. velocity(v)\nr = sqrt[w^4/(4v^2-4w^2)]")
r5
}
###########################################
# 6. Function rvsomega. radius(r) vs. omega(w).
# Given: Constant velocity(v) and changing omega.
# Calculate r.
# Define function rvsomega. plot(w6,r6). List r6.
rvsomega <- function(){
w6 <- 1:10
r6 <- c(1,1,1,1,1,1,1,1,1,1,1)
v6 <- c(100,100,100,100,100,100,100,100,100,100)
for(i in w6){
  r6 <- sqrt(w6*w6*w6*w6/(4*v6*v6-4*w6*w6))
}
plot(w6,r6,main = "radius(r) vs. omega(w)\nr = sqrt[w^4/(4v^2-4w^2)]")
r6
}
###########################################
# Angular Velocity Functions and Plots
###########################################
# a = 3.14sqrt[2rsqrt[v^2+r^2]-2r^2]/4r
###########################################
# 7. Function avsradius. angle(a) vs. radius(r).
# Given: Constant velocity(v) and changing radius.
# Calculate a.
# Define function avsradius. plot(r7,a7). List a7.
avsradius <- function(){
a7 <- c(1,1,1,1,1,1,1,1,1,1)
r7 <- 1:10
v7 <- c(1,1,1,1,1,1,1,1,1,1)
for(i in r7){
  a7<- pi*sqrt(2*r7*sqrt(v7*v7+r7*r7)-2*r7*r7)/(4*r7)
}
plot(r7,a7,main = "angle(a) vs. radius(r)\na = 3.14sqrt[2rsqrt[v^2+r^2]-2r^2]/4r")
a7
}
###########################################
# 8. Function avsvelocity. angle(a) vs. velocity(v).
# Given: Constant radius(r) and changing Velocity.
# Calculate a.
# Define function avsvelocity. plot(v8,a8). List a8.
avsvelocity <- function(){
a8 <- c(1,1,1,1,1,1,1,1,1,1,1)
r8 <- c(1,1,1,1,1,1,1,1,1,1,1)
v8 <- 0:10
for(i in v8){
  a8<- pi*sqrt(2*r8*sqrt(v8*v8+r8*r8)-2*r8*r8)/4*r8
}
plot(v8,a8,main = "angle(a) vs. velocity(v)\na = 3.14sqrt[2rsqrt[v^2+r^2]-2r^2]/4r")
a8
}
###########################################
# v = 4arsqrt[(a^2)(4^2)+4pi^2]/2pi^2
###########################################
# 9. Function vvsradiusa. velocity(v) vs. radius(r).
# Given: Constant angle(a) and changing radius.
# Calculate v.
# Define function vvsradiusa. plot(r9,v9). List v9.
vvsradiusa <- function(){
a9 <- c(1,1,1,1,1,1,1,1,1,1,1)
r9 <- 0:10
v9 <- c(1,1,1,1,1,1,1,1,1,1,1)
for(i in r9){
  v9 <- a9*4*r9*sqrt(a9*a9*4*4+4*pi*pi)/(2*pi*pi)
}
plot(r9,v9,main = "velocity(v) vs. radius(r)\nv = 4arsqrt[(a^2)(4^2)+4pi^2]/2pi^2")
v9
}
###########################################
# 10. Function vvsangle. velocity(v) vs. angle(a).
# Given: Constant radius(r) and changing angle.
# Calculate v.
# Define function vvsangle. plot(a10,v10). List v10
vvsangle <- function(){
a10 <- 0:10
r10 <- c(1,1,1,1,1,1,1,1,1,1,1)
v10 <- c(1,1,1,1,1,1,1,1,1,1,1)
for(i in a10){
  v10 <- a10*4*r10*sqrt(a10*a10*4*4+4*pi*pi)/(2*pi*pi)
}
plot(a10,v10,main = "velocity(v) vs. angle(a)\nv = 4arsqrt[(a^2)(4^2)+4pi^2]/2pi^2")
v10
}
###########################################
# r = 2vpi/sqrt[(a^4)(4^4)+4(a^2)(4^2)(pi^2)]
###########################################
# 11. Function rvsvelocitya. radius(r) vs. velocity(v)
# Given: Constant angle(a) and changing velocity.
# Calculate r.
# Define function rvsvelocitya. plot(v11,r11). List r11.
rvsvelocitya <- function(){
a11 <- c(1,1,1,1,1,1,1,1,1,1,1)
r11 <- c(1,1,1,1,1,1,1,1,1,1,1)
v11 <- 0:10
for(i in v11){
  r11 <- 2*pi*v11/sqrt(a11*a11*a11*a11*4*4*4*4
                         +4*a11*a11*4*4*pi*pi)
}
plot(v11,r11,main = "radius(r) vs. velocity(v)\nr = 2vpi/sqrt[(a^4)(4^4)+4(a^2)(4^2)(pi^2)]")
r11
}
###########################################
# 12. Function rvsangle. radius(r) vs. angle(a).
# Given: Constant velocity(v) and changing angle.
# Calculate: r.
# Define function rvsangle. plot(a12,r12). List r12.
rvsangle <- function(){
a12 <- 1:10
r12 <- c(1,1,1,1,1,1,1,1,1,1)
v12 <- c(1,1,1,1,1,1,1,1,1,1)
for(i in a12){
  r12 <- 2*pi*v12/sqrt(a12*a12*a12*a12*4*4*4*4
                       +4*a12*a12*4*4*pi*pi)
}
plot(a12,r12,main = "radius(r) vs. angle(a)\nr = 2vpi/sqrt[(a^4)(4^4)+4(a^2)(4^2)(pi^2)]")
r12
}
###########################################
#
# Function List
#

wvsradius()
wvsvelocity()
vvsradiusw()
vvsomega()
rvsvelocityw()
rvsomega()

avsradius()
avsvelocity()
vvsradiusa()
vvsangle()
rvsvelocitya()
rvsangle()


Anyone, please feel free to comment. I'm not sure how this code will eventually be included in an MM R Library, but that's the intent.
.


Last edited by LongtimeAirman on Wed May 31, 2017 6:03 pm; edited 1 time in total (Reason for editing : Made several corrections to the initial draft code)

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 17, 2017 11:02 pm

Thanks for that R code Airman. I'll see if I can figure out how to generate it so that I can apply it to all equations.

I did a quick search on R libraries and it turns out they are called packages, not libraries. In R, a library is where R finds packages on your file system. There is a lot of content needed in a package, so I don't think it is feasible to generate one. I will probably just generate the functions and let people do what they want with them. Much like you have supplied, Airman.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu May 18, 2017 1:53 am

I just checked the angle velocity equations to see if the rearrangements were wrong or right. The angle velocity equations are correct, but the radius version is displayed incorrectly. It should have a PIg2 on the front but it is showing as just PIg.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Cr6 Sun May 21, 2017 9:13 pm

Cool LTAM.

This is what is coming up for me:

Calculators and Converters Rplot10


Cr6
Admin

Posts : 1178
Join date : 2014-08-09

https://milesmathis.forumotion.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by LongtimeAirman Sun May 21, 2017 9:27 pm

.
Hi Cr6, I guess if you "run" the entire code, the final function performed would be rvsangle(), giving you the plot shown.

Of course you can run each function separately, individually, to obtain the plot you desire,
given the variables you know and the variable you are trying to calculate.
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Cr6 Sun May 21, 2017 9:31 pm

Got it. I just hit the back button and saw them flip through.

Cr6
Admin

Posts : 1178
Join date : 2014-08-09

https://milesmathis.forumotion.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue May 23, 2017 10:44 pm

Want to see an horrendous equation?

I have been adding a few more equations to my calculators and also some changes to the layout and a pretty big redesign of the back end database to make adding new equations a lot easier. I have added the concept of a constant now too, as the equations I will be adding use a lot of them.

The latest equation I have looked at is based on Miles' paper The Moon Gives Up a Secret and is used to calculate gravity given the density and radius. It sounds so simple, doesn't it?

This equation starts out complex, but not too bad: v = G*r/R + (E*d^2*r^3)/(D^2*R^3)

Where the upper case variables are Earth based constants for solo Gravity, Radius, E/M field and Density.

I then had to rearrange that in terms of the density and got this equation: d = sqrt(-D^2*R^2*(G*r-R*v)) / (r^(3/2) * sqrt(E))

Getting bad, but still workable. Then I had to rearrange in terms of the radius and everything went to hell. It was so bad that I had to break it down into 2 parts. It took me some time to realise that part of it is repeated as it is so easy to get lost in all of these numbers, variables and operators.

N = cubert( 9*E^2*d^4*D^2*R^3*v + sqrt(3)*E^(3/2)*sqrt( 27*E*d^8*D^4*R^6*v^2 + 4*d^6*D^6*G^3*R^6 ) )
r = N/(cubert(2)*3^(2/3)*E*d^2) - cubert(2/3)*D^2*G*R^2/N

Here it is in is full glory:

cubert( 9*E^2*d^4*D^2*R^3*v + sqrt(3)*E^(3/2)*sqrt( 27*E*d^8*D^4*R^6*v^2 + 4*d^6*D^6*G^3*R^6 ) )/(cubert(2)*3^(2/3)*E*d^2) - cubert(2/3)*D^2*G*R^2/cubert( 9*E^2*d^4*D^2*R^3*v + sqrt(3)*E^(3/2)*sqrt( 27*E*d^8*D^4*R^6*v^2 + 4*d^6*D^6*G^3*R^6 ) )

Where cubert is the cube root.

In nice formatting:

N = ∛[ 9Ee2d4Ed2Er3F + √[3]Ee3/2√[27Eed8Ed4Er6v2 + 4d6Ed6Eg3Er6] ]
r = N/(∛[2]32/3Eed2) - ∛[2/3]Ed2EgEr2/N

r = ∛[ 9Ee2d4Ed2Er3F + √[3]Ee3/2√[27Eed8Ed4Er6v2 + 4d6Ed6Eg3Er6] ]/(∛[2]32/3Eed2) - ∛[2/3]Ed2EgEr2/∛[ 9Ee2d4Ed2Er3F + √[3]Ee3/2√[27Eed8Ed4Er6v2 + 4d6Ed6Eg3Er6] ]
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Reviewing 150 Graphing Calculators and One Particularly Horrendous Equation

Post by LongtimeAirman Wed May 24, 2017 11:18 pm

.
Nevyn, Golly, Something completely new, 150 graphing calculators; a playground for people who like to play with numbers. As usual, Great Job. I could have spent many happy hours here had I the opportunity years ago. Makes subject learning easier.

QUOTE. Want to see an horrendous equation?
COMMENT. Agreed, that is one Particularly Horrendous equation.

LOCATION. Nevyn's Lab - Graphing Calculators – Acceleration.
Graph of velocity vs acceleration and Graph of velocity vs time both show v = d/t.
COMMENT. Change "d = vt" to "v = at".

LOCATION. Nevyn's Lab - Graphing Calculators - Spin Level Velocity and other locations in the Angular Motion section.
QUOTE. The definition of Angular Velocity used by these calculators is that of Miles Mathis. Please read that paper to understand the difference.
COMMENT. Please consider changing (the first hyperlink is changed and another hyperlink is added) these two sentences to: The definition of Angular Velocity used by these calculators can be found in Angular Velocity and Angular Momentum by Miles Mathis. That paper corrects the historical misuse of these terms.

OBSERVATION. On all calculator pages, just below the title. A brief description is included. The longest and best description (in my opinion), including a hyperlink, is given for the Spin Level Velocity Graphs. Under Momentum Graphs, we have – “These calculators can be used to generate data using mass, velocity and momentum”. The description for Expanded Gravity Graphs is – “These calculators can be used to generate data using density, volume, radius and force” even though this section contains 30 individual graph/calculators – many I haven’t figured out or properly reviewed. The same is also true for - Charge Expanded Graphs – 30 calculators with little description.
COMMENT. Please consider adding additional comments, pertinent links, or additional information to all your descriptions. Maybe include a diagram or two.

OBSERVATION. All calculators. At the top of each calculator: Left side – calculate a given b; Center – the variable calculation; Right side – the variables used.
COMMENT. Add units to the lists of variables used. For example, change “d = distance” to “d = distance (m)”; or change from “θ = angle; the angle of incidence” to “θ = angle; the angle of incidence, +/-2pi radians”.

OBSERVATION. Graph of force vs angle F = W/dcos(θ) is surprising. Any comment?

OBSERVATION. Energy Graphs: Graph of energy vs mass and Graph of mass vs energy, vertical axii numeric decimals includes 15 or more zeros.
COMMENT. Please reformat in order to eliminate the zeros (if possible), such as you’ve formatted the mass and force vertical axii values in the Newtonian Gravity Graphs.

COMMENT. How far do your plans go? Do you want R code for all the calculators?
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu May 25, 2017 1:10 am

LongtimeAirman wrote:
LOCATION. Nevyn's Lab - Graphing Calculators – Acceleration.
Graph of velocity vs acceleration and Graph of velocity vs time both show v = d/t.
COMMENT. Change "d = vt" to "v = at".

Ah, a copy/paste error. I try to catch them but miss the odd one or two.

LongtimeAirman wrote:
LOCATION. Nevyn's Lab - Graphing Calculators - Spin Level Velocity and other locations in the Angular Motion section.
QUOTE. The definition of Angular Velocity used by these calculators is that of Miles Mathis. Please read that paper to understand the difference.
COMMENT. Please consider changing (the first hyperlink is changed and another hyperlink is added) these two sentences to: The definition of Angular Velocity used by these calculators can be found in Angular Velocity and Angular Momentum by Miles Mathis. That paper corrects the historical misuse of these terms.

That's a much better description.

LongtimeAirman wrote:
OBSERVATION. On all calculator pages, just below the title. A brief description is included. The longest and best description (in my opinion), including a hyperlink, is given for the Spin Level Velocity Graphs. Under Momentum Graphs, we have – “These calculators can be used to generate data using mass, velocity and momentum”. The description for Expanded Gravity Graphs is – “These calculators can be used to generate data using density, volume, radius and force” even though this section contains 30 individual graph/calculators – many I haven’t figured out or properly reviewed. The same is also true for - Charge Expanded Graphs – 30 calculators with little description.
COMMENT. Please consider adding additional comments, pertinent links, or additional information to all your descriptions. Maybe include a diagram or two.

I know. I know. I, generally, go through two phases as I develop. I start out building things to make it all work as I want. Then I start to add content to it. This usually causes more building work as I realise that I need things to work a different way for a certain part. Then I add more content. Rinse and repeat. When I am in the adding content phase, I am not thinking too closely about things like descriptions. I do look at them, but only enough to change what is already there (where I copied it from another equation) so that it makes sense for the new equation. Sometimes I do identify equations that need more detail, but it is the wrong time to look into it because I am focused on other things. I haven't put much effort into the third phase which is polishing. Writing nice descriptions, formatting values, etc.

LongtimeAirman wrote:
OBSERVATION. All calculators. At the top of each calculator: Left side – calculate a given b; Center – the variable calculation; Right side – the variables used.
COMMENT. Add units to the lists of variables used. For example, change “d = distance” to “d = distance (m)”; or change from “θ = angle; the angle of incidence” to “θ = angle; the angle of incidence, +/-2pi radians”.

I have not included units except where it is impossible not to, such as constants. The reason is that equations express relationships, not units. You should be able to use an equation with whatever units you want, as long as they relate to how the variable is used in the equation. You can't replace a meter with a second, but you can replace a meter with a kilometer as long as any other variable that uses distance is also specified in km or km/s or whatever applies to that variable. The equations themselves should be unit-agnostic, or maybe I should say they are unit-scale-agnostic. If there is a constant in the equation, then the units do get set by that constant. I will see if I can handle that when applicable while leaving the equations without units when not. I could also specify the units in a scale-agnostic manner, such as a suggestion like: r = radius (m, km , etc). There isn't much space to add this though, so I will need to find what can be done with the little space available.

LongtimeAirman wrote:
OBSERVATION. Graph of force vs angle F = W/dcos(θ) is surprising. Any comment?

I want to add a description to that equation to help explain what that angle is. It really needs a picture to go with it but I haven't found a good one yet, and haven't put any time into making one myself.

The angle expresses the relationship between the force and the distance. When θ is 0, then there is no difference and the force points in the same direction as the distance (cos(0)=1). When θ = 90°, then the force is at 90° to the distance so if the distance was along the surface of the earth, then this force would be coming straight down (like gravity) (cos(90)=0). That produces no work because the force and distance are not in the same dimension and no component of either is in the same dimension. When θ is 180° then the force and distance are opposite each other so we get negative work. When θ is 270°, the force is pointing up (like the Earth's charge field) but the distance is still along the surface so we get no work (cos(270)=0).

So that graph is just telling us that as we change the angle of the applied force, the amount of work done creates a wave between full force, no force, opposite full force, no force.

I was pretty surprised when I saw it too, but after I looked at the equation and thought about what that angle was doing, I realised that it made perfect sense.

LongtimeAirman wrote:
OBSERVATION. Energy Graphs: Graph of energy vs mass and Graph of mass vs energy, vertical axii numeric decimals includes 15 or more zeros.
COMMENT. Please reformat in order to eliminate the zeros (if possible), such as you’ve formatted the mass and force vertical axii values in the Newtonian Gravity Graphs.

Yes, I need to set a lot of these formatters. It is easy to do but what I don't like is that the default values are usually just integers. So if I make them all into scientific notation, then they look horrible. However, if the user puts in their own values, then they are not likely to be integers anymore, so I think I just need to make everything into scientific notation.

I did try to write a smart formatter that would look at the specific value and choose how to format it. It didn't work out quite as well as I wanted but I should put some more effort into it.

LongtimeAirman wrote:
COMMENT. How far do your plans go? Do you want R code for all the calculators?
.

I'll add in any equation that I think deserves to be there. After I added in the Motion, Angular Motion and Force subjects, I thought I was done. My mind wasn't quite ready to let it go, though. So I kept working on the style of the page and the code generators, etc. Then something, I think it might have been Lloyd's recent list of Mathis concepts, reminded me about gravity, so I added in those equations and the expanded versions that Miles' has described. Then I remembered Miles' gravity work in the Moon Gives Up a Secret paper and I had provided some code relating to that on this forum a while ago. So I found the thread and looked over the code and am working on adding that in at the moment. I have added the complete equation that gives you the gravity, and its rearrangements, as well as parts of that equation to calculate the gravity from just a radius and density and also the charge field given the radius and density.

After that, I don't know. I have looked over a few of Miles' papers to try to find equations to add but haven't found many. This doesn't just apply to Miles' equations though, so I am open to any physics equations that are helpful. I was thinking about putting in some electrical equations but the most useful ones have an arbitrary number of sections which makes it difficult to deal with. For example, to work out the capacitance of many capacitors in series, you use the equation 1/C = 1/C1 + 1/C2 + ... + 1/Cn. I thought about just picking a number, say 3 or 5, but it didn't seem worth it. Maybe I need a different type of calculator to handle that type of equation.

No, I don't expect anyone to convert all of these equations into R. What I need is the surrounding code, not the equations themselves. Each equation has custom code to implement it, but the surrounding code is common to all equations. I can figure out the custom R code for each equation but I don't know enough about R to write the common code just yet. If you look at the generated Javascript code, ignoring some of the funky things I have done such as using closures, you'll find that each section contains the same structure and even some of the functions (specifically the graphing functions) are very much the same, they just call a different function to calculate the data. R seems to be a little different because the language is aimed at plotting graphs, so I actually think the common code will be easier in R than in Javascript or Java. I just haven't put any time into it, though. Your R code helped me to see what I needed so I just need to spend a bit of time working with R to get a feel for the syntax and how it wants me to setup the data.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu May 25, 2017 1:51 am

It may not be obvious, but certain parts of these calculator pages disappear if you are on a small device. This is done to make the page work better when there isn't much resolution. Things like the code generator buttons and the variable lists will be hidden when the width is less than 768 pixels. The input fields also stack rather than being shown in columns. I've spent a fair bit of time making sure that the pages work at various resolutions.

I have also found that the calculators don't allow the user to enter a value on my phone, even though the graphing calculators do. I think this is related to the page structure but I only found it the other day and haven't tracked down the problem yet.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu May 25, 2017 1:58 am

Sorry, Airman, I have replied about the wrong graph!

LongtimeAirman wrote:OBSERVATION. Graph of force vs angle F = W/dcos(θ) is surprising. Any comment?

This graph, and the distance vs angle graph, work quite strangely and I think this is because the angle does not change the force or distance. It changes how the force is applied, but not the value of the force. It needs looking into. I might drop these equations all together.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Updating

Post by LongtimeAirman Wed May 31, 2017 6:20 pm

.
From http://www.nevyns-lab.com/mathis/math/graphs.php I cannot get to the graphing calculators. In firefox the page is blank. In chrome and IE I get HTTP error 500. I can go to the non-graphing calculators.

I replaced my initial draft Angular and Angle Velocity Functions R code above https://milesmathis.forumotion.com/t315-calculators-and-converters#2592 with many corrections, including plot titles.
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 31, 2017 6:53 pm

Thanks, Airman, I have fixed that now. I had actually fixed that problem in my dev environment, but when I checked the site it didn't show the symptoms, so I left it. I didn't realise that I had actually copied the code over to the server but hadn't deployed it. When I made a small change to another page yesterday, it deployed those changes as well.

What is the last line doing in this function:

Code:

wvsradius <- function(){
  w1 <- 0:10
  r1 <- 1:10
  v1 <- c(10,10,10,10,10,10,10,10,10,10)
  for(i in r1){
    w1<- sqrt(2*r1*sqrt((v1*v1)+(r1*r1))-2*r1*r1)
  }
  plot(r1,w1,main = "omega(w) vs. radius(r)\nw = sqrt(2rsqrt(v^2+r^2)-2r^2)")
  w1
}

It just specifies the main variable. Is that deleting it? Does that return it from the function?
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty What is w1?

Post by LongtimeAirman Wed May 31, 2017 7:19 pm

.
What is w1? w1 tells the function wvsradius to list the w variables calculated. My plot area shows the plot. The console shows:
Code:
> wvsradius()
 [1] 4.254380 5.726444 6.681455 7.359527 7.861514 8.242745 8.537668 8.769263
 [9] 8.953504 9.101797
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 31, 2017 8:32 pm

Do you need to list the functions at the end or is that just invoking them?

Code:

###########################################
#
# Function List
#

wvsradius()
wvsvelocity()
vvsradiusw()
vvsomega()
rvsvelocityw()
rvsomega()

avsradius()
avsvelocity()
vvsradiusa()
vvsangle()
rvsvelocitya()
rvsangle()
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by LongtimeAirman Wed May 31, 2017 9:03 pm

.
The functions don't need to be listed. They are grouped for convenience. I use that list to invoke the function I want since my memory isn't good enough to just type them directly. Of course the other variables need to be reviewed or adjusted before  
the function is run.
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 31, 2017 10:01 pm

Cool, thanks. I have the start of an R code generator working. I just took the javascript generator and converted it into R code. The graphing functions still need work but the structure is working as I want it to. It only works on the Velocity calculator as I need to add in the R code for each equation in the database and I have only done that one so far. I am just using Velocity as my testing ground.

You can have a look at it here: http://www.nevyns-lab.com/mathis/math/lib-r.php?type=velocity&equation=velocity

The calc* functions should be usable, but the calc*Vs* ones are not, they are still mostly javascript code.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed May 31, 2017 11:48 pm

I made some updates to the R code generator so that the functions are legal syntax and working. I have also added another function to plot the graph, using appropriate labels.

I copied the code into R and it ran beautifully.

If anyone has any other ideas on what could be possible in R (or any language), then post them and I will see what I can do. This covers what the other languages do and is probably enough, but if I can provide more then I am happy to do so.

I now have to write R versions of all of the equations. This should be fairly straight forward, but some of the complicated equations may cause slight nausea. Once that is done, I can add R as a language to the code generation buttons. I might even look into making those buttons dynamic such that they look to see what languages a particular equation has, and only supplies links to those languages.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu Jun 01, 2017 1:22 am

I have now done all of the motion and angular motion equations. Found and fixed a few bugs while I was testing them.

Motion: http://www.nevyns-lab.com/mathis/math/lib-r.php?subject=motion
Angular Motion: http://www.nevyns-lab.com/mathis/math/lib-r.php?subject=angular_motion
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu Jun 01, 2017 6:34 pm

I am proud to announce the official release of the R Code Generator!

You can now access R code for any equation from the code generation buttons.
I also found and fixed a bug where it didn't limit the generated code to a specified equation. This happened because I took some common code from all of these calculator pages and put it into a library. I missed the target equation part of that when I did it, but all is fixed now.
As I copied the Java code to convert it into R code, I found a few errors in that as well. They were caused by copying the Javascript code to convert it into Java and missing some variable datatypes.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Gute Stoff hombre

Post by LongtimeAirman Sat Jun 03, 2017 11:46 am

.
Nevyn, I think you've made quite an accomplishment. Hard for me to put it better because I'm still stunned. I've used and started reviewing your code, since I won't understand it otherwise. Even though you may have minimal experience in R I'm sure your work follows best practices and so it absolutely requires study. I must admit, my time and psyche are stretched a bit thin lately but you're providing positive guidance. Gute Stoff hombre.  
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Cr6 Sun Jun 04, 2017 2:23 am

Nevyn wrote:I am proud to announce the official release of the R Code Generator!

You can now access R code for any equation from the code generation buttons.
I also found and fixed a bug where it didn't limit the generated code to a specified equation. This happened because I took some common code from all of these calculator pages and put it into a library. I missed the target equation part of that when I did it, but all is fixed now.
As I copied the Java code to convert it into R code, I found a few errors in that as well. They were caused by copying the Javascript code to convert it into Java and missing some variable datatypes.

I must concur with LTAM...very cool Nevyn!

Cr6
Admin

Posts : 1178
Join date : 2014-08-09

https://milesmathis.forumotion.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Sun Jun 04, 2017 8:57 am

I don't know enough about R to know if I have used best practices or not. There really is minimal code though, so it shouldn't be too bad. That code is just repeated for each equation so it ends up looking like a lot of code. I found better ways in R to sequence the values when creating graph data, so I made use of that and restructured the rest. The graph labels were a bit tricky but I found a way to create the label array and pass the reference back to the caller.

I don't really like the function names. They are too long, especially for R. I wrote them that way to be consistent with the other languages. I have managed to keep the same function signatures across 4 languages, which is no mean feat. I think I will remove the first namespace though. I used it for Javascript and kept it across the other languages. It works well in Java too, but it just makes the function names too long in R and C, which I am currently working on.

By the way, you can add another parameter to the url to get some debug code. Just append &debug=true if there are existing parameters, or add ?debug=true if there are none.

http://www.nevyns-lab.com/mathis/math/lib-r.php?subject=angular_motion&debug=true

http://www.nevyns-lab.com/mathis/math/lib-r.php?debug=true

This is really helpful for me in R because I can paste in the code and then just call Equations.test() and it will generate every graph using the same parameters as my web pages. If there is an error anywhere in the code, it will fail and give me some idea of where the problem is.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Solar System Properties

Post by Nevyn Mon Jun 05, 2017 7:17 pm

I have another treat for you all!

I extended the calculators database to include solar system bodies which I then use to present and calculate various properties of those bodies in a table. A second table allows you to find the relative values of those properties by comparing each body to a selected base body.

This is helpful for a lot of Miles' papers where he uses these relative values.

http://www.nevyns-lab.com/mathis/math/solar-system.php
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Interactive solar system diagram?

Post by LongtimeAirman Tue Jun 06, 2017 11:19 am

.
Nevyn, You’re on a roll. Just this morning, I see an update.
PAPER UPDATE, added 6/2/17, The Cause of the Solar Cycles http://milesmathis.com/cycle.pdf . A reader has tracked the declination cycles of the big-four planets against sunspot activity in two charts, showing an almost perfect correlation. See end of paper.

Please consider creating an adjustable solar system with interactive diagram. Where we can observe the just Earth/Moon, or the Jovians and see the field strengths or interactions between bodies. What do you think? Don't go running off and building it without talking about it first!
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue Jun 06, 2017 8:51 pm

Well that kind of ties into what I am doing at the moment. I am adding a new section to the solar system page that calculates the distance of the magnetopause of each planet. It puts that data into a table, but I have thoughts on using that data to feed an animation of some kind. I'm not too sure of the details at this stage. I'm still working out the math for the magnetopause calculations. I have figures that are what I expect but am not entirely confident in the math to get them. I have to translate Miles' words into equations and then figure out how to put those equations together to get the data I want. It's not easy.

The main thing that is tripping me up is the 1/r^4 drop-off of charge density from a bodies surface. I was taking that r to mean a radius, but it turns out that it is not exactly a radius, but the coefficient of the radius. That is, r does not equal some distance. The actual distance is r * bodies radius. But then you have one side of the equation using the Sun's radius and the other side using the planets radius and I need to find where they are equal. Anyway, I am pretty close and the values coming out are what I expect but I am not too sure about the distance I am using in the equations.

In my previous attempts I was trying to use the absolute distance between the bodies surfaces and I think I still need to use that, but I'm not convinced that the equation I have developed is using it correctly. I redeveloped the equations and it used a distance variable and, not thinking clearly, I used the distance I already had and the values come out right but on closer inspection I don't think it is the right distance for that equation or, more likely, I need to redevelop the equation to use the right distance. My guess is that the current values are wrong, but only slightly which is because the distance I am using is only slightly bigger than the distance the equation wants.

I'll just keep working through it until it makes sense.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Magnetopause Eh?

Post by LongtimeAirman Tue Jun 06, 2017 9:53 pm

.
I am adding a new section to the solar system page that calculates the distance of the magnetopause of each planet.
Sounds interesting. I guess there must be a large dominant E/M field - the Sun - that interacts with the Earth E/M field. What is the magnetopause used for? How do you define it? Is it a single boundary or one of many Charge field equal strength contour surfaces? If I follow you, I see the magnetopause extends in a flame-like column far beyond the planets' orbits; almost out to the next orbiting body. If so, I believe it would be very unhealthy to pass under the magnetopause of Venus. EU cataclysm stuff.

When I was programming boids I tried to model the charge field E/M emissions about each particle (planet) as a D field function, a dual torus. So that normal approaches directly in toward the poles experienced the least emission resistance; most emission resistance would occur at +/-30. Does that even sound vaguely ...? I'll be ok.
.

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Tue Jun 06, 2017 10:22 pm

Yes, the magnetopause is really just an expression of the charge-pause. That is, the distance where the planet charge density equals that of the dominant body, the Sun in our case. The charge-pause is fairly constant but the magnetopause can vary slightly. It will always average out to the charge pause, but the magnetopause relies on ions being present but the charge-pause does not. Which is just to say that you need ions to measure magnetism. The underlying magnetism is still there, but we won't be able to see it without the ions.

I don't think the magnetopause is used for anything, it is just something we found when we started to orbit the Earth. Of course, it does protect us from the Solar Wind, but I don't know if humans are using it for anything explicitly.

The magnetopause is just the distance from a planet, or body, where its own magnetic field stops and the magnetic field of the dominant body starts, from the perspective of that planet. It is the point where the charge from each body cancels each other. It is always an interaction between two bodies. It requires two charge fields in opposition which means we are calculating the minimum radius of the magnetopause (in a direct line between the two bodies) and not the radius to the sides or rear. The so-called tail does stretch a long way and this is the result of the two charge streams merging at the sides and also because the planet blocks the Suns charge from that area so its own charge field can use it almost freely. We may find that other planets that are in higher orbits actually squash that tail a bit when they are inline with the planet and Sun.

I don't think it will be a problem to pass through another planets charge sheath. It would be if we didn't have our own, but the Earth's charge field can block the Sun's charge, so it will have no problem with that of Venus or even a Jovian. Of course, that depends on the distance. If we were very close to Jupiter we might have something to worry about but then again, Mercury can withstand the Sun at its distance and it is a lot smaller than the Earth (38% of it according to some informative web site I just happened to find Very Happy).
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed Jun 07, 2017 12:11 am

This is the source material that I am working with:

Miles Mathis wrote:
Wiki tells us that the magnetopause is 10-12 earth radii in the direction of the Sun. Using my mechanics, we can calculate that distance directly—something the standard model never does and cannot do. The mass of the Sun is 332,990 Earth's and its density is .255 Earth's. We seek a charge density on the surface of the Sun, and we can get that by just looking at the words. We seek a “charge density”. That could be written “charge x density”, and, as I have shown, charge is just a variant definition of mass. Therefore, we re-write the product as “mass x density.” M x D = 84,986. The Sun's charge density is 84,986 times that of the Earth. So we find by simple math that the charge field density is vastly different than the material density. We are finding the charge field density at the surface of the Sun, so we must sum all the mass “behind” that surface. All that mass emits charge photons.

Now we seek the point between Earth and Sun where the two charge densities are equal. Since I have proved elsewhere that the charge field, when emitted by spheres, diminishes as 1/r4, we can solve. If the Sun's relative charge density is 84,986 at 1 Sun radius, at 214 Sun radii it will be .00004052. If the Earth's density is 1 at 1 Earth radius, at 12.53 Earth radii it will be .00004057. That is where the charge field strengths match. Since Wiki is measuring from the Earth's surface, we must subtract one Earth radius, giving us 11.53 Earth radii for the charge-pause.

It does sound pretty simple, but you have to be careful with these relative values. They don't always mean what you think they mean. In this case, I had to realise that the Sun's charge was expressed in Sun radii and the planets charge was expressed in its own radii. Now I just need to find a way to link them together so that I can solve one equation with two unknowns. If I can get that working, I will attempt to remove all of the relative values and see if I can find an equation using straight radii values.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Solar System

Post by LongtimeAirman Wed Jun 07, 2017 2:27 pm

.
First, I see that my firefox displays http://www.nevyns-lab.com/ properly. I haven’t checked since our last go round. Did you make a fix or I’ll just be grateful that being slow is better than never.

At http://www.nevyns-lab.com/mathis/math/solar-system.php . Looking at General Properties.
Please confirm your mass values. You show the Sun Mass to be 1.989e+24. I believe that number should be 1,988,500e+24. Likewise, Earth Mass is shown to be 5.993e+18, shouldn’t that be – 5.993e+24? If that column is off, then the Charge Density column is off too.

Miles has shown how the planetary tilt is a function of the charge field. I guess you’ll enter orbital data at some point. Aren't all orbits ellipses?

And all the moons!

I believe I recall seeing your solar system model, I may very well be confused. I don’t recall any problem with it, the scale was daunting (large spaces between tiny bodies). I believe Jared cited a solar system simulator in one of our discussions (maybe Saturn).

A charge field based solar system is a fine goal.

P.S. I think I see that each magnetopause must be calculated with greatly varying charge density values. The sun's field strength diminishes greatly as approach the edge the solar system. At the edge we can have very isolated and cold bodies.
.


Last edited by LongtimeAirman on Wed Jun 07, 2017 3:08 pm; edited 1 time in total (Reason for editing : Added PS)

LongtimeAirman
Admin

Posts : 2080
Join date : 2014-08-10

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Wed Jun 07, 2017 7:27 pm

I have made various changes to the main page, but I don't know what I did to fix your issue. I just added a cache manifest file so that the images in the main page are cached in your browser. This should make that page load faster after the images are cached. I have also been thinking of removing all of the apps from the main page and put them into an Applications page or something like that. This would reduce the number of sections and hence the number of images to load.

The Sun's mass is slightly different because the radius and density values are slightly different. The values may also be rounded. Be careful of the units too. I have converted all of my values to use the same units and I chose km instead of m and the density is often specified in kg/m^3 where-as I am using kg/km^3. This will change the position of the decimal place. Maybe I didn't convert the density correctly, I'll check it.

I had access to the orbital data and thought about putting it in the database for future use, but I'm not sure what I want to do with it yet so I didn't.

Another section for tilt would be a good idea. I think the tilt includes the influences from other bodies, not just the Sun, so I will have to see what I can do about that. If so, then you can only get a value for tilt for a specific time because the layout of the planets becomes important. I'll look into it once I get the magnetopause data working.

If I can get these data tables working for the various equations needed to specify orbits, then I can figure out how to put that all into an app and get a fully functional Mathis Orbital Simulator. That really would be an awesome outcome.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Nevyn Thu Jun 08, 2017 12:33 am

I have miscalculated the density conversions. I naively converted kg/m^3 into kg/km^3 by multiplying by 1000, the ratio of a km to a m. What I should have done is multiplied by 1000^3, so all of my density values are off by a million. I'll fix that later tonight.

This does not affect the relative values, since they are, well, relative! As long as both parts of the ratio are off by the same factor, it will still give the same answer.
Nevyn
Nevyn
Admin

Posts : 1887
Join date : 2014-09-11
Location : Australia

http://www.nevyns-lab.com

Back to top Go down

Calculators and Converters Empty Re: Calculators and Converters

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum