Создание базы данных экспериментов с плазменным кристаллом

Автор: Пользователь скрыл имя, 16 Июня 2014 в 13:58, магистерская работа

Краткое описание

Несмотря на широкую распространенность в природе и исключительно важную роль в самых различных областях науки и техники: от источников света до термоядерного синтеза и нанотехнологий – плазма, исследования которой продолжаются уже второе столетие, остается до конца не понятым объектом. Даже для простейших случаев газового разряда в инертных газах теоретики не могут предложить четкого алгоритма расчета внутренних параметров плазмы и ее эмиссионных характеристик на основе произвольно устанавливаемых экспериментатором факторов (размер среды, напряжение питания, род и давление газа). Тем не менее, не прекращаются попытки построить модели значительно более сложных экзотических плазменных сред. Так в 70-х и начале 80-х годов прошлого века появляются работы, в которых на основе классической статистической механики с использованием численных методов решения соответствующих уравнений методом Монте-Карло исследуются свойства однокомпонентной полностью ионизованной плазмы гелия при температуре около 108 К и плотности вещества 1029 cм-3.

Файлы: 1 файл

Диплом Соколов АВ.doc

— 1,009.50 Кб (Скачать)

mquery("UPDATE article_section SET pos='$up[pos]' WHERE sid='$sid' AND mid='$cur[mid]'");

    }

    mquery("UNLOCK TABLES");

    $setup->SetLastUpdate();

    safe_header("Location: .?t=article&sid=$cur[mid]");

}

 

function DownSection($sid) {

    global $logged_gid, $setup;

    $perm_editsec=$setup->AccessAllow($setup->GetSectionSID("article"), $logged_gid, "editsec", $this->getParent($sid));

    $deny=false;

    switch ($perm_editsec) {

    case "deny":

$deny=true;

break;

    }

    if ($deny) return parse_file("theme/deny.htm");

   if (!$this->SectionExists($sid)) return parse_file("theme/info.htm", array('info'=>"К сожалению, указанного раздела не существует."));

    mquery("LOCK TABLES article_section WRITE");

    $cur=mysql_fetch_assoc(mquery("SELECT pos, mid FROM article_section WHERE sid='$sid'"));

    $max=mysql_fetch_assoc(mquery("SELECT max(pos) AS pos FROM article_section WHERE mid='$cur[mid]'"));

    if ($cur['pos']<$max['pos']) {

$down=mysql_fetch_assoc(mquery("SELECT sid, pos FROM article_section WHERE pos>'".($cur['pos'])."' AND mid='$cur[mid]' ORDER BY pos LIMIT 1"));

mquery("UPDATE article_section SET pos='$cur[pos]' WHERE sid='$down[sid]' AND mid='$cur[mid]'");

mquery("UPDATE article_section SET pos='$down[pos]' WHERE sid='$sid' AND mid='$cur[mid]'");

    }

    mquery("UNLOCK TABLES");

    $setup->SetLastUpdate();

    safe_header("Location: .?t=article&sid=$cur[mid]");

}

 

function GetSectionName($sid) {

    $result=mquery("SELECT name FROM article_section WHERE sid='$sid'");

    if (!mysql_num_rows($result)) {

mysql_free_result($result);

return "Статьи";

    }

    $row=mysql_fetch_assoc($result);

    mysql_free_result($result);

    return $row['name'];

}

 

function GetSectionNameHREF($sid) {

    $result=mquery("SELECT sid, name, title FROM article_section WHERE sid='$sid'");

    if (!mysql_num_rows($result)) {

mysql_free_result($result);

return false;

    }

    $row=mysql_fetch_assoc($result);

    mysql_free_result($result);

    $row['action']=".?t=article&sid=".$row['sid'];

    return parse_file("theme/article/list/section.htm", $row);

}

 

function GetSectionsList($sid, $level=0) {

    $result=mquery("SELECT sid, name FROM article_section WHERE mid='$sid' ORDER BY pos");

    if (mysql_num_rows($result)) {

while ($row=mysql_fetch_assoc($result)) {

    $GLOBALS['section_list'][$row['sid']][$level]=$row['name'];

    $this->GetSectionsList($row['sid'], $level+1);

}

    }

    mysql_free_result($result);

}

 

