CS-7863-Sci-Stat-Proj-5/Schrick-Noah_Homework-5.R
2023-03-26 17:09:07 -05:00

49 lines
1.0 KiB
R

# Project 5 for the University of Tulsa's CS-7863 Sci-Stat Course
# Systems of Equations and Finite Difference Methods
# Professor: Dr. McKinney, Spring 2023
# Noah L. Schrick - 1492657
## 1. Systems of Equations in Matrix Form
# a. Use built-in R solve
A <- matrix(c(2,3,4,3,2,-3,4,4,2),nrow=3)
b <- matrix(c(3,5,9), nrow=3)
x <- solve(A,b)
x
# b. Verify with matrix mult
A%*%x == b
## 2. Matrix from polynomial
# a. Create vector for x and y
# b. Create coefficient matrix
# c. Solve
# d. Plot
## 3. Kirchoff
# a. Create vectors
# Resistance vec
# Voltage vec
# Matrix A and vector b
# Solve
# Show currents
# b. Repeat a. Use V=200, and R=(5,10,5,15,0,20)
## 4. Schrodinger eq
#a. Solve and plot the 1d quantum harmonic oscillator wave function
# b. Solve with Shooting Method
## 5. Solve harmonic oscillator Schrodinger with finite difference
# a. Solve with R and Julia
# b. Solve damped oscillator with perturbation param
# Plot
## 6. Solve heat diffusion equation
# EC. Solve the square plate problem