17 views (last 30 days)

Hello

I am trying to solve the following equation given input time and values (y) vectors.

I tried the following

syms theta kappa alpha

if time < alpha

eqn = exp(-kappa*time)==y;

else

eqn = exp(-kappa)*exp(-theta*(time-alpha))==y;

end

vars = [theta kappa alpha];

S=solve(eqn);

but it raises an error...

Conversion to logical from sym is not possible.

I tried to convert alpha into double (i.e. double(alpha) ) in the if statement but it did not work...

Any suggestions?

the data look like :

Walter Roberson
on 17 Jan 2020

syms theta kappa alpha time y real

eqn = y == piecewise(time < alpha, exp(-kappa*time), exp(-kappa)*exp(-theta*(time-alpha)));

vars = [theta kappa alpha];

S = solve(eqn, kappa, 'returnconditions', true); %solve for which variable ??

Walter Roberson
on 20 Jan 2020

Sign in to comment.

antoine
on 18 Jan 2020

Walter Roberson
on 18 Jan 2020

Unless time and y are vectors of length 3 exactly, it seems unlikely that there would be any solutions.

It looks to me as if what you have should be a modeling task to estimate parameters rather than a set of simultaneous equations.

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.