// ///////////////////////// non accetta il meno - ///////////////////////////////////////////////////////////// function onlynumber(field) { if (isNaN(field.value)) { alert("Si accettano solo valori numerici e per i decimali il punto"); field.value=field.value.substr(0, field.value.length- 1); } } // ///////////////////////// ok non accetta il meno - ///////////////////////////////////////////////////////////// function go(input1, input2, input3, input4, input5, input10) // //////////////////////// inserire //////////////////////////// { // APERTO 1-------------------------------------------- // INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT------- // INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT-------- // INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT--------INPUT-------- P = input1 Lo = input2 A = input3 Jmin= input4 sSnerv= input5 decima = input10 // 10 perchè non dovrei usarlo mai // var x; // FUNZIONA // if (tot < samm) { // se la x è < di 2 scatta il messaggio // alert("ERRORE: L'importo totale deve essere maggiore dell'imponibile"); // document.form1.answer1.value= "---------------------" // return // return serve per bloccare il flusso dei risultati, cioè non te li fa vedere // } // /////////////////////////solo dimostrativo///////////////////////////////////////// { alert("Questo è un dimostrativo quindi non svolge i calcoli ma serve per visionare procedure e tipo di risultati. - Se lo trovi utile e vuoi svolgere i calcoli online, vai a www.calcoli-online.it e abbonati a soli 10 euro all'anno. - non perdere tempo -"); return } // /////////////////////////fine solo dimostrativo///////////////////////////////// // FORMULE----------FORMULE----------FORMULE----------FORMULE----------FORMULE-- // FORMULE----------FORMULE----------FORMULE----------FORMULE----------FORMULE-- // FORMULE----------FORMULE----------FORMULE----------FORMULE----------FORMULE- // pi =Math.PI // Math.sqrt(80) // Lambda=3 // aa=Jmin/A roMin=Math.sqrt(Jmin/A) LaNormale=Lo/roMin if (LaNormale > 250) { alert("ERRORE: Lambda deve essere < di 250"); // return } LaSottolineata1=LaNormale*10/93.9 // questa è (La Lambda sottolineata) per acciaio S235 LaSottolineata=Math.ceil(LaSottolineata1) // per arrotondare all'intero superiore LaInf = Math.floor(LaSottolineata-1) // PER PRENDERE IL VALORE PRECEDENTE (inferiore) // deve essere una cifra decimale sola chè La ha un decimale solo if (LaSottolineata>30 || LaInf <=0) { // se la x è < di 2 scatta il messaggio alert("ERRORE: Lambda (con trattino) è > di 3 oppure Lambda <= 0"); document.form1.answer1.value= "---------------------" document.form1.answer2.value= "---------------------" document.form1.answer3.value= "---------------------" document.form1.answer4.value= "---------------------" document.form1.answer5.value= "---------------------" document.form1.answer6.value= "---------------------" document.form1.answer7.value= "---------------------" document.form1.answer8.value= "---------------------" document.form1.answer9.value= "---------------------" document.form1.answer10.value= "---------------------" document.form1.answer11.value= "---------------------" document.form1.answer12.value= "---------------------" return // return serve per bloccare il flusso dei risultati, cioè non te li fa vedere } omeg = new Array(); // curva "c" per HEB omeg [1] = 1; omeg [2] = 1; omeg [3] = 0.949; omeg [4] = 0.897; omeg [5] = 0.843; omeg [6] = 0.785; omeg [7] = 0.725; omeg [8] = 0.662; omeg [9] = 0.600; omeg [10] = 0.540; omeg [11] = 0.484; omeg [12] = 0.434; omeg [13] = 0.389; omeg [14] = 0.349; omeg [15] = 0.315; omeg [16] = 0.284; omeg [17] = 0.258; omeg [18] = 0.235; omeg [19] = 0.214; omeg [20] = 0.196; omeg [21] = 0.180; omeg [22] = 0.166; omeg [23] = 0.154; omeg [24] = 0.143; omeg [25] = 0.132; omeg [26] = 0.123; omeg [27] = 0.115; omeg [28] = 0.108; omeg [29] = 0.101; omeg [30] = 0.095; // ---------- interpolazione ----------------------------------------------- chiSup=(omeg [LaSottolineata]) chiInf =(omeg [LaInf]) LaSup=LaSottolineata La=LaSottolineata1/10 La1=LaInf /10 La2=LaSup/10 X1=chiInf X2=chiSup chi=X1 + ((X2 - X1) * (La - La1) / (La2 - La1)) // ---------- fine di segue interpolazione ------------------------------ LaSottolineataVedo=LaSottolineata1/10 Pmax1=chi*A*100*sSnerv/1.05 // in N Pmax=Pmax1/1000 // kN if (P > Pmax) { // se la x è < di 2 scatta il messaggio alert("ERRORE: Nsd = P da verificare è > di quello critico (ammissibile)"); // document.form1.answer1.value= "---------------------" // return // return serve per bloccare il flusso dei risultati, cioè non te li fa vedere } // per vedere in KG a destra PmaxKg= Pmax*100 PKg= P*100 //PmaxKg= Math.floor(0.3) // arrotonda un numero decimale all'intero inferiore; //PKg= Math.ceil(3.15451245) // P*100 // arrotonda un numero decimale all'intero superiore; Math.ceil(3.7); // 4 if (chiX1) { alert("ERRORE: errore di sistema - scusate"); document.form1.answer1.value= "---------------------" document.form1.answer2.value= "---------------------" document.form1.answer3.value= "---------------------" document.form1.answer4.value= "---------------------" document.form1.answer5.value= "---------------------" document.form1.answer6.value= "---------------------" document.form1.answer7.value= "---------------------" document.form1.answer8.value= "---------------------" document.form1.answer9.value= "---------------------" document.form1.answer10.value= "---------------------" document.form1.answer11.value= "---------------------" document.form1.answer12.value= "---------------------" // return // return serve per bloccare il flusso dei risultati, cioè non te li fa vedere } // per i decimali ------------ si riferisce ai risultati ----------- chi=chi.toFixed(decima+1) roMin=roMin.toFixed(decima) LaNormale=LaNormale.toFixed(decima) LaSottolineataVedo=LaSottolineataVedo.toFixed(decima+2) Pmax =Pmax.toFixed(decima) La=La.toFixed(decima+2) PmaxKg=PmaxKg.toFixed(decima) { // APERTO 2-------------------------------------------- document.form1.answer1.value= chi // si riferisce ai risultati document.form1.answer2.value= roMin document.form1.answer3.value= LaNormale document.form1.answer4.value= LaSottolineataVedo document.form1.answer5.value= Pmax document.form1.answer6.value= La document.form1.answer7.value= La1 document.form1.answer8.value= La2 document.form1.answer9.value= X1 document.form1.answer10.value= X2 document.form1.answer11.value= PKg document.form1.answer12.value= PmaxKg } // CHIUSO 2-------------------------------------------- } // CHIUSO 1--------------------------------------------