• Distribución de Peso

    {source}

    <style>
    .grafArea {
    //width:800px;height:450px;
    position:relative;
    }

    .dimInputBoxes {
    width:48px;
    text-align: right; font-family: arial,helvetica,sans-serif; font-size: 10pt;
    }

    .tablaInputBoxes {
    width:120px;
    text-align: right; font-family: arial,helvetica,sans-serif; font-size: 10pt;
    }
    </style>

    <script type=”text/javascript”
    src=”https://www.google.com/jsapi?autoload={
    ‘modules’:[{
    ‘name’:’visualization’,
    ‘version’:’1′,
    ‘packages’:[‘corechart’]
    }]
    }”>
    </script>

    <script type=”text/javascript”>
    //google.load(‘visualization’, ‘1.1’, {packages: [‘line’]});
    google.setOnLoadCallback(calcularChasis);
    var tiposVeh = [‘Chasis’, ‘Semi’, ‘Tractor’];
    var pMaxEjes = [
    [1, ‘S’, ‘Simple’, 6000, 500],
    [1, ‘D’, ‘Dual’, 10500, 1000],
    [1, ‘SA’, ‘Superancha’, 8000, 1000],
    [2, ‘2S’, ‘Simple-Simple’, 10000, 1500],
    [2, ‘SD’, ‘Simple-Dual’, 14000, 1500],
    [2, ‘2D’, ‘Doble Dual’, 18000, 1500],
    [2, ‘2SA’, ‘Doble Superancha’, 16000, 1500],
    [3, ‘S2D’, ‘Simple-Dual-Dual’, 21000, 2000],
    [3, ‘3D’, ‘Triple Dual’, 25500, 2000],
    [3, ‘3SA’, ‘Triple Superancha’, 24000, 2000],
    ];

    function calcularChasis () {

    // Dimensiones

    var sepGrp1 = Number(document.getElementById(“sepGrp1input”).value);
    var sepGrp2 = Number(document.getElementById(“sepGrp2input”).value);
    var distGrp12 = Number(document.getElementById(“distGrp12input”).value);
    var distCarga0 = Number(document.getElementById(“distCarga0input”).value);
    var distCargaCG = 3400;
    var distCargaF = Number(document.getElementById(“distCargaFinput”).value);

    // Pesos
    var pMaxGrp1 = Number(document.getElementById(“Chasis1pMax”).value);
    var pTolGrp1 = Number(document.getElementById(“Chasis1pTol”).value);
    var pTarGrp1 = Number(document.getElementById(“Chasis1pTar”).value);
    var pMaxGrp2 = Number(document.getElementById(“Chasis2pMax”).value);
    var pTolGrp2 = Number(document.getElementById(“Chasis2pTol”).value);
    var pTarGrp2 = Number(document.getElementById(“Chasis2pTar”).value);
    var datosGrafico = [];

    for (var i = 0; i <= distCargaF/100; i++) {
    var dataSet0 = i*0.1;

    //Carga maxima permisible
    var dataSet1 = 0.001*Math.round((pMaxGrp1 + pMaxGrp2) – (pTarGrp1 + pTarGrp2));
    var dataSet6 = dataSet1;

    //Peso maximo eje delantero
    var dataSet2 = 0.001*Math.round((pMaxGrp1+pTolGrp1-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2/2)/(sepGrp1+distGrp12+sepGrp2/2-distCarga0-i*100));
    if (dataSet2 < 0) {
    dataSet2 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet2);
    }
    //Peso maximo eje trasero
    var dataSet3 = 0.001*Math.round((pMaxGrp2+pTolGrp2-pTarGrp2)*(sepGrp1/2+distGrp12+sepGrp2/2)/(distCarga0+i*100-sepGrp1/2));
    if (dataSet3 < 0) {
    dataSet3 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet3);
    }

    //Peso min eje delantero
    var pMin1 = 0.2;
    var dataSet4 = 0.001*Math.round(((pMin1*(pMaxGrp1+pMaxGrp2)-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2)+(pMaxGrp2-pTarGrp2)*(sepGrp2/2))/(sepGrp1+distGrp12+sepGrp2-distCarga0-i*100));
    if (dataSet4 < 0) {
    dataSet4 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet4);
    }

    //Peso min eje de tracción
    var pMin2 = 0.15;
    var n = 1;
    //var dataSet5 = 0.001*Math.round((pMin2*n*(pTarGrp1+pTarGrp2)-pTarGrp2)/(1-pMin2*n-((sepGrp1+distGrp12+sepGrp2/2-distCarga0-i*100)/(sepGrp1/2+distGrp12+sepGrp2/2))));
    var dataSet5 = 0.001*Math.round(((pMin2*n*(pMaxGrp1+pMaxGrp2)-pTarGrp2)*(sepGrp1+distGrp12+sepGrp2/2)+(pMaxGrp1-pTarGrp1)*(sepGrp1/2))/(distCarga0+i*100));
    //if (dataSet5 < 0) {
    // dataSet5 = null;
    //} else if (dataSet5 > dataSet6) {
    // dataSet6 = 0;
    //}

    datosGrafico.push([dataSet0, dataSet1, dataSet2, dataSet3, dataSet4, dataSet5, dataSet6]);
    }
    drawChart(datosGrafico,0,0.001*distCargaF);
    }

    function calcularTractor () {
    // Dimensiones
    var sepGrp1 = 0;
    var sepGrp2 = Number(document.getElementById(“Tractor2sep”).value);
    var distGrp12 = Number(document.getElementById(“distGrp12inputTractor”).value);
    //var distCarga0 = Number(document.getElementById(“distCarga0inputTractor”).value);
    //var distCargaCG = 3400;
    //var distCargaF = Number(document.getElementById(“distCargaFinput”).value);

    // Pesos
    var pMaxGrp1 = Number(document.getElementById(“Tractor1pMax”).value);
    var pTolGrp1 = Number(document.getElementById(“Tractor1pTol”).value);
    var pTarGrp1 = Number(document.getElementById(“Tractor1pTar”).value);
    var pMaxGrp2 = Number(document.getElementById(“Tractor2pMax”).value);
    var pTolGrp2 = Number(document.getElementById(“Tractor2pTol”).value);
    var pTarGrp2 = Number(document.getElementById(“Tractor2pTar”).value);
    var datosGrafico = [];

    for (var i = -20; i <= 20; i++) {
    var dataSet0 = i*0.1;

    //Carga maxima permisible
    var dataSet1 = 0.001*((pMaxGrp1 + pMaxGrp2) – (pTarGrp1 + pTarGrp2));
    var dataSet6 = dataSet1;

    //Peso maximo eje delantero
    var dataSet2 = 0.001*Math.round((pMaxGrp1+pTolGrp1-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2)/(sepGrp2-i*100));
    if (dataSet2 < 0) {
    dataSet2 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet2);
    }

    //Peso maximo eje trasero
    var dataSet3 = 0.001*Math.round((pMaxGrp2+pTolGrp2-pTarGrp2)*(sepGrp1+distGrp12+sepGrp2/2)/(sepGrp1+distGrp12+i*100));
    if (dataSet3 < 0) {
    dataSet3 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet3);
    }

    //Peso sobre eje delantero
    var pMin1 = 0.2;
    var dataSet4 = 0.001*Math.round(((pMin1*(pMaxGrp1+pMaxGrp2)-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2)+(pMaxGrp2-pTarGrp2)*(sepGrp2/2))/(sepGrp2-i*100));
    if (dataSet4 < 0) {
    dataSet4 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet4);
    }

    //Peso sobre eje de tracción
    var pMin2 = 0.2;
    var n = 1;
    var dataSet5=0.001*Math.round(((pMin2*(pMaxGrp1+pMaxGrp2)-pTarGrp2)*(sepGrp1+distGrp12+sepGrp2/2)+(pMaxGrp1-pTarGrp1)*(sepGrp1/2))/(sepGrp1+distGrp12+i*100));
    //if (dataSet5 < 0) {
    // var dataSet5 = null;
    //} else {
    // dataSet6 = Math.min(dataSet6, dataSet5);
    //}

    datosGrafico.push([dataSet0, dataSet1, dataSet2, dataSet3, dataSet4, dataSet5, dataSet6]);
    }
    drawChart(datosGrafico,-2,2);
    }

    function calcularSemi () {
    // Dimensiones
    var sepGrp1 = 0;
    var sepGrp2 = Number(document.getElementById(“Semi2sep”).value);
    var sepGrpL = 0;
    var sepGrp3 = Number(document.getElementById(“Semi3sep”).value);
    var distGrp12 = Number(document.getElementById(“distGrp12inputSemi”).value);
    var distGrp1R = Number(document.getElementById(“distGrp1RinputSemi”).value);
    var distGrpR3 = Number(document.getElementById(“distGrpR3inputSemi”).value);
    var distGrpL3 = Number(document.getElementById(“distGrpL3inputSemi”).value);
    var distCarga0 = Number(document.getElementById(“distCarga0inputSemi”).value);
    var distCargaCG = 3400;
    var distCargaF = Number(document.getElementById(“distCargaFinputSemi”).value);

    // Pesos
    var pMaxGrp1 = Number(document.getElementById(“Semi1pMax”).value);
    var pTolGrp1 = Number(document.getElementById(“Semi1pTol”).value);
    var pTarGrp1 = Number(document.getElementById(“Semi1pTar”).value);
    var pMaxGrp2 = Number(document.getElementById(“Semi2pMax”).value);
    var pTolGrp2 = Number(document.getElementById(“Semi2pTol”).value);
    var pTarGrp2 = Number(document.getElementById(“Semi2pTar”).value);
    var pMaxGrpL = Number(document.getElementById(“SemiLpMax”).value);
    var pTolGrpL = Number(document.getElementById(“SemiLpTol”).value);
    var pGrpL = Number(document.getElementById(“SemiLpCalc”).value);
    var pMaxGrp3 = Number(document.getElementById(“Semi3pMax”).value);
    var pTolGrp3 = Number(document.getElementById(“Semi3pTol”).value);
    var pTarGrp3 = Number(document.getElementById(“Semi3pTar”).value);
    var datosGrafico = [];

    //Calculo de la carga maxima transmisible al tractor
    //Carga maxima permisible
    var pMaxR = (pMaxGrp1 + pMaxGrp2) – (pTarGrp1 + pTarGrp2);
    //Peso maximo eje delantero
    var pMaxTest = (pMaxGrp1+pTolGrp1-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2)/(sepGrp2-distGrp1R);
    if (pMaxTest > 0) {
    pMaxR = Math.min(pMaxR, pMaxTest);
    }
    //Peso maximo eje trasero
    pMaxTest = (pMaxGrp2+pTolGrp2-pTarGrp2)*(sepGrp1+distGrp12+sepGrp2/2)/(sepGrp1+distGrp12+distGrp1R);
    if (pMaxTest > 0) {
    pMaxR = Math.min(pMaxR, pMaxTest);
    }
    //Peso sobre eje delantero
    var pMin1 = 0.2;
    pMaxTest = ((pMin1*(pMaxGrp1+pMaxGrp2)-pTarGrp1)*(sepGrp1/2+distGrp12+sepGrp2)+(pMaxGrp2-pTarGrp2)*(sepGrp2/2))/(sepGrp2-distGrp1R);
    if (pMaxTest > 0) {
    pMaxR = Math.min(pMaxR, pMaxTest);
    }

    for (var i = 0; i <= distCargaF/100; i++) {
    var dataSet0 = i*0.1;

    //Carga maxima permisible
    var dataSet1 = 0.001*Math.round((pMaxGrp1 + pMaxGrp2 + pMaxGrpL + pMaxGrp3) – (pTarGrp1 + pTarGrp2 + pTarGrp3));
    var dataSet6 = dataSet1;

    //Peso maximo tractor
    var dataSet2 = 0.001*Math.round((pMaxR*(distGrpR3+sepGrp3)+pGrpL*(sepGrpL/2+distGrpL3+sepGrp3)+(pMaxGrp3-pTarGrp3)*(sepGrp3/2))/(sepGrp3+distGrpR3+distCarga0-i*100));
    if (dataSet2 < 0) {
    dataSet2 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet2);
    }

    //Peso maximo grupo trasero
    var dataSet3 = 0.001*Math.round(((pMaxGrp3-pTarGrp3)*(distGrpR3-sepGrp3/2)+pGrpL*(distGrpR3-distGrpL3-sepGrpL/2))/(i*100-distCarga0));
    if (dataSet3 < 0) {
    dataSet3 = null;
    } else {
    dataSet6 = Math.min(dataSet6, dataSet3);
    }

    //Peso sobre eje delantero
    var pMin1 = 0.1;
    var dataSet4 = 0.001*Math.round((((pMaxGrp1/pMin1)-pTarGrp1-pTarGrp2)*(distGrpR3+sepGrp3)+pGrpL*(sepGrpL/2+distGrpL3+sepGrp3)+(pMaxGrp3-pTarGrp3)*(sepGrp3/2))/(sepGrp3+distGrpR3+distCarga0-i*100));
    //if (dataSet4 < 0) {
    // dataSet4 = null;
    //} else {
    // dataSet6 = Math.min(dataSet6, dataSet4);
    //}

    //Peso sobre eje de tracción
    var pMin2 = 0.2;
    var n = 1;
    var dataSet5=0.001*Math.round((pMin2*n*(pTarGrp1+pTarGrp2)-pTarGrp2)/(1-pMin2*n-((sepGrp1+distGrp12+sepGrp2/2-distCarga0-i*100)/(sepGrp1/2+distGrp12+sepGrp2/2))));
    //if (dataSet5 < 0) {
    // dataSet5 = null;
    //} else {
    // dataSet6 = Math.min(dataSet6, dataSet5);
    //}

    datosGrafico.push([dataSet0, dataSet1, dataSet2, dataSet3, dataSet4, dataSet5, dataSet6]);
    }
    drawChart(datosGrafico,0,0.001*distCargaF);
    }

    function drawChart(dataArray, hAxisMin, hAxisMax) {
    var data = new google.visualization.DataTable();
    data.addColumn(‘number’, ‘Distancia’);
    data.addColumn(‘number’, ‘Dummy’);
    data.addColumn(‘number’, ‘Max Permisible’);
    data.addColumn(‘number’, ‘Eje Delantero’);
    data.addColumn(‘number’, ‘Eje Trasero’);
    data.addColumn(‘number’, ‘Min Delantero’);
    data.addColumn(‘number’, ‘Min Tracción’);
    data.addColumn(‘number’, ‘Carga Máxima’);

    for (var i = 0; i < dataArray.length; i++) {
    data.addRow([dataArray[i][0], 0, dataArray[i][1], dataArray[i][2], dataArray[i][3], dataArray[i][4], dataArray[i][5], dataArray[i][6]]);
    }

    var options = {
    //chart: {
    // title: ‘Box Office Earnings in First Two Weeks of Opening’,
    // subtitle: ‘in millions of dollars (USD)’
    //},
    curveType: ‘function’,
    legend: {position: ‘none’},
    backgroundColor: { fill:’transparent’ },
    chartArea: {
    left: (document.getElementById(“distCarga0input”).value / 20) + 224,
    top: 60,
    width: document.getElementById(“distCargaFinput”).value / 20,
    height: 190
    },
    series: {
    0: {targetAxisIndex: 0, visibleInLegend: false, pointSize: 0, lineWidth: 0},
    1: {targetAxisIndex: 1, color:’blue’, lineWidth: 1, lineDashStyle:[4, 4]},
    2: {targetAxisIndex: 1, color:’blue’, lineWidth: 1, lineDashStyle:[4, 4]},
    3: {targetAxisIndex: 1, color:’blue’, lineWidth: 1, lineDashStyle:[4, 4]},
    4: {targetAxisIndex: 1, color:’blue’, lineWidth: 1, lineDashStyle:[4, 4]},
    5: {targetAxisIndex: 1, color:’blue’, lineWidth: 1, lineDashStyle:[4, 4]},
    6: {targetAxisIndex: 1, color:’red’, lineWidth: 2}
    },
    vAxes: {
    0: {textPosition: ‘none’},
    1: {textPosition: ‘inside’},
    },
    hAxis: {
    viewWindowMode:’explicit’,
    viewWindow: {
    max:hAxisMax,
    min:hAxisMin
    },
    //format: ‘0’,
    textPosition:’none’,
    slantedTextAngle:90
    },
    vAxis: {
    viewWindowMode:’explicit’,
    viewWindow: {
    max:1.25*dataArray[0][1],
    min:0
    }
    }
    };

    if (document.getElementById(‘ChasisDiagrama’).style.display == ‘block’) {
    //var chart = new google.charts.Line(document.getElementById(‘ChasisGraf’));
    var chart = new google.visualization.LineChart(document.getElementById(‘ChasisGraf’));
    }
    else if (document.getElementById(‘SemiDiagrama’).style.display == ‘block’) {
    //var chart = new google.charts.Line(document.getElementById(‘SemiGraf’));
    var chart = new google.visualization.LineChart(document.getElementById(‘SemiGraf’));
    }
    else {
    var chart = new google.visualization.LineChart(document.getElementById(‘TractorGraf’));
    }

    //chart.draw(data, google.charts.Line.convertOptions(options));
    chart.draw(data, options);
    }

    function tipoVehiculo(opDisplay) {
    var tiposVeh = [‘Chasis’, ‘Semi’, ‘Tractor’];

    for (var i = 0; i < tiposVeh.length; i++) {
    var tabla = tiposVeh[i] + ‘Table’;
    var diagrama = tiposVeh[i] + ‘Diagrama’;

    if (tiposVeh[i] == opDisplay) {
    document.getElementById(diagrama).style.display = ‘block’;
    document.getElementById(tabla).style.display = ‘block’;
    }
    else {
    document.getElementById(diagrama).style.display = ‘none’;
    document.getElementById(tabla).style.display = ‘none’;
    }
    }
    }

    function cargarSelectConfig (listaFuente) {
    var fieldName = listaFuente.id;

    fieldName = fieldName.substring(0, fieldName.length – 1);
    var configSelect = document.getElementById(fieldName + “c”);

    for(var i = configSelect.options.length-1; i >= 0; i–) {
    configSelect.remove(i);
    }

    for (var i = 0; i < pMaxEjes.length; i++) {
    if (pMaxEjes[i][0] == listaFuente.value) {
    var option = document.createElement(“option”);
    option.text = pMaxEjes[i][2];
    option.value = pMaxEjes[i][1];
    configSelect.add(option);
    }
    }

    cargarTablaPesos(configSelect);

    if (listaFuente.id == “Chasis1e”) {
    if (listaFuente.value > 1) {
    document.getElementById(fieldName + “2img”).style.display = ‘block’;
    document.getElementById(fieldName + “2aimg”).style.display = ‘block’;
    document.getElementById(“sepGrp1input”).value = 1400;
    document.getElementById(“sepGrp1input”).style.display = ‘block’;
    } else {
    document.getElementById(fieldName + “2img”).style.display = ‘none’;
    document.getElementById(fieldName + “2aimg”).style.display = ‘none’;

    document.getElementById(“sepGrp1input”).value = 0;
    document.getElementById(“sepGrp1input”).style.display = ‘none’;
    }
    }

    if (listaFuente.id == “Chasis2e”) {
    for (i = 1; i < 4; i ++) {
    if (i <= listaFuente.value) {
    document.getElementById(fieldName + i.toString() + “img”).style.display = ‘block’;
    } else {
    document.getElementById(fieldName + i.toString() + “img”).style.display = ‘none’;
    }
    if (listaFuente.value > 1) {
    document.getElementById(“sepGrp2input”).value = 1400;
    document.getElementById(“sepGrp2input”).style.display = ‘block’;
    } else {
    document.getElementById(“sepGrp2input”).value = 0;
    document.getElementById(“sepGrp2input”).style.display = ‘none’;
    }
    }
    }

    dimChasis();

    if (listaFuente.id == “SemiLe”) {
    if (listaFuente.value == 0) {
    document.getElementById(“distGrpL3inputSemi”).value = 0;
    document.getElementById(“distGrpL3inputSemi”).style.display = ‘none’;
    } else {
    document.getElementById(“distGrpL3inputSemi”).value = 2500;
    document.getElementById(“distGrpL3inputSemi”).style.display = ‘block’;
    }
    } else {
    if (listaFuente.value == 1) {
    document.getElementById(fieldName + “sep”).value = 0;
    document.getElementById(fieldName + “sep”).style.display = ‘none’;
    } else {
    document.getElementById(fieldName + “sep”).value = 1400 * (listaFuente.value – 1);
    document.getElementById(fieldName + “sep”).style.display = ‘block’;
    }
    }
    }

    function cargarTablaPesos (listaFuente) {
    var fieldName = listaFuente.id;
    fieldName = fieldName.substring(0, fieldName.length – 1);

    for (var i = 0; i < pMaxEjes.length; i++) {
    if (pMaxEjes[i][1] == listaFuente.value) {
    document.getElementById(fieldName + “pMax”).value = pMaxEjes[i][3];
    document.getElementById(fieldName + “pTol”).value = pMaxEjes[i][4];
    }
    }
    }

    function dimChasis() {
    var sepGrp1 = document.getElementById(“sepGrp1input”).value;
    var distGrp12 = document.getElementById(“distGrp12input”).value;
    var sepGrp2 = document.getElementById(“sepGrp2input”).value;
    var distCarga0 = document.getElementById(“distCarga0input”).value;
    var distCargaF = document.getElementById(“distCargaFinput”).value;

    var dimCaja = (distCargaF – 6000) * 0.05;
    document.getElementById(“ChasisTraseroimg”).style.left = dimCaja + 290;
    document.getElementById(“distCargaFinput”).style.left = (dimCaja * 0.5) + 421;

    var dimSepGrp1 = sepGrp1 * 0.05;
    document.getElementById(“Chasis12img”).style.left = dimSepGrp1 – 60 + 224;

    var dimGrp12 = (distGrp12 – 4700) * 0.05;
    document.getElementById(“Chasis21img”).style.left = dimGrp12 + 80 + 224;
    document.getElementById(“distGrp12input”).style.left = (distGrp12 * 0.025) – 20 + 224;

    var dimSepGrp2 = sepGrp2 * 0.05;
    document.getElementById(“Chasis22img”).style.left = dimSepGrp2 + (distGrp12 * 0.05) – 258 + 224;
    //document.getElementById(“sepGrp2input”).style.left = (dimDistTrac * 0.5) + 94;
    }

    function posicionEjeVariable (campoFuente) {
    var fieldName = “Chasis”;
    var x_max = document.getElementById(fieldName + “Graf”).style.right;
    x_max = Number(x_max.substring(0, x_max.length – 2));

    var x_min = document.getElementById(fieldName + “Graf”).style.width;
    x_min = Number(x_min.substring(0, x_min.length – 2));
    x_min = x_min + x_max;

    var dist0 = document.getElementById(“distCarga0input”).value;
    var distF = document.getElementById(“distCargaFinput”).value;
    var distGrp = campoFuente.value;
    //alert (x_min);
    var posicion = x_min + Math.round((distGrp – dist0) * (x_max – x_min) / distF);
    var posicion = posicion.toString() + “px”;
    alert(posicion);
    document.getElementById(fieldName + “EjeSimple”).style.position = “absolute”;
    document.getElementById(fieldName + “EjeSimple”).style.right = posicion;
    }
    </script>

    {/source}

     

      Eje Delantero Eje de Tracción  
    Configuración de Ejes      
    Tipo de Neumáticos      
    Peso Máximo Permitido      
    Tolerancia Permitido      
    Peso Tara del Vehículo