can anyone write a 3d code for this
Show older comments

6 Comments
Walter Roberson
on 8 Jan 2021
Edited: Walter Roberson
on 8 Jan 2021
Sorry, I cannot read the writing clearly enough.
It looks like w is defined
w = n*R*T*log(w/v1)
Is that the same w on the left side and in the numerator of the division in the log ?
Then it looks like you have Q*w and it looks like it is being defined as
Q*w -> Q * w = n*R_T*log(w/v1)
which looks like it changes from R*T to
and also seems to be missing the w on the right hand side, unless T/R_T has the right ratio to eliminate the w multiplier ?
Then there seems to be a definition for T but I can't read it. And then there seems to be
but maybe it is
... hard to say.
It is not obvious how any of this would connect together to create a 3D plot, especially since you show us a 2D plot instead...
alice white
on 8 Jan 2021
Walter Roberson
on 9 Jan 2021
What are the independent variables, and their ranges? What is the dependent variable? What is the formula for the dependent variable in terms of the independent variables?
alice white
on 9 Jan 2021
alice white
on 9 Jan 2021
Walter Roberson
on 9 Jan 2021
f= -p1v1ln(v2/v1)
That appears to have three input variables,
,
,
and one output variable, f .
You indicate that p is the output, so it sounds as if you have a given f value and you want
p_1 = f ./ (v_1 .* log(v_2 ./ v_1))
This appears to have three input variables, f,
,
and one output variable,
. This would require a 4 dimensional plot.
You want to add T to the formula in some way that I already told you I cannot read from the image you posted in your Question.
Answers (1)
Image Analyst
on 9 Jan 2021
Did you try just plotting the formula? Something like this:
% independent v
% dependent p
% formula : the last pic i sent u the logaritm function
v1 = 2; % Whatever.....
p1 = 5; % Whatever.....
v2 = linspace(0, 5, 1000);
p = -p1 * v1 * log(v2 ./ v1);
plot(v2, p, 'b-');
grid on;
ylabel('P(pa)', 'FontSize', 20);
xlabel('v in m^3', 'FontSize', 20);
Adapt as needed for different T, v, v1, v2, p1, etc.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
