Question

Write a Matlab Function (not a script) that performs a single iteration of the Euler's method...

Write a Matlab Function (not a script) that performs a single iteration of the Euler's method for the regular parashot problem, (i.e. just write a function that calculates v_next)
Assume:
cd = 0.25 [kg/m] for t < 10sec and
c
d = 1.5   [kg/m] for t ≥ 10sec

Hint: use only if-statements, do not use any LOOPs you only need to compute only one iteration
Hint2: make sure you define the inputs and outputs of the function correctly

Please show how to write this code. (Does not need to be in MatLab, I just need a general idea of how to start)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

The below bold part is the function and the rest is just to run that function


Euler1(1,1,100,0.1)


function v_next=Euler1(t0,v0,m,h)
v_next=0;
g=9.81;
if(t0<10)
v_next=v0+(g-0.25/m*v0)*h;
else
v_next=v0+(g-1.5/m*v0)*h;
end
end

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Write a Matlab Function (not a script) that performs a single iteration of the Euler's method...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT