user1359539
user1359539

Reputation: 1

Using fsolve command in MATLAB

How can I solve these kind of equations?

(-1.5/w)*sin(w*t) + 1.5*t - 0.45 = 0  

Knowing that:

w = sqrt(10)

Thanks for your help.

Upvotes: 0

Views: 4436

Answers (2)

nrz
nrz

Reputation: 10550

You can solve this equation group of 2 equations this way:

solution = solve('w = sqrt(10)', '(-1.5/w)*sin(w*t) + 1.5*t - 0.45 = 0')

To check the solution:

solution.t
ans =
0.59963230021859138687907507892006

solution.w
ans =
3.1622776601683793319988935444327

To confirm that the solution works:

(-1.5/solution.w)*sin(solution.w*solution.t) + 1.5*solution.t - 0.45
ans =
0.0

Upvotes: 2

Abhinav
Abhinav

Reputation: 1962

EDIT : nrz's solution is correct.

One way is to evaluate the function explicitly and plot a graph. Try the following code in Matlab.

w = sqrt(10); t=(-100:0.01:100); Let, R=(-1.5/w)*sin(w*t) + 1.5*t - 0.45;

Then,

plot(t,R,'k')
 axis square;
 grid on;

You will get Figure-1;

Figure-1

`Upon zooming closer near (0,0), you will see the following structure of the graph (Figure-2).

Figure-2

Above, I have provided a numerical solution to this problem. Although, there is another method available (symbolic algebra) in Matlab. But matlab is primarily made for numerical computing and numerical solving of problems. Matlab is very inappropriate and slow for symbolic problem solving. Although the present question is a very small problem and won't be any trouble doing in Matlab using symbolic calculations as well, but still it is a good practice to do a problem numerically in matlab and symbolically in mathematica/maple etc.

Upvotes: 0

Related Questions