 # Equations in Matlab

Subject Mathematics MATLAB for Mathematics

## Question

Check the file: Questions.pdf

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Problem 1:

T=1;
n=100;m=10;
dt=T/n;
xmin=-1; xmax=1;
dx=2/m;
t=0:dt:T; x=-1:dx:1;
U=zeros(m+1,n+1);
U(:,1)=2*x'+1;
U(1,:)=-ones(n+1,1);
U(m+1,:)=3*ones(n+1,1);
alpha=dt/dx^2;
% d1=diag(ones(1,m-1));d2=diag(ones(1,m-2),1)...
%    +diag(ones(1,m-2),-1);
% A=(1+alpha)*d1-0.5*alpha*d2;
% B=(1-alpha)*d1+0.5*alpha*d2;
A=(1+alpha)*diag(ones(1,m-1))-0.5*alpha*diag(ones(1,m-2),1)...
-0.5*alpha*diag(ones(1,m-2),-1);
B=0.5*alpha*(-2*diag(ones(1,m-1))+diag(ones(1,m-2),1)...
+diag(ones(1,m-2),-1));
inv(A)
for k=1:n...

This is only a preview of the solution. Please use the purchase button to see the entire solution

## Related Homework Solutions

Systems of Linear Equations & Finance Problems in Matlab \$58.00
Matlab
Mathematics
Computer Science
Linear Equations
Script Files
Codes
Matrices
Determinants
Division Command
Transposed System
Plots
Vectors
Mesh Command
Arrays
Investments
Loans
Finance
Interest Rate
Variables
Loops
Cash
Equations in Matlab \$10.00
Mathematics
Matlab
Computer Science
Coding
Equations
Differential Algebra
Verifying Solutions
Variables
Statements
Mathematics Questions Using Matlab \$40.00
Mathematics
Matlab
Computer Science
Equations
Functions
Minimization Methods
Plots
Descent Methods
Velocity
Golden Section Search
Snell's Law
Matlab Problems \$38.00
Computer Science
Mathematics
Matlab
Programming
Arrays
Binary Approximation
Series
Zeros
Min/Max Values
Root Function
Round-Off Error
Functions
Statements
Variables
Plots
Live Chats