-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_script.p
More file actions
46 lines (40 loc) · 1.01 KB
/
Copy pathplot_script.p
File metadata and controls
46 lines (40 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# gnuplot script to plot hw7 problems:
# Problem 1 Plots
set term png
set output 'problem1_forEuler.png'
set key off
set xlabel "t"
set ylabel "x"
plot "forwardEuler_P1.log", sqrt(1 + x**2)
set output 'problem1_backEuler.png'
set key off
set xlabel "t"
set ylabel "x"
plot "backwardEuler_P1.log", sqrt(1 + x**2)
set output 'problem1_crank_nicolson.png'
set key off
set xlabel "t"
set ylabel "x"
plot "crankNicolson_P1.log", sqrt(1 + x**2)
set output 'problem1_runge_kutta.png'
set key off
set xlabel "t"
set ylabel "x"
plot "rungeKutta_P1.log", sqrt(1 + x**2)
# Problem 2 Plots
set output 'problem2_backEuler.png'
set key off
set xlabel "t"
set ylabel "y"
plot "backwardEuler_P2.log", (3 * exp((x**3)/3) - sin(x**3) - 3 * cos(x**3))/10
set output 'problem2_timeSplit.png'
set key off
set xlabel "t"
set ylabel "y"
plot "timeSplitting_P2.log", (3 * exp((x**3)/3) - sin(x**3) - 3 * cos(x**3))/10
# Problem 3 Plot
set output 'problem3_forward_euler.png'
set key off
set xlabel "x"
set ylabel "y"
plot "multi_forwardEuler_P3.log"