Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB This is my actual code but I am aware is wrong, can some one help me with this matlab so i can plug different
MATLAB
This is my actual code but I am aware is wrong, can some one help me with this matlab so i can plug different "h" values. for this method.
h = 0.01; x = 0:h:1; y = zeros(size(x)); % allocate the result y y(1) = 12; % the initial y value n = numel(y); % the number of y values % The loop to solve the DE for i=1:n-1 f = (x(i)-.174*exp(-.174*(y(i)))); y(i+1) = y(i) + h * f; end plot(x,y); grid on hold on
To solve this by Euler's method we write f(t, T), T (0) 37 dt Then choose some step size h according to requirement of how close the answer we need. Say h 0.5 We know the initial value ofTatt 0. Too) 37 We can find f (0,T(0)). Then by Euler method, we can find T (0.5) T(0) h x f(0, T(0) Or in general if I (ti), f(ti, T()) is found, then T (ti +1) T (i) h x f (ti, T (i))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started