Write a Matlab function that sets up the Laplacian matrix L and the boundary
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Write a Matlab function that sets up the Laplacian matrix L and the boundary

QUESTION 4

Q4a Suppose that the boundary condition is now a function of time, such:


Write a Matlab function that sets up the Laplacian matrix L and the boundary condition vector BC when the BCs vary in time. The only differences to Q3b will be the requirement to include time as an input parameter and the BC function will be as specified in Eqn 6. Your function header must be written as

function [L,BC] = MatSet_T(Nr, Nz, rg, zg, tnow, alpha, BCf)

where

• tnow is the time at the current step, which is needed to evaluate the boundary condition function,

• the rest of the input and output are the same as in Q3b

*Hint: You can modify from the function MatSet.m that you have written in Q3b, but you need to include both MatSet.m and MatSet_T.m as two separate MATLAB files.

Q4b Repeat Q3c with the new boundary condition as shown in Eqn (6). Instead of writing the time to set up and solve the system separately, print out the combined time for each different grid. Print to the command window a few sentences comparing the times in Q3c and Q4b, and explain what causes the difference.

Compare the solutions between Q3 and Q4 - are there any differences? What are they and why? Write a few sentences to the command window to answer.

data.all.m

Hint
EngineeringMATLAB allows the manipulations of matrix, plotting data and functions, logarithms implementation, user interfaces creation and program interfacing which are written in different languages. Millions of scientists and engineers use MATLAB for applications in range. Any function which is anonymous can be defined at MATLAB line of command or within a script or function....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.