Finding exact point on the surface
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
I have a 3D surface obtained from the equation y = f(x, z). I'm wondering how I can determine the exact value of z when I have the values of x and y. It's challenging to find the equation for z = g(x, y), which is why I created the surface based on x and z.
Essentially, I have a rectangular region on the x-y plane, and I need to project it onto the surface. To achieve this, I need to calculate the exact z values for each corner of the rectangle based on the given x and y values.
I appreciate any assistance with this.
Thank you!
3 Kommentare
Akzeptierte Antwort
Matt J
am 13 Sep. 2023
z = fzero(@(z)y-f(x,z), [z1,z2])
7 Kommentare
Dyuman Joshi
am 14 Sep. 2023
Change the initial guess
gamma=5.5;
T=1/(gamma*40);
kh=0.1;
p=0.09;
delta=0.1;
ktau=0.04;
Kc=0.2;
Khat=0.000015;
Kp=0.3;
kb=0.4;
Vs=T*0.9;
v_pmm=T*0.07;
alph0=T*0.003;
alph1=T*0.01;
Ke=14;
ks=0.2;
Kf=T*40;
kplc=0.11;
ki=2;
tmax=200/T;
e=0.0016;
vss=Vs/e;
K=(Khat)/ktau^4;
alpha0=delta.*(alph0)/ktau^4;
alpha1=delta.*(alph1)/ktau^4;
v_pm=delta.*(v_pmm)/ktau^4;
tmaxhat=tmax*ktau^4;
%[c,ct]=meshgrid(0:0.01:10);
%Renamed to constant to h0
% Given values of ct and h0
ct = 0.32;
h0 = 0.18;
A=@(c) (-(vss.*c.^2)./(ks.^2))+((Vs.*K.*gamma.^2.*ct.^2)./(ks.^2))+alpha0+alpha1.*((Ke.^4)./(Ke.^4+(gamma.*ct).^4));
h=@(c) (-0.4.*A(c).*((Kc.^4).*(Kp.^2))./((p.^2.*c.^4.*gamma.*ct.*Kf)));
% Define a function for the equation to solve
equation_to_solve = @(c) h(c) - h0;
% Initial guess for c
c0 = 0.010663;
% Use fzero
z_optimized = fzero(equation_to_solve, 0.5);
disp(['The optimized z value is approximately z = ', num2str(z_optimized)]);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Least Squares finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!