pls i need help fast

the eq is x"+[h+k*cos(t)]x=0
the t on the priod [0,2pi]
and the intial conditions are x(0)=1 and x'(0)=0
i need the all x when the h&k changes from 0 to 100

3 Commenti

Steven Lord
Steven Lord il 17 Lug 2020
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
If this isn't a homework assignment, see the ode45 function.
format long
p = pi
a = .5;
b = .5;
syms y(t)
[V] = odeToVectorField(diff(y, 2) == -1*(a+b*cos(2*t))*y)
M = matlabFunction(V,'vars', {'t','Y'})
sol = ode45(M,[0 2*pi],[0 1]);
fplot(@(x)deval(sol,x,1),[0, 20])
i solve it for a certin number of h&k but i cant solve it for multibale numbers for h&k
thanks for the answer
madhan ravi
madhan ravi il 17 Lug 2020
And you will delete your question content in few minutes probably ;)

Accedi per commentare.

Risposte (1)

madhan ravi
madhan ravi il 17 Lug 2020

1 voto

3 Commenti

u rly got me but i think i much stupid than ur expictaions :(
still cant put these two together can u give me another hint
function y = findzero(a,b,x0)
y = fzero(@poly,x0);
a = .5
b= .5
function syms y(t)
[V] = odeToVectorField(diff(y, 2) == -1*(a+b*cos(2*t))*y)
M = matlabFunction(V,'vars', {'t','Y'})
end
end
Saladin Hossam
Saladin Hossam il 17 Lug 2020
thats like much much important for me in this pandamic my professor dont replay to my masseges so im hopeless i need to submit that in like 2 days
much much love for ur helping
im realy straggling here xD
function y = findzero(a,b,x0)
Y = diff(y,t)
a =[0 100]
b= [0 100]
function
[V] = odeToVectorField(diff(y, 2) == -1*(a+b*cos(2*t))*y)
M = matlabFunction(V,'vars', {'t','Y'})
sol = ode45(M,[0 2*pi],[0 1]);
end
end

Accedi per commentare.

Categorie

Scopri di più su Programming in Centro assistenza e File Exchange

Richiesto:

il 17 Lug 2020

Commentato:

il 17 Lug 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by