As discussed in class: create a computer program that will numerically solve the
ID: 3880395 • Letter: A
Question
As discussed in class: create a computer program that will numerically solve the equation: du/dx = 0 at x=0.1. Please submit the homework as a PDF. There is a fantastic scanner in the library that will create PDF files and email them to you. Please don't submit matlab files. If you submit JPEG or PNG files, I might or might not be able to handle them. If you get stuck, please ask in class. I prefer that you ask in class than that you come to office hours. If you are still stuck after we go over it in class, then come to office hours. Look at Section 8.1 for ideas. Include a plot of the answer. Full credit will only be given if you include x-0,1 on the plot.Explanation / Answer
Here is the code, do give me a thumbs up if this helps!
syms u(x)
Du=diff(u)
ode=diff(u,x,2)==u-x;
cond1=Du(0)==0;
cond2=Du(1)==0;
conds=[cond1 cond2];
uSol(x) = dsolve(ode,conds);
uSol = simplify(uSol)
uSol(x) =
x + exp(1 - x)/(exp(1) + 1) - exp(x)/(exp(1) + 1)
x=[-10:0.01:10];
plot(x,uSol(x));
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.