HELP ME PLESE!!!!! Warning: Explicit solution could not be found.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hellow I tried to solve the below equation in Matlab but it dosn't work.
This equation is the equation for obtaining the pressure of the shock wave before and after the move.
P4/P1=(P2/P1)*(1-(0.4*(a1/a4)*(P2/P1-1))/sqrt(2.8*(2.8+2.4*(P2/P1-1))))^7
i know P4,P1,a1,a4 so i want know P2 so i change equation
P2=P4*(1-(0.23985*a1*(P2/P1-1))/(a4*sqrt(2.4*(P2/P1-1)+2.8)))^7
and use syms. but I did not get an answer. it is my m.file
P4=4.056e4;
P1=101.3;
a4=4.0374e3;
a1=304;
syms P2;
P2=P4/(1-(0.4*(a1/a4)*(P2/P1-1))/sqrt(2.8*(2.8+2.4*(P2/P1-1))))^(7);
result=solve(P2);
double(result);
P2=double(result)
and i get this message
Warning: Explicit solution could not be found.
> In solve at 83
In Untitled at 8
P2 =
[]
Tried several times, but did not get an answer. Asks for help.
1 comentario
John D'Errico
el 28 de En. de 2015
And learn to use the code formatting button when you post code. I've fixed it here.
Respuestas (2)
Marshall
el 28 de En. de 2015
Firstly, you are much more likely to get a response when you write the question clearly in the actual question, rather than just asking for HELP!!!!!! Everyone needs help, but only some people can answer your question.
What are you actually trying to do? You've got some huge abstract magic numbers with no explanations.
You create these first three variables, P1, P4, a1 and a4, and then never use them. I would say that your problem could be that you create P2 as an empty symbolic object, and then reuse it in the calculation of P2 (this line: P2=4*(1-(0.23985*340*(P2/1-1))/(a4*sqrt(2.4*(P2/1-1)+2.8)))^-7), and then attempt to solve with that empty object in amongst your gigantic mess.
Clean it up. Find out what your question is.
John D'Errico
el 28 de En. de 2015
Editada: John D'Errico
el 28 de En. de 2015
You have a high order polynomial-ish thing to solve.
pretty(P2)
40560
- ----------------------------
/ 6080 P2 608 \7
| -------- - ----- |
| 20449431 20187 |
| ------------------- - 1 |
| / 336 P2 28 \ |
| sqrt| ------ + -- | |
\ \ 5065 25 / /
Oh, but perhaps you intended to have the equation read
P2=P4/(1-(0.4*(a1/a4)*(P2/P1-1))/sqrt(2.8*(2.8+2.4*(P2/P1-1))))^(7);
where P2 is a variable on both sides. But the fact is, you replaced P2 by that equation. That is what the equal sign does here. I think you may know that, but thought that MATLAB could read your mind.
If you truly wanted it to look like...
E = P4/(1-(0.4*(a1/a4)*(P2/P1-1))/sqrt(2.8*(2.8+2.4*(P2/P1-1))))^(7) - P2;
then you had to write it that way. Or, you might have written it as...
E = P2 == P4/(1-(0.4*(a1/a4)*(P2/P1-1))/sqrt(2.8*(2.8+2.4*(P2/P1-1))))^(7);
Regardless, to find an analytical solution of an equation that is not even truly polynomial is impossible. Solve told you that. So you might look for a numerical solution.
vpasolve(E)
ans =
-16.882279680786276244850594048689 + 0.0037603123838128952175763518192583*i
Remember that computers are not all powerful. We just think they are. If you tell them to do something that is mathematically impossible, they tend to have problems.
0 comentarios
Ver también
Categorías
Más información sobre Assumptions 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!