How to simplify exponential symbolic equation?

I am solving a system of equations that have exponential terms in it. The equations are as follows:
x1_temp(t) == exp(-t*theta1_temp)*u1(t);
x2_temp(t) == exp(-t*theta2_temp)*(theta1_temp*x1_temp(t) + 19)
I want to ultimately find theta1 and theta2 from these equations. How can I isolate these variables and get an explicit equation? Using solve() or vpasolve() does not give answer. It gives an error saying that the input cannot be of type 'sym'.

 Accepted Answer

Something like this?
syms x1_temp(t) x2_temp(t) theta1_temp theta2_temp u1(t)
eq=[x1_temp(t)==exp(-t*theta1_temp)*u1(t) x2_temp(t) == exp(-t*theta2_temp)*(theta1_temp*x1_temp(t) + 19)];
solx=solve(eq,[theta1_temp,theta2_temp]);
theta1_temp(t)=solx.theta1_temp
theta2_temp(t)=solx.theta2_temp

5 Comments

It returns empty sym.
Actually it returns exactly the Torsten's answer. See the attached figure.
Which version of MATLAB are you using?

Sign in to comment.

More Answers (1)

theta1_temp(t)=-log(x1_temp(t)/u1(t))/t
theta2_temp(t)=-log(x2_temp(t)/(-log(x1_temp(t)/u1(t))/t*x1_temp(t)+19))/t
Best wishes
Torsten.

Categories

Community Treasure Hunt

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

Start Hunting!