Solving a pair of equation using matlab

조회 수: 2 (최근 30일)
Amey Raj
Amey Raj 2021년 10월 5일
댓글: Bjorn Gustavsson 2021년 10월 5일
how to solve the following pair of equation using MATLAB
y(t) = k*exp(-t/2)*cos(theta + (3^(1/2)*t)/2)
y(t = 0) = 0
Dy(t = 0) = 1
Solve for "k" and "theta"
Dy(t) mean differenttiation of function y(t) w.r.t t
Also return y(t) with values of k and theta inserted

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 10월 5일
You have 2 unknown parameters k and theta. You have one condition for y at t=0 and one condition for dy/dt at t=0. Since you have an explicit expression for y(t) you can differentiate that to give you an explicit expression for dy/dt. That will result in 2 expressions for y and dy/dt. This should make it possible to determine the 2 parameters. Simply start by manually differentiating y(t) unsing the product rule.
HTH
  댓글 수: 7
Amey Raj
Amey Raj 2021년 10월 5일
편집: Amey Raj 2021년 10월 5일
I could have done that but i have to write the code for something like
Let
y(x) = x^3 + x^2 + x + 1
a(x) is inputed by the user so for example if the user inputs
a(x) = D2 + D + 6
y(x)*a(x) = D2(x^3 + x^2 + x + 1) + D(x^3 + x^2 + x + 1) + 6(x^3 + x^2 + x + 1)
here D2(x^3 + x^2 + x + 1) = 6x + 2 and D is same as before. So D2 is double differential
Sorry about the t in previous comment. My bad
Bjorn Gustavsson
Bjorn Gustavsson 2021년 10월 5일
Then the question becomes more of "how to parse user input and interpret that" - once that is solved it should be comparatively easy to build a sum of derivatives of a polynomial or a differential equation. I suggest you open a new question on that.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by