Home page
URL:
/usr/cnld/shw/.www/Lehre/lehrangebot/2010WS-SC
Wintersemester 2010
Aufruf mit gnuplot, Ausstieg mit quit oder q().
Details: Gunnar http://www.exp.univie.ac.at/sc/gnuplot/gnuplot.html
plot [0:40]exp(-0.1*x)*sin(x),exp(-0.1*x)*cos(x)
set parametric
set samples 1000
plot [0:40]exp(-0.1*t)*sin(t),exp(-0.1*t)*cos(t) with line 5
unset parametric
splot [0:40]exp(-0.1*x)*sin(y),exp(-0.1*x)*cos(y) with pm3d t 'weaves'
set isosamples 75,75
Einige gnuplot Kommandos zur Gestaltung des Plots:
set size square
set xlabel 'X'
set ylabel 'X'
set autoscale xy
set yrange [0.5:2.5]
set xrange [-20.:20]
set nologscale y
Einlesen, umformatieren und plotten:
awk '{print $2*1.}' Rohsignal_Kraft_10\ Hz_20\ mA.txt > Kraft10Hz.dat
plot [1:100] "Kraft10Hz.dat" using 1:2 w lp
oder bei Leerzeichen im Dateinamen:
plot "Rohsignal_Kraft_15\ Hz_20\ mA.txt" w lp
Rausschreiben einer PostScript-Datei unter gnuplot:
set term postscript landscape 'Helvetica' 14 % Umschalten der Plotausgabe in ein PostScript-File
set output 'name.ps'
splot [0:40]exp(-0.1*x)*sin(y),exp(-0.1*x)*cos(y) with pm3d t 'weaves'
set term x11 % Umschalten auf X-Ausgabe
oder
gnuplot < plot.in
mit
plot.in
set term postscript landscape 'Helvetica' 14
set output 'name.ps'
splot [0:40]exp(-0.1*x)*sin(y),exp(-0.1*x)*cos(y) with pm3d t 'weaves'
Linux-Shell: man ode echo " " | ode -f in2.ode in2.ode-File enthaelt die Angaben zum Anfangswert-Problem analog xppout (xpp_linux/xpp/ode) sine' = cosine % 1. ODE cosine' = -sine % 2. ODE sine = 0 % 1. Anfangsbedingung cosine = 1 % 2. Anfangsbedingung print t, sine step 0, 2*PI % Integrationsbereich, Standardschrittweite 0.1 siehe man ode gnuplot> plot "< echo ' ' | ode -f in2.ode " w d gnuplot> plot "splot" Pfad fuer Binaries in der Bash-Shell setzen: Die Datei .bashrc durch das Kommando PATH=$PATH:/data/myscripts export PATH source ~/.bashrcergaenzen.LaTeX
ReferenzenThe LaTeX Beamer Class Homepage Beamer Beispiele Kleine Einführung zur Beamer-Klasse latex beamer.tex ; dvips -P pdf beamer.dvi ps2pdf beamer.ps kpdf beamer.pdfMathematica
http://www.wolframalpha.com/99-70*sqrt[2]-1/(99+70*sqrt[2])GLE
http://glx.sourceforge.net/examples/index.htmlC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC /* C Einstieg mittels Internet-Tipps oder Handbuch Wikipedia http://tutorial.schornboeck.net/inhalt.htm Dirk Ammelburger: C++ für Einsteiger. Peter Wollschlaeger: C++ Pocket. Der leichte Einstieg. 1. Nutze Texteditor notepad um Quellcode cio.cpp zu schreiben. 2. Kompiliere Quellcode mit c++ ./name.cpp 3. Start des Programms mit ./a.out */ #include< iostream> using namespace std; int main() { cout << "Das ist eine Textausgabe von C auf den Bildschirm!\n"; return 0; } // C/c++/cpp/A00cioBildschirmText.cpp //using1.cpp // http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht20Ht/c++_namensraum_de #include < iostream> #include < ostream> #include < cstdlib> using ::std::cout; using ::std::rand; int main(){ cout << " 2. Zufallszahl -> " << rand() << ";" << " 1. Zufallszahl -> " << rand() << '\n'; } // C/c++/cpp/A01usingKlausel.cpp /* comment */ #include < iostream> using namespace std; int main() { char vorname[80],nachname[80]; float pivalue; cout << "Hallo Welt"<> vorname; cout << "Nachname: "; cin >> nachname; cout << endl; cout << endl; cout << "Guten Tag " << vorname << " " << nachname << " !" << endl; cout << endl; cout << "Wie lauten die ersten 3 Stellen von Pi ?\n\n" ; cin >> pivalue; cout << endl; cout << "Pi hat Ihrer Ansicht nach etwa den Wert " << pivalue << endl << endl; cout << "Wie heiBt das große, immer sichtbare Sternbild am Nordhimmel?"< > vorname >> nachname; cout << "Es heißt: " << vorname << " " << nachname << " !" << endl; cout << endl; // cin.get(); cin.get(); return 0; } // C/c++/cpp/A02hallocinout.cpp #include < iostream> using namespace std; // Addition in einer Unterfunktion float Addiere(float a, float b) { float c=a+b; return c; } float zahl1, zahl2; int main() { cout << "Additionsprogramm!"< >zahl1; cin>>zahl2; //cout <<"Summe ist " << Addiere(zahl1,zahl2)< Rueckgabewert Funktionsname(Parameter1,...,ParameterN) { Befehle return Ausgabewert; } */ #include < iostream> using namespace std; // Funktion für die Summe zweier Ganzzahlen int summiere(int summand1, int summand2) { int summe = summand1 + summand2; return summe; } int main() { cout << "Geben Sie zwei Ganzzahlen ein!\n"; // Deklaration zweier Variablen int summand1, summand2; // short int -32768 bis 32767 // long int -2.147.483.648 bis 2.147.483.647 // unsigned short int 0 bis 65.535 // unsigned long int 0 bis 4.294.967.295 // char 256 // float 1.2 e-38 bis 3.4 e38 // double 2.2e-308 bis 1.8e308 // unsigned short int Length = 5; // Konstanten // const unsigned short int Length = 5; // Aufzählungskonstanten // enum Ganzzahlen {a,b,c,d,e,f,g,h,i}; // enum Ganzzahlen {a=100,b,c=200,d,e,f=500,g,h,i=1000}; // Variablen werden auf die Eingabewerte gesetzt cin>>summand1; cin>>summand2; cout<<"Die Summe von "< Funktions- und Klassen-Templates
http://www.devarticles.com/c/a/Cplusplus/An-Introduction-to-C-plus-Templates/1/ http://www.developia.de/developia/viewarticle.php?cid=23241 http://de.wikipedia.org/wiki/Template_EngineNumerische Integration von odes mit odeint
Mario Mulanski, Karsten Ahnert, Andre Bergner: svn co https://www.boost.org/svn/boost/sandbox/odeint http://www.boost.org/users/download/ boost-Files holen: svn co http://svn.boost.org/svn/boost/trunk boost-trunk Pfad setzen auf die boost-File setzen: BOOST_ROOT=/usr/cnld/shw/boost-trunk/ oder export BOOST_ROOT=/usr/cnld/shw/boost-trunk/ boost-Files ansehen: more ../../../../boost/numeric/odeint/integrator_constant_stepsize.hpp shw@lambert:~/C/c++/odeint/libs/numeric/odeint/examples> g++ -Wall -O3 -I$BOOST_ROOT -I../../../../ lorenz_integrate_constant_step.cpp gnuplot> plot"<./a.out" w lpC/c++/odeint/libs/numeric/