Respuesta aceptada

Yusuf Suer Erdem
Yusuf Suer Erdem el 27 de Nov. de 2021
Editada: Yusuf Suer Erdem el 27 de Nov. de 2021

1 voto

Hi Alesna, could you try my codes below? Good luck.
clc; clear; close all;
syms y(t) k t
Dy=diff(y);
k=sqrt(2);
ode=diff(y,t,2)==k*sin(k*t);
conds = [y(0)==6, Dy(0)==0];
ySol(t)=dsolve(ode,conds)

4 comentarios

Art dela vega
Art dela vega el 28 de Nov. de 2021
it works sir! thank you so much! i've been stuck for this problem for about 3 hours omg. thank you for the help sir. appreciated
Art dela vega
Art dela vega el 28 de Nov. de 2021
sir, just one more question if it is okay. using the code that you gave i tried to answer this question.
Art dela vega
Art dela vega el 28 de Nov. de 2021
Yusuf Suer Erdem
Yusuf Suer Erdem el 28 de Nov. de 2021
Try these codes below. Good luck.
clc; clear; close all;
syms y(x)
Dy = diff(y);
ode = diff(y,x,2) == -5*diff(y,x)-4*y;
cond1 = y(0) == 1;
cond2 = Dy(0) == 0;
conds = [cond1 cond2];
ySol(x) = dsolve(ode,conds);
ySol = simplify(ySol);
ySol(1)

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 27 de Nov. de 2021

1 voto

You created y as a symbolic function, syms y(t)
You try to assign to ySol(y) . But y is a function, and you cannot index by a function.
You could assign to ySol(t)

1 comentario

Art dela vega
Art dela vega el 28 de Nov. de 2021
thank you sir, i found my mistakes on my codes. thank you for the help!

Iniciar sesión para comentar.

Categorías

Más información sobre Functions en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 27 de Nov. de 2021

Comentada:

el 28 de Nov. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by