function GetLinks($sid=0) {

    if ($sid) {

for($i=$sid; $i!=0; $i=$row['mid']) {

    $row=mysql_fetch_assoc(mquery("SELECT mid FROM article_section WHERE sid='$i'"));

    $list[]=$this->GetSectionNameHREF($i);

}

    }

    $list[]=parse_file("theme/article/list/sections.htm", array('action'=>".?t=article"));

    return implode(" -> ", array_reverse($list));

}

 

function SectionExists($sid) {

    if (mysql_num_rows(mquery("SELECT sid FROM article_section WHERE sid='$sid'"))) return true;

    else return false;

}

 

function GetTable() {

    print parse_file("theme/article/article/add/ie/table.htm");

    exit;

}

 

function GetColors() {

    print parse_file("theme/article/article/add/ie/color.htm");

    exit;

}

 

function GetFile($aid) {

    $name="article$aid.zip";

    $file="article/article$aid/$name";

    if (!file_exists($file)) return parse_file("theme/info.htm", array('info'=>"К сожалению, указанного файла не существует."));

    header("Content-type: application/zip");

    header("Content-length: ".strlen($content=file_get_contents($file)));

    header("Content-Disposition: attachment; filename=".($this->GetArticleName($aid)).".zip");

    print $content;

    exit;

}

    }

?>

 

module/exp.php

 

<?

    require_once("module/class/exp.php");

    $exp=new Exp();

 

    if (isset($_GET['eid'])) $eid=(int) $_GET['eid'];

    else $eid=0;

    if (isset($_GET['p'])) $p=(int) $_GET['p'];

    else $p=0;

 

    switch ($a) {

    case "add":

$body.=$exp->EditExp(0);

break;

    case "addrep":

$body.=$exp->EditExp(-1);

break;

    case "report":

$body.=$exp->AddReport();

break;

    case "insert":

$body.=$exp->InsertExp();

break;

    case "edit":

$body.=$exp->EditExp($eid);

break;

    case "update":

$body.=$exp->UpdateExp();

break;

    case "delete":

$body.=$exp->DeleteExp($eid);

break;

    case "find":

$body.=$exp->FindExps($p?$p:1);

break;

    case "aux":

$body.=$exp->ShowAux();

break;

    case "editaux":

$body.=$exp->EditAux();

break;

    case "updaux":

$body.=$exp->UpdateAux();

break;

    case "editeng":

$body.=$exp->EditEngineer();

break;

    case "updeng":

$body.=$exp->UpdateEngineer();

break;

    case "all":

$body.=$exp->AllExps();

break;

    default: // show

if ($eid) $body.=$exp->FindExps($p?$p:1);

else $body.=$exp->SearchExp();

break;

    }

?>

 

module/class/exp.php

 

<?

    class Exp {

//-------------//

// База данных //

//-------------//

 

function GetLinks($perm_add) {

    unset($link);

    $link[]=parse_file("theme/exp/href/all.htm");

    if ($perm_add=="allow") {

$link[]=parse_file("theme/exp/href/add.htm");

$link[]=parse_file("theme/exp/href/report.htm");

$link[]=parse_file("theme/exp/href/aux.htm");

    }

    $link[]=parse_file("theme/exp/href/search.htm");

    if (count($link)) $links=implode("&nbsp;:&nbsp;", $link); else $links="";

    return $links;

}

 

function AllExps() {

    global $logged_gid, $setup, $user;

    $perm_show=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "show");

    $deny=false;

    switch ($perm_show) {

    case "deny":

$deny=true;

break;

    }

    if ($deny) return parse_file("theme/deny.htm");

    $perm_add=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "add");

    $links=$this->GetLinks($perm_add);

    $exps="";

    $result=mysql_query("select exp_id, date_format(exp_date, '%d.%m.%Y') as exp_date, who_org, who_org_type, who_engineer, who_engineer_lastname, who_engineer_firstname, who_engineer_patronymic from exp, who, who_org, who_engineer where exp_who=who_id and who_org=who_org_id and who_engineer=who_engineer_id order by exp_id");

    if (!mysql_num_rows($result)) {

$exps="<tr><td>В базе данных нет ни одной записи.</td></tr>";

    } else {

while($row=mysql_fetch_assoc($result)) {

    $who_engineer="";

    if (($row['who_engineer_lastname']) and ($row['who_engineer']!='1')) {

$who_engineer=" Проводил: $row[who_engineer_lastname] ".$row['who_engineer_firstname']{0}.". ".$row['who_engineer_patronymic']{0}.".";

if (($row['who_org_type']) and ($row['who_org']!='1')) $who_engineer.=" ($row[who_org_type]).";

    }

    $exps.="<tr><td><a href='.?t=exp&eid=$row[exp_id]'>Эксперимент <b>$row[exp_id]</b> от <b>$row[exp_date]</b>.$who_engineer</td></tr>\n\t";

}

    }

    mysql_free_result($result);

   

    return "

