Expired coding question, don't refer to this
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
This code is not valid, solution found a different way.
figure(1)
qdot=(-2500:1:250);
Tout=qdot./7.63358+2669.85./7.63358;
plot(qdot,Tout);
title('Tout vs qdot')
xlabel('qdot')
ylabel('Tout')
figure(2)
qout=(-2500:1:250);
Tout1=-((qout.*2.5.*10.^(-4))./(0.558.*0.02)-307.15);
plot(qout,Tout1);
title('Tout vs qout')
xlabel('qout')
ylabel('Tout')
syms qout qdot
eqn = Tout == Tout1;
solve (eqn,qdot,qout)
0 comentarios
Respuestas (1)
Florian Bidaud
el 4 de Mzo. de 2024
Editada: Florian Bidaud
el 4 de Mzo. de 2024
You haven't defined Tout and Tout1 as equations but as numerical variables because qout and qdot are int arrays. You should first declare qout and qdot as syms before defining Tout and Tout1
syms qout qdot
Tout=qdot./7.63358+2669.85./7.63358;
Tout1=-((qout.*2.5.*10.^(-4))./(0.558.*0.02)-307.15);
eqn = Tout == Tout1;
s=solve (eqn,qdot,qout);
disp(s)
figure(1)
qdot=(-2500:1:250);
Tout=qdot./7.63358+2669.85./7.63358;
plot(qdot,Tout);
title('Tout vs qdot')
xlabel('qdot')
ylabel('Tout')
figure(2)
qout=(-2500:1:250);
Tout1=-((qout.*2.5.*10.^(-4))./(0.558.*0.02)-307.15);
plot(qout,Tout1);
title('Tout vs qout')
xlabel('qout')
ylabel('Tout')
1 comentario
John D'Errico
el 4 de Mzo. de 2024
Editada: John D'Errico
el 4 de Mzo. de 2024
This answer is good as a start, but not complete I would suggest. I think it did not go far enough. It is also the case there is no single, unique solution.
syms qout qdot
Tout=qdot./7.63358+2669.85./7.63358;
Tout1=-((qout.*2.5.*10.^(-4))./(0.558.*0.02)-307.15);
I'll show the relation reduced to short digits to make it more readable.
vpa(Tout == Tout1,4)
As you can see, there is a linear relation between the two unknowns qdot and qout. Choose ANY value for one of them, and the other is given directly by a linear equation, a straight line.
We could even have MATLAB return the functional relationship itself, thus
qdotsol = solve(Tout == Tout1,qdot)
As a simple functional relationship, we see the dependence between the two.
vpa(qdotsol,4)
Choose any value for qout, and you can compute qdot directly. And that is what I think the answer from @Florian Bidaud should have pointed out. We can see the relationship in the plot below:
fplot(qdotsol,[-2500,250])
xlabel qout
ylabel qdot
grid on
So ANY point on the straight line plot is a solution that makes the pair of expressions Tout and Tout1 equal.
Ver también
Categorías
Más información sobre General Physics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!