calculate specific cutting forces in end-milling

Watchkido1

Active Member
Licensed User
Longtime User
Hello

In school, we calculate specific cutting forces in end-milling.
The teacher gives us only 2 of the 19 symbols.
We have 38 formulas to calculate the results.

Enclosed is a page from the formulary, and a xls table.

In school, I would sign a formal release after another.
What do I want my program is, one side (as here) that calculates me all at once.

The problem I have is the algorithm.
I want to here from anyone who wrote a program. I do not want a program!
I just need a tip how I can successively calculate all the formulas.

Problem: the teacher gives us always 2 OTHER symbols.
So I have to use all the formulas out there. During the then very many if .. Then Loops

How do they do this thing?
Here, I give three values​​, and all others are calculated.

Does anyone have any advice?
an idea where to look to?
What do you call something like: multi-input selection input calculation?

Thanks for the help

Frank

------------German-----------

Hallo

In der Schule berechnen wir spezifische Schnittkräfte beim Stirn-Planfräsen.
Der Lehrer gibt uns nur 2 der 19 Formelzeichen.
Wir haben 38 Formeln, um die Ergebnisse zu berechnen.

Anbei eine Seite aus dem Formelbuch, und eine xls Tabelle.

In der Schule würde ich ein formelzeichen nach dem anderen lösen.
Was ich mir Programmieren will, ist eine Seite (wie hier) die mir alles auf einmal ausrechnet.

Das Problem das ich habe ist der Algorythmus.
Ich will hier von niemandem ein Program geschrieben haben.
Ich brauche nur einen tipp wie ich die Formeln alle nacheinander berechnen kann.

Problem: der Lehrer gibt uns immer 2 ANDERE Formelzeichen.
Ich muss also alle Formeln nutzen die es gibt. Das währen dann sehr viele if..Then Loops

Wie machen die hier sowas?
Ich gebe hier 3 werte ein und alle anderen werden errechnet.

Hat jemand einen Tipp?
eine idee wo sich nachschauen kann?
wie nennt man sowas: Multi-Input-Auswahl-Eingabe-Berechnung?

Danke für die Hilfe
 
Last edited:

mc73

Well-Known Member
Licensed User
Longtime User
It would help if you could upload the xls with the formulas included, since opening it with google gives just a representation.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
That's much better. Now, can you please tell me, all variables can be calculated by a pair of variables?
 
Upvote 0

Watchkido1

Active Member
Licensed User
Longtime User
Yes

That's much better. Now, can you please tell me, all variables can be calculated by a pair of variables?

yes
But some are worth it from a book of tables.
These can be programmed into it.
with selection fields
e.g.
efficiency
metal composition
specific cutting force
...
---------------------------------
ja
allerdings gehören einige werte aus einem Tabellenbuch dazu.
Diese kann man hinein programmieren.
mit auswahlfeldern
z.B.
Wirkungsgrad
Metall zusammensetzung
spezifische Schnittkraft
...
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Unfortunately, for now, I don't see other than the hard way of calculating two basic variables, from the combinations of all others. After this basic calculation, you can use the formulas to calculate all other variables based on the first two basic variables. I know it would take 153 combinations, yet, now i cannot think of a better way. Hopefully other friends in this forum, can provide a better advice.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
ok, I've created a small example which might be a bit useful. We have a rectangle, with sides a & b, and at the same time we have its surface, call it E.
Now, we know that E=ab, thus a=E/b, B=E/a.
We wish to input two variables, be it (a,b) or (a,E) or (b,E) so that the remaining variable is calculated. Of course, this can be done easily with some 'ifs', yet in the code I post below, I use a bif of different logic. Check it out, and if it's not very clear, please ask.
B4X:
'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.

    'These variables can only be accessed from this module.
    
    Dim texts(3) As EditText 
    Dim btn As Button 
End Sub

Sub Activity_Create(FirstTime As Boolean)
For k=0 To 2
    texts(k).Initialize ("texts")
    texts(k).Text=""
    Activity.AddView (texts(k),0,k*80,Activity.Width /2,50dip)
Next
btn.Initialize ("btn")
btn.Text="calc"
Activity.Addview (btn,0,4*80,Activity.Width /2,50dip)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub btn_click
calculate
End Sub
Sub calculate
Dim v(3) As Double
'a=v(0)
'b=v(1)
'E=v(2)
'a=E/b
'b=E/a
'E=ab
For k=0 To 2
    Try
        v(k)=texts(k).Text 
    Catch
        v(k)=0
    End Try
Next
' we construct all possible formula combinations
' first index is the variable we wish to calculate
' second and third index are the indexes of given variables
Dim formulas(3,3,3)
Try
    formulas(0,1,2)=v(2)/v(1)
    ' formulas(0,1,2)=formulas(a,b,E)=E/b
Catch
    formulas(0,1,2)=0
End Try
Try
    formulas(1,0,2)=v(2)/v(0)
Catch
    formulas(1,0,2)=v(2)/v(0)
End Try
Try
    formulas(2,0,1)=v(0)*v(1)
Catch
    formulas(2,0,1)=0
End Try

Dim BoxesFilled As String 
Dim boxesEmpty As String 
' here we find fields that are input by user and empty fields
For k=0 To 2
    If texts(k).Text.Length >0 Then
        BoxesFilled=BoxesFilled & k & ","
    Else
        boxesEmpty=boxesEmpty & k & ","
    End If
Next
If BoxesFilled.Length=6 OR BoxesFilled.Length <=2 Then
    Msgbox("Check your input","error")
    Return
Else
    Dim emptyFields() As String 
    Dim inputfields() As String 
    inputfields=Regex.split (",",BoxesFilled)
    For k=0 To 2
        If boxesEmpty.Contains (k) Then
            Dim tempVal As String 
            tempVal=formulas(k,inputfields(0),inputfields(1))
            texts(k).Text =tempVal
        End If
    Next
End If
End Sub

PS: I didn't go deeply in exception handling, thus you cannot trust outputs when they come to 0, since 0 can be a true value, but it can also be a result of exception handling.
 
Upvote 0

Watchkido1

Active Member
Licensed User
Longtime User
Now, we know that E=ab, a=E/b, B=E/a.

We have a rectangle, with sides a & b, and at the same time we have its surface, call it E.
Now, we know that E=ab, thus a=E/b, B=E/a.
We wish to input two variables, be it (a,b) or (a,E) or (b,E) so that the remaining variable is calculated.


That's perfect.
That was the idea that I needed.
80 percent of all formulas consist of 3 symbols.
All I can figure out with 1 sub
First E = a
Second a = e / b,
Third B = E / a

I can compose 10 percent of it.
There remain 10 percent Need formulas own subroutine.

So it is short and quick.
Now I'm suddenly a lot of good ideas
I say modest if I run into problems.

Thanks for the tip
That's perfect.

Frank





Das ist großartig.
Das war die idee die ich brauchte.
80 Prozent aller Formeln bestehen aus 3 Formelzeichen.
Die kann ich alle mit 1 Unterprogramm ausrechnen
1. E=ab
2. a=E/b,
3. B=E/a.

10 Prozent kann ich daraus zusammensetzen.
Es bleiben noch 10 prozent Formeln die ein eigenes Unterprogramm Brauchen.

So wird es Kurz und Schnell.
Jetzt hab ich plötzlich viel gute ideen
Ich sage bescheid wenn ich auf Probleme stoße.

Danke für den Tipp
das ist großartig.
 
Upvote 0
Top