<CENTER>$links</CENTER><BR>

<table align='center' cellspacing=1 cellpadding=3 class='mainheader'>

<tr class='mainheader'><td><img src='img/head.gif' alt='' width='8' height='8'> Все эксперименты</td></tr>

<tr class='int'><td>

<table cellspacing=0 cellpadding=0>

$exps

</table>

</td></tr>

</table>

<CENTER>$links</CENTER><BR>

    ";

}

 

function FindExps($p=1) {

    global $logged_gid, $setup, $user;

    $perm_show=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "show");

    $deny=false;

    switch ($perm_show) {

    case "deny":

$deny=true;

break;

    }

    if ($deny) return parse_file("theme/deny.htm");

    $perm_add=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "add");

    $perm_edit=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "edit");

    $perm_delete=$setup->AccessAllow($setup->GetSectionSID("exp"), $logged_gid, "delete");

    $links=$this->GetLinks($perm_add);

 

    if (isset($_GET['exp_date_from_Y'])) $exp_date_from_Y=$_GET['exp_date_from_Y']; else $exp_date_from_Y="";

    if (isset($_GET['exp_date_from_M'])) $exp_date_from_M=$_GET['exp_date_from_M']; else $exp_date_from_M="";

    if (isset($_GET['exp_date_from_D'])) $exp_date_from_D=$_GET['exp_date_from_D']; else $exp_date_from_D="";

    if (isset($_GET['exp_date_to_Y'])) $exp_date_to_Y=$_GET['exp_date_to_Y']; else $exp_date_to_Y="";

    if (isset($_GET['exp_date_to_M'])) $exp_date_to_M=$_GET['exp_date_to_M']; else $exp_date_to_M="";

    if (isset($_GET['exp_date_to_D'])) $exp_date_to_D=$_GET['exp_date_to_D']; else $exp_date_to_D="";

    if (isset($_GET['exp_id'])) $exp_id=$_GET['exp_id']; else $exp_id="";

    if (isset($_GET['exp_id_from'])) $exp_id_from=$_GET['exp_id_from']; else $exp_id_from="";

    if (isset($_GET['exp_id_to'])) $exp_id_to=$_GET['exp_id_to']; else $exp_id_to="";

    if (isset($_GET['part_size_avg_from'])) $part_size_avg_from=$_GET['part_size_avg_from']; else $part_size_avg_from="";

    if (isset($_GET['part_size_avg_to'])) $part_size_avg_to=$_GET['part_size_avg_to']; else $part_size_avg_to="";

    if (isset($_GET['part_shape_types'])) $part_shape_types=$_GET['part_shape_types']; else $part_shape_types="";

    if (isset($_GET['part_input_types'])) $part_input_types=$_GET['part_input_types']; else $part_input_types="";

    if (isset($_GET['who_engineer_types'])) $who_engineer_types=$_GET['who_engineer_types']; else $who_engineer_types="";

    if (isset($_GET['who_org_types'])) $who_org_types=$_GET['who_org_types']; else $who_org_types="";

    if (isset($_GET['who_place_types'])) $who_place_types=$_GET['who_place_types']; else $who_place_types="";

    if (isset($_GET['cathode_types'])) $cathode_types=$_GET['cathode_types']; else $cathode_types="";

    if (isset($_GET['tube_cathode_square_from'])) $tube_cathode_square_from=$_GET['tube_cathode_square_from']; else $tube_cathode_square_from="";

    if (isset($_GET['tube_cathode_square_to'])) $tube_cathode_square_to=$_GET['tube_cathode_square_to']; else $tube_cathode_square_to="";

    if (isset($_GET['tube_anode_square_from'])) $tube_anode_square_from=$_GET['tube_anode_square_from']; else $tube_anode_square_from="";

    if (isset($_GET['tube_anode_square_to'])) $tube_anode_square_to=$_GET['tube_anode_square_to']; else $tube_anode_square_to="";

    if (isset($_GET['cathode_material_types'])) $cathode_material_types=$_GET['cathode_material_types']; else $cathode_material_types="";

    if (isset($_GET['anode_material_types'])) $anode_material_types=$_GET['anode_material_types']; else $anode_material_types="";

    if (isset($_GET['tube_electrode_distance_from'])) $tube_electrode_distance_from=$_GET['tube_electrode_distance_from']; else $tube_electrode_distance_from="";

    if (isset($_GET['tube_electrode_distance_to'])) $tube_electrode_distance_to=$_GET['tube_electrode_distance_to']; else $tube_electrode_distance_to="";

    if (isset($_GET['tube_diameter_from'])) $tube_diameter_from=$_GET['tube_diameter_from']; else $tube_diameter_from="";

    if (isset($_GET['tube_diameter_to'])) $tube_diameter_to=$_GET['tube_diameter_to']; else $tube_diameter_to="";

    if (isset($_GET['power_shape_types'])) $power_shape_types=$_GET['power_shape_types']; else $power_shape_types="";

    if (isset($_GET['power_freq_from'])) $power_freq_from=$_GET['power_freq_from']; else $power_freq_from="";

    if (isset($_GET['power_freq_to'])) $power_freq_to=$_GET['power_freq_to']; else $power_freq_to="";

    if (isset($_GET['power_voltage_from'])) $power_voltage_from=$_GET['power_voltage_from']; else $power_voltage_from="";

    if (isset($_GET['power_voltage_to'])) $power_voltage_to=$_GET['power_voltage_to']; else $power_voltage_to="";

    if (isset($_GET['power_current_from'])) $power_current_from=$_GET['power_current_from']; else $power_current_from="";

    if (isset($_GET['power_current_to'])) $power_current_to=$_GET['power_current_to']; else $power_current_to="";

    if (isset($_GET['results'])) $results=$_GET['results']; else $results="";

    if (isset($_GET['results'][0])) $results[0]=$_GET['results'][0]; else $results[0]="";

    if (isset($_GET['results'][1])) $results[1]=$_GET['results'][1]; else $results[1]="";

   if (isset($_GET['results'][2])) $results[2]=$_GET['results'][2]; else $results[2]="";

    if (isset($_GET['results'][3])) $results[3]=$_GET['results'][3]; else $results[3]="";

    if (isset($_GET['results'][4])) $results[4]=$_GET['results'][4]; else $results[4]="";

    if (isset($_GET['results'][5])) $results[5]=$_GET['results'][5]; else $results[5]="";

    if (isset($_GET['gas'])) $gas=$_GET['gas']; else $gas=NULL;

    if (isset($_GET['material'])) $material=$_GET['material']; else $material=NULL;

 

    $exp_date_from="";

    if ($exp_date_from_Y) {

$exp_date_from="$exp_date_from_Y-00-00";

if ($exp_date_from_M) {

    $exp_date_from="$exp_date_from_Y-$exp_date_from_M-00";

    if ($exp_date_from_D) {

$exp_date_from="$exp_date_from_Y-$exp_date_from_M-$exp_date_from_D";

    }

}

    }

 

    $exp_date_to="";

    if ($exp_date_to_Y) {

$exp_date_to="$exp_date_to_Y-00-00";

if ($exp_date_to_M) {

    $exp_date_to="$exp_date_to_Y-$exp_date_to_M-00";

    if ($exp_date_to_D) {

$exp_date_to="$exp_date_to_Y-$exp_date_to_M-$exp_date_to_D";

    }

}

    }

 

    $result=mquery("

    SELECT *,

date_format(exp_date, '%d.%m.%Y') AS exp_date,

t1.electrode_material_id AS cathode_material_id,

t2.electrode_material_id AS anode_material_id,

t1.electrode_material_type AS cathode_material,

t2.electrode_material_type AS anode_material

    FROM    

exp, part, part_shape, part_input, who, who_engineer, who_org, who_place, tube, cathode_type,

tube_electrode_material as t1, tube_electrode_material as t2, power, power_shape, results

    WHERE

exp_who=who_id AND

exp_part=part_id AND

part_shape=part_shape_id AND

part_input=part_input_id AND

who_engineer=who_engineer_id AND

who_org=who_org_id AND

who_place=who_place_id AND

exp_tube=tube_id AND

tube_cathode_type=cathode_id AND

tube_cathode_material=t1.electrode_material_id AND

tube_anode_material=t2.electrode_material_id AND

exp_power=power_id AND

power_shape=power_shape_id AND

exp_results=results_id AND "

.($exp_id?"exp_id='$exp_id' AND ":"")

.($exp_id_from?"exp_id>='$exp_id_from' AND ":"").($exp_id_to?"exp_id<='$exp_id_to' AND ":"")

.($exp_date_from?"exp_date>='$exp_date_from' AND ":"").($exp_date_to?"exp_date<='$exp_date_to' AND ":"")

.($part_size_avg_from?"part_size_avg>='$part_size_avg_from' AND ":"").($part_size_avg_to?"part_size_avg<='$part_size_avg_to' AND ":"")

.($part_shape_types?"part_shape_id='$part_shape_types' AND ":"")

.($part_input_types?"part_input_id='$part_input_types' AND ":"")

.($who_engineer_types?"who_engineer_id='$who_engineer_types' AND ":"")

.($who_org_types?"who_org_id='$who_org_types' AND ":"")

.($who_place_types?"who_place_id='$who_place_types' AND ":"")

.($cathode_types?"cathode_id='$cathode_types' AND ":"")

.($tube_cathode_square_from?"tube_cathode_square>='$tube_cathode_square_from' AND ":"").($tube_cathode_square_to?"tube_cathode_square<='$tube_cathode_square_to' AND ":"")

.($tube_anode_square_from?"tube_anode_square>='$tube_anode_square_from' AND ":"").($tube_anode_square_to?"tube_anode_square<='$tube_anode_square_to' AND ":"")

.($cathode_material_types?"t1.electrode_material_id='$cathode_material_types' AND ":"")

.($anode_material_types?"t2.electrode_material_id='$anode_material_types' AND ":"")

.($tube_electrode_distance_from?"tube_electrode_distance>='$tube_electrode_distance_from' AND ":"").($tube_electrode_distance_to?"tube_electrode_distance<='$tube_electrode_distance_to' AND ":"")

.($tube_diameter_from?"tube_diameter>='$tube_diameter_from' AND ":"").($tube_diameter_to?"tube_diameter<='$tube_diameter_to' AND ":"")

.($power_shape_types?"power_shape_id='$power_shape_types' AND ":"")

.($power_freq_from?"power_freq>='$power_freq_from' AND ":"").($power_freq_to?"power_freq<='$power_freq_to' AND ":"")

.($power_voltage_from?"power_voltage>='$power_voltage_from' AND ":"").($power_voltage_to?"power_voltage<='$power_voltage_to' AND ":"")

.($power_current_from?"power_current>='$power_current_from' AND ":"").($power_current_to?"power_current<='$power_current_to' AND ":"")

Информация о работе Создание базы данных экспериментов с плазменным кристаллом