Question

NEED MATLAB CODE PLEASE d2x/dt2 + k(t)x=0, where k(t) = 16e^(-Lt) L= 0, 0.1, 0.3 please use ode45

NEED MATLAB CODE PLEASE

d2x/dt2 + k(t)x=0,

where k(t) = 16e^(-Lt)

L= 0, 0.1, 0.3

please use ode45

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

This is what I have for a mfile

function xprime=third(t,x);

L=0;

xprime(1)=x(2)

xprime(2)=x(1)*(16*exp^(-L*t))

xprime=xprime(:);

This is fine and by using

ts=[1,4*pi];

x0=[0, 0];

[t,x]=ode45(@third,ts,x0);

plot(x(:,1),x(:,2))

Add a comment
Know the answer?
Add Answer to:
NEED MATLAB CODE PLEASE d2x/dt2 + k(t)x=0, where k(t) = 16e^(-Lt) L= 0, 0.1, 0.3 please use ode45
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